1.Alternate configuration commands are:
依赖原来的内核配置:
"make config" Plain text interface.
"make menuconfig" Text based color menus, radiolists & dialogs.
"make nconfig" Enhanced text based color menus.
"make xconfig" X windows (Qt) based configuration tool.
"make gconfig" X windows (Gtk) based configuration tool.
"make oldconfig" Default all questions based on the
(no .config then old one) contents of your existing ./.config
file and asking about new config symbols.
"make silentoldconfig" Like above, but avoids cluttering the screen with questions already answered.
(如果直接敲"make silentoldconfig"会提示找不到.config文件)
不依赖原来的内核配置:
"make defconfig" Create a ./.config file by using the default symbol values from either arch/$ARCH/defconfig or arch/$ARCH/configs/${PLATFORM}_defconfig,
depending on the architecture.
"make ${PLATFORM_defconfig}" Create a ./.config file by using the default symbol values from arch/$ARCH/configs/${PLATFORM}_defconfig.
Use "make help" to get a list of all available platforms of your architecture.
"make allyesconfig" Create a ./.config file by setting symbol values to'y' as much as possible.
"make allmodconfig" Create a ./.config file by setting symbol values to 'm' as much as possible.
"make allnoconfig" Create a ./.config file by setting symbol values to 'n' as much as possible.
"make randconfig" Create a ./.config file by setting symbol values to random values.
[摘自:内核源码的README文件]
2.用make defconfig配置内核,编译内核的时候不会编译(大量的)内核模块,-j4编译时间30分钟左右。
3.一个配置过程:
[root@bogon linux-2.6.38.2]# tar jxvf linux-2.6.38.2.tar.bz2
[root@bogon linux-2.6.38.2]# cd linux-2.6.38.2
[root@bogon linux-2.6.38.2]# make menuconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/kxgettext.o
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/mconf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
#
# using defaults found in /boot/config-2.6.32-220.el6.i686
#
/boot/config-2.6.32-220.el6.i686:582:warning: symbol value 'm' invalid for PCCARD_NONSTATIC
/boot/config-2.6.32-220.el6.i686:2696:warning: symbol value 'm' invalid for MFD_WM831X
/boot/config-2.6.32-220.el6.i686:2697:warning: symbol value 'm' invalid for MFD_WM8350
/boot/config-2.6.32-220.el6.i686:2710:warning: symbol value 'm' invalid for MFD_WM8350_I2C
/boot/config-2.6.32-220.el6.i686:2712:warning: symbol value 'm' invalid for AB3100_CORE
/boot/config-2.6.32-220.el6.i686:3678:warning: symbol value 'm' invalid for MMC_RICOH_MMC
#
# configuration written to .config
#
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
说明:
直接用make menuconfig配置内核会使用老版本内核2.6.32-220.el6.i686的配置(会自动找到老版本内核的配置文件,一般在
/boot目录下)
4.make config类似make menuconfig,都会使用老版本内核的配置,只不过它是“询问”的方式。
5.linux2.6.38.2的内核默认配置是不支持ext2文件系统的。正如我所遇到的情况:用ext2格式化initrd,但用默认配置的内核去
挂载initrd。
6.配置内核的时候加入不需要的驱动会使内核更大,并且在有些情况下还会导致问题的出现。