4 echo "Gentoo Linux Genkernel ${GK_V}"
6 echo " genkernel [options] action"
8 echo "Available Actions: "
9 echo " all Build all steps"
10 echo " bzImage Build only the kernel"
11 echo " kernel Build only the kernel and modules"
12 echo " initrd Build only the initrd"
14 echo "Available Options: "
15 echo " Configuration settings"
16 echo " --config=<file> genkernel configuration file to use"
17 echo " Debug settings"
18 echo " --loglevel=<0-5> Debug Verbosity Level"
19 echo " --logfile=<outfile> Output file for debug info"
20 echo " --color Output debug in color"
21 echo " --no-color Do not output debug in color"
22 echo " Kernel Configuration settings"
23 echo " --menuconfig Run menuconfig after oldconfig"
24 echo " --no-menuconfig Do not run menuconfig after oldconfig"
25 echo " --gconfig Run gconfig after oldconfig"
26 echo " --xconfig Run xconfig after oldconfig"
27 echo " --save-config Save the configuration to /etc/kernels"
28 echo " --no-save-config Don't save the configuration to /etc/kernels"
29 echo " Kernel Compile settings"
30 echo " --clean Run make clean before compilation"
31 echo " --mrproper Run make mrproper before compilation"
32 echo " --no-clean Do not run make clean before compilation"
33 echo " --no-mrproper Do not run make mrproper before compilation"
34 echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'"
35 echo " --gensplash Install framebuffer splash support into initramfs"
36 echo " --splash Install framebuffer splash support into initramfs"
37 echo " --no-splash Do not install framebuffer splash"
38 echo " --install Install the kernel after building"
39 echo " --no-install Do not install the kernel after building"
40 echo " --symlink Manage symlinks in /boot for installed images"
41 echo " --no-symlink Do not manage symlinks"
42 echo " --no-initrdmodules Don't copy any modules to the initrd"
43 echo " --callback=<...> Run the specified arguments after the"
44 echo " kernel and modules have been compiled"
45 echo " --static Build a static (monolithic kernel)."
46 echo " --initramfs Builds initramfs before kernel and embeds it"
47 echo " into the kernel."
48 echo " Kernel settings"
49 echo " --kerneldir=<dir> Location of the kernel sources"
50 echo " --kernel-config=<file> Kernel configuration file to use for compilation"
51 echo " --module-prefix=<dir> Prefix to kernel module destination, modules"
52 echo " will be installed in <prefix>/lib/modules"
53 echo " Low-Level Compile settings"
54 echo " --kernel-cc=<compiler> Compiler to use for kernel (e.g. distcc)"
55 echo " --kernel-as=<assembler> Assembler to use for kernel"
56 echo " --kernel-ld=<linker> Linker to use for kernel"
57 echo " --kernel-cross-compile=<cross var> CROSS_COMPILE kernel variable"
58 echo " --kernel-make=<makeprg> GNU Make to use for kernel"
59 echo " --utils-cc=<compiler> Compiler to use for utilities"
60 echo " --utils-as=<assembler> Assembler to use for utils"
61 echo " --utils-ld=<linker> Linker to use for utils"
62 echo " --utils-make=<makeprog> GNU Make to use for utils"
63 echo " --utils-cross-compile=<cross var> CROSS_COMPILE utils variable"
64 echo " --utils-arch=<arch> Force to arch for utils only instead of"
66 echo " --makeopts=<makeopts> Make options such as -j2, etc..."
67 echo " --mountboot Mount BOOTDIR automatically if mountable"
68 echo " --no-mountboot Don't mount BOOTDIR automatically"
69 echo " --bootdir=<dir> Set the location of the boot-directory, default is /boot"
70 echo " Initialization"
71 echo " --gensplash=<theme> Enable framebuffer splash using <theme>"
72 echo " --gensplash-res=<res> Select splash theme resolutions to install"
73 echo " --splash=<theme> Enable framebuffer splash using <theme>"
74 echo " --splash-res=<res> Select splash theme resolutions to install"
75 echo " --do-keymap-auto Forces keymap selection at boot"
76 echo " --evms Include EVMS support"
77 echo " --> 'emerge evms' in the host operating system"
79 echo " --evms2 Include EVMS support"
80 echo " --> 'emerge evms' in the host operating system"
82 echo " --lvm Include LVM support"
83 echo " --lvm2 Include LVM support"
84 echo " --mdadm Copy /etc/mdadm.conf to initramfs"
85 echo " --dmraid Include DMRAID support"
86 echo " --slowusb Enables extra pauses for slow USB CD boots"
87 echo " --bootloader=grub Add new kernel to GRUB configuration"
88 echo " --linuxrc=<file> Specifies a user created linuxrc"
89 echo " --disklabel Include disk label and uuid support in your"
91 echo " --luks Include LUKS support"
92 echo " --> 'emerge cryptsetup-luks' with USE=-dynamic"
93 echo " --no-busybox Do not include busybox in the initrd or initramfs."
95 echo " --arch-override=<arch> Force to arch instead of autodetect"
96 echo " --cachedir=<dir> Override the default cache location"
97 echo " --tempdir=<dir> Location of Genkernel's temporary directory"
98 echo " --postclear Clear all tmp files and caches after genkernel has run"
99 echo " Output Settings"
100 echo " --kernname=<...> Tag the kernel and initrd with a name:"
101 echo " If not defined the option defaults to"
103 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
104 echo " No modules outside of the initrd will be"
106 echo " --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the"
107 echo " callbacks have run"
108 echo " --kerncache=<tbz2> File to output a .tar.bz2'd kernel contents"
109 echo " of /lib/modules/ and the kernel config"
110 echo " NOTE: This is created before the callbacks"
112 echo " --no-kernel-sources This option is only valid if kerncache is"
113 echo " defined. If there is a valid kerncache no checks"
114 echo " will be made against a kernel source tree"
115 echo " --initramfs-overlay=<dir>"
116 echo " Directory structure to include in the initramfs,"
117 echo " only available on 2.6 kernels"
121 echo "Gentoo Linux Genkernel ${GK_V}"
123 echo " genkernel [options] all"
125 echo 'Some useful options:'
126 echo ' --menuconfig Run menuconfig after oldconfig'
127 echo ' --no-clean Do not run make clean before compilation'
128 echo ' --no-mrproper Do not run make mrproper before compilation,'
129 echo ' this is implied by --no-clean.'
131 echo 'For a detailed list of supported options and flags; issue:'
132 echo ' genkernel --help'
138 CMD_KERNEL_CC=`parse_opt "$*"`
139 print_info 2 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}"
142 CMD_KERNEL_LD=`parse_opt "$*"`
143 print_info 2 "CMD_KERNEL_LD: ${CMD_KERNEL_LD}"
146 CMD_KERNEL_AS=`parse_opt "$*"`
147 print_info 2 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}"
150 CMD_KERNEL_MAKE=`parse_opt "$*"`
151 print_info 2 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}"
153 --kernel-cross-compile=*)
154 CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"`
155 CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
156 print_info 2 "CMD_KERNEL_CROSS_COMPILE: ${CMD_KERNEL_CROSS_COMPILE}"
159 CMD_UTILS_CC=`parse_opt "$*"`
160 print_info 2 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
163 CMD_UTILS_LD=`parse_opt "$*"`
164 print_info 2 "CMD_UTILS_LD: ${CMD_UTILS_LD}"
167 CMD_UTILS_AS=`parse_opt "$*"`
168 print_info 2 "CMD_UTILS_AS: ${CMD_UTILS_AS}"
171 CMD_UTILS_MAKE=`parse_opt "$*"`
172 print_info 2 "CMD_UTILS_MAKE: ${CMD_UTILS_MAKE}"
174 --utils-cross-compile=*)
175 CMD_UTILS_CROSS_COMPILE=`parse_opt "$*"`
176 CMD_UTILS_CROSS_COMPILE=$(echo ${CMD_UTILS_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
177 print_info 2 "CMD_UTILS_CROSS_COMPILE: ${CMD_UTILS_CROSS_COMPILE}"
180 CMD_UTILS_ARCH=`parse_opt "$*"`
181 print_info 2 "CMD_UTILS_ARCH: ${CMD_ARCHOVERRIDE}"
184 CMD_MAKEOPTS=`parse_opt "$*"`
185 print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"
189 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
193 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
196 CMD_BOOTDIR=`parse_opt "$*"`
197 print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
201 print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}"
205 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
209 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
211 print_warning 1 "Please use --evms, as --evms2 is deprecated."
215 print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
217 print_warning 1 "WARNING: unionfs support is in active development and is not meant for general"
218 print_warning 1 "use."
219 print_warning 1 "Bug Reports without patches/fixes will be ignored."
220 print_warning 1 "Use at your own risk as this could blow up your system."
221 print_warning 1 "This code is subject to change at any time."
226 print_info 2 "CMD_LVM: ${CMD_LVM}"
230 print_info 2 "CMD_LVM: ${CMD_LVM}"
232 print_warning 1 "Please use --lvm, as --lvm2 is deprecated."
236 print_info 2 "CMD_MDADM: $CMD_MDADM"
240 print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
244 print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}"
247 if [ ! -e /usr/include/libdevmapper.h ]
249 echo 'Error: --dmraid requires device-mapper to be installed'
250 echo ' on the host system; try "emerge device-mapper".'
254 print_info 2 "CMD_DMRAID: ${CMD_DMRAID}"
257 CMD_BOOTLOADER=`parse_opt "$*"`
258 print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
261 CMD_LOGLEVEL=`parse_opt "$*"`
262 LOGLEVEL="${CMD_LOGLEVEL}"
263 print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}"
266 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
267 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
268 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
270 echo "Error: You need a terminal with at least 80 columns"
271 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
275 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
279 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
283 print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}"
287 print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}"
291 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
295 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
299 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
303 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
307 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
311 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
316 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
317 print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}"
321 SPLASH_THEME=`parse_opt "$*"`
322 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
323 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
325 print_warning 1 "Please use --splash, as --gensplash is deprecated."
329 SPLASH_THEME='default'
330 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
332 print_warning 1 "Please use --splash, as --gensplash is deprecated."
336 SPLASH_THEME=`parse_opt "$*"`
337 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
338 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
342 SPLASH_THEME='default'
343 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
347 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
350 SPLASH_RES=`parse_opt "$*"`
351 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
353 print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated."
356 SPLASH_RES=`parse_opt "$*"`
357 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
361 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
365 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
368 CMD_NOINITRDMODULES=1
369 print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
372 CMD_CALLBACK=`parse_opt "$*"`
373 print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
377 print_info 2 "CMD_STATIC: ${CMD_STATIC}"
381 print_info 2 "CMD_INITRAMFS: ${CMD_INITRAMFS}"
384 TMPDIR=`parse_opt "$*"`
385 TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
386 print_info 2 "TMPDIR: ${TMPDIR}"
387 print_info 2 "TEMP: ${TEMP}"
391 print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}"
394 CMD_ARCHOVERRIDE=`parse_opt "$*"`
395 print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}"
399 print_info 2 "USECOLOR: ${USECOLOR}"
404 print_info 2 "USECOLOR: ${USECOLOR}"
408 CMD_LOGFILE=`parse_opt "$*"`
409 LOGFILE=`parse_opt "$*"`
410 print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}"
411 print_info 2 "LOGFILE: ${CMD_LOGFILE}"
414 CMD_KERNELDIR=`parse_opt "$*"`
415 print_info 2 "CMD_KERNELDIR: ${CMD_KERNELDIR}"
418 CMD_KERNEL_CONFIG=`parse_opt "$*"`
419 print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}"
422 CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
423 print_info 2 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}"
426 CACHE_DIR=`parse_opt "$*"`
427 print_info 2 "CACHE_DIR: ${CACHE_DIR}"
430 CMD_MINKERNPACKAGE=`parse_opt "$*"`
431 print_info 2 "MINKERNPACKAGE: ${CMD_MINKERNPACKAGE}"
434 CMD_MODULESPACKAGE=`parse_opt "$*"`
435 print_info 2 "MODULESPACKAGE: ${CMD_MODULESPACKAGE}"
438 CMD_KERNCACHE=`parse_opt "$*"`
439 print_info 2 "KERNCACHE: ${CMD_KERNCACHE}"
442 CMD_KERNNAME=`parse_opt "$*"`
443 print_info 2 "KERNNAME: ${CMD_KERNNAME}"
447 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
451 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
454 CMD_NO_KERNEL_SOURCES=1
455 print_info 2 "CMD_NO_KERNEL_SOURCES: ${CMD_NO_KERNEL_SOURCES}"
457 --initramfs-overlay=*)
458 CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
459 print_info 2 "CMD_INITRAMFS_OVERLAY: ${CMD_INITRAMFS_OVERLAY}"
462 CMD_LINUXRC=`parse_opt "$*"`
463 print_info 2 "CMD_LINUXRC: ${CMD_LINUXRC}"
466 KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
467 KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd'
468 ENABLE_PEGASOS_HACKS="yes"
469 print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
473 print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}"
477 print_info 2 "CMD_LUKS: ${CMD_LUKS}"
496 CMD_NOINITRDMODULES=1
497 print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
508 echo "Error: Unknown option '$*'!"