1. the traditional way to compile the official kernel directly in the console, the need for the following software package bin86-16-bitassemblerandloaderdiff-Filecomparisonutilitieslibc6-dev-GNUCLibrary: DevelopmentLibrariesandHeaderFileslibncurses5-dev
1. the following software packages are required to compile the official kernel directly on the console in traditional mode:
Bin86-16-bit runner ER and loader
Diff-File comparison utilities
Libc6-dev-gnu c Library: Development Libraries and HeaderFiles
Libncurses5-dev-Developer's libraries and docs for ncurses
Patch-Apply a diff file to an original
2. make xconfig
Tk8.4-Tk toolkit for Tcl and X11, v8.4-run-time files
Make xconfig
Libqt3-mt-dev-Qt development files (Threaded)
Make gconfig
Libgtk2.0-dev-Development files for the GTK + library
3. if you want to make the deb package of the kernel, you also need
Debianutils-Miscellaneous utilities specific to Debian
Kernel-package-A utility for building Linux kernel relatedDebian package
Ksymoops-Linux kernel oops and error message decoder
Kernel Compilation
Http://www.debian.org/doc/manuals/reference/ch-kernel.zh-cn.html
Gcc, binutils, and modutils in the Debianunstable release can be used to compile the latest Linux kernel. For more information, see the second half of the/usr/share/doc/kernel-package/README.gz file.
Kernel compilation is a very difficult issue. as the goal is constantly changing, even the most respected developers may have different opinions: ManojSrivastava writes: -- initrd requires the Debian dedicated cramfs patch. HerbertXu writes: No, it is not required. you want to use
For file systems other than CRAMFS, you only need to set MKIMAGE in/etc/mkinitrd. conf.
Follow the instructions in/usr/share/doc/kernel-package/README.gz written by Manoj and Kent to be careful, if you want to compile the kernel of the latest version, make sure that the kernel package of the latest unstable version is installed.
For single-host kernel compilation, initrd is not required. I use it to expect that the newly compiled kernel is exactly the same as the corresponding kernel image. If you are using initrd, read mkinitrd (8) and mkinitrd. conf (5) first ). See http://bugs.debian.org/149236.
Standard Debian mode
Check out the error reports related to kernel-package, gcc, binutils, and modutils. Use a newer version as required.
Be careful when compiling a custom kernel with source code in the Debian system. It is safer to use the -- append_to_version option of make-kpkg to create multiple kernel images.
# Apt-get install debhelper modutils kernel-packagelibncurses5-dev
# Apt-get install kernel-source-2.4.18 # use the latest version
# Apt-get install fakeroot
# Vi/etc/kernel-pkg.conf # enter my name and email
$ Cd/usr/src
# Creating a directory
$ Tar -- bzip2-xvf kernel-source-2.4.18.tar.bz2
$ Cd kernel-source-2.4.18 # if this is your kernel source code
$ Cp/boot/config-2.4.18-386. config # set the current configuration to the default configuration
$ Make menuconfig # customized according to your preferences
$ Make-kpkg clean # you must perform this step (per: man make-kpkg)
$ Fakeroot make-kpkg -- append_to_version-486 -- initrd \
-- Revision = rev.01 kernel_image \
Modules_image # modules_image
Is pcmcia-cs.
$ Cd .. # dpkg-I kernel-image *. deb pcmcia-cs *. deb # installation
Make-kpkg kernel_image actually executes make oldconfig and makedep. If initrd is not used, do not use
-- Initrd option.
If you want to load the pcmcia-cs module or do not have pcmcia, select "General setup->" after make menuconfig to go to "PCMCIA/carw.support-> ", configure the "<> PCMCIA/CardBussupport" option (for example, cancel the option ).
For SMP machines, set CONCURRENCY_LEVEL as described in kernel-pkg.conf (5)