5 echo "Gentoo Linux Genkernel ${GK_V}"
7 echo " genkernel [options] action"
9 echo "Available Actions: "
10 echo " all Build all steps"
11 echo " bzImage Build only the kernel"
12 echo " initramfs Build only the ramdisk/initramfs"
13 echo " kernel Build only the kernel and modules"
14 echo " ramdisk Build only the ramdisk/initramfs"
16 echo "Available Options: "
17 echo " Configuration settings"
18 echo " --config=<file> genkernel configuration file to use"
19 echo " Debug settings"
20 echo " --loglevel=<0-5> Debug Verbosity Level"
21 echo " --logfile=<outfile> Output file for debug info"
22 echo " --color Output debug in color"
23 echo " --no-color Do not output debug in color"
24 echo " Kernel Configuration settings"
25 echo " --menuconfig Run menuconfig after oldconfig"
26 echo " --no-menuconfig Do not run menuconfig after oldconfig"
27 echo " --gconfig Run gconfig after oldconfig"
28 echo " --xconfig Run xconfig after oldconfig"
29 echo " --save-config Save the configuration to /etc/kernels"
30 echo " --no-save-config Don't save the configuration to /etc/kernels"
31 echo " Kernel Compile settings"
32 echo " --clean Run make clean before compilation"
33 echo " --mrproper Run make mrproper before compilation"
34 echo " --no-clean Do not run make clean before compilation"
35 echo " --no-mrproper Do not run make mrproper before compilation"
36 echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'"
37 echo " --gensplash Install framebuffer splash support into initramfs"
38 echo " --splash Install framebuffer splash support into initramfs"
39 echo " --no-splash Do not install framebuffer splash"
40 echo " --install Install the kernel after building"
41 echo " --no-install Do not install the kernel after building"
42 echo " --symlink Manage symlinks in /boot for installed images"
43 echo " --no-symlink Do not manage symlinks"
44 echo " --no-ramdisk-modules Don't copy any modules to the ramdisk"
45 echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk"
46 echo " --callback=<...> Run the specified arguments after the"
47 echo " kernel and modules have been compiled"
48 echo " --static Build a static (monolithic kernel)."
49 echo " Kernel settings"
50 echo " --kerneldir=<dir> Location of the kernel sources"
51 echo " --kernel-config=<file> Kernel configuration file to use for compilation"
52 echo " --module-prefix=<dir> Prefix to kernel module destination, modules"
53 echo " will be installed in <prefix>/lib/modules"
54 echo " Low-Level Compile settings"
55 echo " --kernel-cc=<compiler> Compiler to use for kernel (e.g. distcc)"
56 echo " --kernel-as=<assembler> Assembler to use for kernel"
57 echo " --kernel-ld=<linker> Linker to use for kernel"
58 echo " --kernel-cross-compile=<cross var> CROSS_COMPILE kernel variable"
59 echo " --kernel-make=<makeprg> GNU Make to use for kernel"
60 echo " --utils-cc=<compiler> Compiler to use for utilities"
61 echo " --utils-as=<assembler> Assembler to use for utils"
62 echo " --utils-ld=<linker> Linker to use for utils"
63 echo " --utils-make=<makeprog> GNU Make to use for utils"
64 echo " --utils-cross-compile=<cross var> CROSS_COMPILE utils variable"
65 echo " --utils-arch=<arch> Force to arch for utils only instead of"
67 echo " --makeopts=<makeopts> Make options such as -j2, etc..."
68 echo " --mountboot Mount BOOTDIR automatically if mountable"
69 echo " --no-mountboot Don't mount BOOTDIR automatically"
70 echo " --bootdir=<dir> Set the location of the boot-directory, default is /boot"
71 echo " Initialization"
72 echo " --gensplash=<theme> Enable framebuffer splash using <theme>"
73 echo " --gensplash-res=<res> Select splash theme resolutions to install"
74 echo " --splash=<theme> Enable framebuffer splash using <theme>"
75 echo " --splash-res=<res> Select splash theme resolutions to install"
76 echo " --do-keymap-auto Forces keymap selection at boot"
77 echo " --no-keymap Disables keymap selection support"
78 echo " --evms Include EVMS support"
79 echo " --> 'emerge evms' in the host operating system"
81 echo " --evms2 Include EVMS support"
82 echo " --> 'emerge evms' in the host operating system"
84 echo " --lvm Include LVM support"
85 echo " --lvm2 Include LVM support"
86 echo " --mdadm Copy /etc/mdadm.conf to initramfs"
87 echo " --dmraid Include DMRAID support"
88 echo " --multipath Include Multipath support"
89 echo " --iscsi Include iSCSI support"
90 echo " --slowusb Enables extra pauses for slow USB CD boots"
91 echo " --bootloader=grub Add new kernel to GRUB configuration"
92 echo " --linuxrc=<file> Specifies a user created linuxrc"
93 echo " --busybox-config=<file> Specifies a user created busybox config"
94 echo " --disklabel Include disk label and uuid support in your"
96 echo " --luks Include LUKS support"
97 echo " --> 'emerge cryptsetup-luks' with USE=-dynamic"
98 echo " --no-busybox Do not include busybox in the initramfs."
99 echo " --unionfs Include support for unionfs"
100 echo " --netboot Create a self-contained env in the initramfs"
101 echo " --real-root=<foo> Specify a default for real_root="
103 echo " --arch-override=<arch> Force to arch instead of autodetect"
104 echo " --cachedir=<dir> Override the default cache location"
105 echo " --tempdir=<dir> Location of Genkernel's temporary directory"
106 echo " --postclear Clear all tmp files and caches after genkernel has run"
107 echo " Output Settings"
108 echo " --kernname=<...> Tag the kernel and ramdisk with a name:"
109 echo " If not defined the option defaults to"
111 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and ramdisk:"
112 echo " No modules outside of the ramdisk will be"
114 echo " --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the"
115 echo " callbacks have run"
116 echo " --kerncache=<tbz2> File to output a .tar.bz2'd kernel contents"
117 echo " of /lib/modules/ and the kernel config"
118 echo " NOTE: This is created before the callbacks"
120 echo " --no-kernel-sources This option is only valid if kerncache is"
121 echo " defined. If there is a valid kerncache no checks"
122 echo " will be made against a kernel source tree"
123 echo " --initramfs-overlay=<dir>"
124 echo " Directory structure to include in the initramfs,"
125 echo " only available on 2.6 kernels"
127 echo " Enable copying of firmware into initramfs"
128 echo " --firmware-dir=<dir>"
129 echo " Specify directory to copy firmware from (defaults"
130 echo " to /lib/firmware)"
131 echo " --firmware-files=<files>"
132 echo " Specifies specific firmware files to copy. This"
133 echo " overrides --firmware-dir. For multiple files,"
134 echo " separate the filenames with a comma"
135 echo " --integrated-initramfs"
136 echo " Build the generated initramfs into the kernel instead of"
137 echo " keeping it as a separate file"
141 echo "Gentoo Linux Genkernel ${GK_V}"
143 echo " genkernel [options] all"
145 echo 'Some useful options:'
146 echo ' --menuconfig Run menuconfig after oldconfig'
147 echo ' --no-clean Do not run make clean before compilation'
148 echo ' --no-mrproper Do not run make mrproper before compilation,'
149 echo ' this is implied by --no-clean.'
151 echo 'For a detailed list of supported options and flags; issue:'
152 echo ' genkernel --help'
158 CMD_KERNEL_CC=`parse_opt "$*"`
159 print_info 2 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}"
162 CMD_KERNEL_LD=`parse_opt "$*"`
163 print_info 2 "CMD_KERNEL_LD: ${CMD_KERNEL_LD}"
166 CMD_KERNEL_AS=`parse_opt "$*"`
167 print_info 2 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}"
170 CMD_KERNEL_MAKE=`parse_opt "$*"`
171 print_info 2 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}"
173 --kernel-cross-compile=*)
174 CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"`
175 CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
176 print_info 2 "CMD_KERNEL_CROSS_COMPILE: ${CMD_KERNEL_CROSS_COMPILE}"
179 CMD_UTILS_CC=`parse_opt "$*"`
180 print_info 2 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
183 CMD_UTILS_LD=`parse_opt "$*"`
184 print_info 2 "CMD_UTILS_LD: ${CMD_UTILS_LD}"
187 CMD_UTILS_AS=`parse_opt "$*"`
188 print_info 2 "CMD_UTILS_AS: ${CMD_UTILS_AS}"
191 CMD_UTILS_MAKE=`parse_opt "$*"`
192 print_info 2 "CMD_UTILS_MAKE: ${CMD_UTILS_MAKE}"
194 --utils-cross-compile=*)
195 CMD_UTILS_CROSS_COMPILE=`parse_opt "$*"`
196 CMD_UTILS_CROSS_COMPILE=$(echo ${CMD_UTILS_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
197 print_info 2 "CMD_UTILS_CROSS_COMPILE: ${CMD_UTILS_CROSS_COMPILE}"
200 CMD_UTILS_ARCH=`parse_opt "$*"`
201 print_info 2 "CMD_UTILS_ARCH: ${CMD_ARCHOVERRIDE}"
204 CMD_MAKEOPTS=`parse_opt "$*"`
205 print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"
209 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
213 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
216 CMD_BOOTDIR=`parse_opt "$*"`
217 print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
222 print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}"
226 print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}"
230 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
234 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
236 print_warning 1 "Please use --evms, as --evms2 is deprecated."
240 print_info 2 "CMD_LVM: ${CMD_LVM}"
244 print_info 2 "CMD_LVM: ${CMD_LVM}"
246 print_warning 1 "Please use --lvm, as --lvm2 is deprecated."
250 print_info 2 "CMD_MDADM: $CMD_MDADM"
254 print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
258 print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
262 print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}"
265 CMD_REAL_ROOT=`parse_opt "$*"`
266 print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}"
270 print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}"
273 if [ ! -e /usr/include/libdevmapper.h ]
275 echo 'Error: --dmraid requires device-mapper to be installed'
276 echo ' on the host system; try "emerge device-mapper".'
280 print_info 2 "CMD_DMRAID: ${CMD_DMRAID}"
283 if [ ! -e /usr/include/libdevmapper.h ]
285 echo 'Error: --multipath requires device-mapper to be installed'
286 echo ' on the host;system; try "emerge device-mapper".'
290 print_info 2 "CMD_MULTIPATH: ${CMD_MULTIPATH}"
293 CMD_BOOTLOADER=`parse_opt "$*"`
294 print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
298 print_info 2 "CMD_ISCSI: ${CMD_ISCSI}"
301 CMD_LOGLEVEL=`parse_opt "$*"`
302 LOGLEVEL="${CMD_LOGLEVEL}"
303 print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}"
306 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
307 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
308 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
310 echo "Error: You need a terminal with at least 80 columns"
311 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
315 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
319 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
323 print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}"
327 print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}"
331 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
335 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
339 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
343 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
347 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
351 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
356 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
357 print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}"
361 SPLASH_THEME=`parse_opt "$*"`
362 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
363 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
365 print_warning 1 "Please use --splash, as --gensplash is deprecated."
369 SPLASH_THEME='default'
370 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
372 print_warning 1 "Please use --splash, as --gensplash is deprecated."
376 SPLASH_THEME=`parse_opt "$*"`
377 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
378 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
382 SPLASH_THEME='default'
383 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
387 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
390 SPLASH_RES=`parse_opt "$*"`
391 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
393 print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated."
396 SPLASH_RES=`parse_opt "$*"`
397 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
401 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
405 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
407 --no-ramdisk-modules)
408 CMD_NORAMDISKMODULES=1
409 print_info 2 "CMD_NORAMDISKMODULES: ${CMD_NORAMDISKMODULES}"
411 --all-ramdisk-modules)
412 CMD_ALLRAMDISKMODULES=1
413 print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}"
416 CMD_CALLBACK=`parse_opt "$*"`
417 print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
421 print_info 2 "CMD_STATIC: ${CMD_STATIC}"
424 TMPDIR=`parse_opt "$*"`
425 TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
426 print_info 2 "TMPDIR: ${TMPDIR}"
427 print_info 2 "TEMP: ${TEMP}"
431 print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}"
434 CMD_ARCHOVERRIDE=`parse_opt "$*"`
435 print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}"
439 print_info 2 "USECOLOR: ${USECOLOR}"
444 print_info 2 "USECOLOR: ${USECOLOR}"
448 CMD_LOGFILE=`parse_opt "$*"`
449 LOGFILE=`parse_opt "$*"`
450 print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}"
451 print_info 2 "LOGFILE: ${CMD_LOGFILE}"
454 CMD_KERNEL_DIR=`parse_opt "$*"`
455 print_info 2 "CMD_KERNEL_DIR: ${CMD_KERNEL_DIR}"
458 CMD_KERNEL_CONFIG=`parse_opt "$*"`
459 print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}"
462 CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
463 print_info 2 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}"
466 CACHE_DIR=`parse_opt "$*"`
467 print_info 2 "CACHE_DIR: ${CACHE_DIR}"
470 CMD_MINKERNPACKAGE=`parse_opt "$*"`
471 print_info 2 "MINKERNPACKAGE: ${CMD_MINKERNPACKAGE}"
474 CMD_MODULESPACKAGE=`parse_opt "$*"`
475 print_info 2 "MODULESPACKAGE: ${CMD_MODULESPACKAGE}"
478 CMD_KERNCACHE=`parse_opt "$*"`
479 print_info 2 "KERNCACHE: ${CMD_KERNCACHE}"
482 CMD_KERNNAME=`parse_opt "$*"`
483 print_info 2 "KERNNAME: ${CMD_KERNNAME}"
487 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
491 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
494 CMD_NO_KERNEL_SOURCES=1
495 print_info 2 "CMD_NO_KERNEL_SOURCES: ${CMD_NO_KERNEL_SOURCES}"
497 --initramfs-overlay=*)
498 CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
499 print_info 2 "CMD_INITRAMFS_OVERLAY: ${CMD_INITRAMFS_OVERLAY}"
502 CMD_LINUXRC=`parse_opt "$*"`
503 print_info 2 "CMD_LINUXRC: ${CMD_LINUXRC}"
506 CMD_BUSYBOX_CONFIG=`parse_opt "$*"`
507 print_info 2 "CMD_BUSYBOX_CONFIG: ${CMD_BUSYBOX_CONFIG}"
510 KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
511 KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd'
513 # ENABLE_PEGASOS_HACKS="yes"
514 # print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
518 print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}"
522 print_info 2 "CMD_LUKS: ${CMD_LUKS}"
526 print_info 2 "CMD_FIRMWARE: ${CMD_FIRMWARE}"
529 CMD_FIRMWARE_DIR=`parse_opt "$*"`
531 print_info 2 "CMD_FIRMWARE_DIR: ${CMD_FIRMWARE_DIR}"
534 CMD_FIRMWARE_FILES=`parse_opt "$*"`
536 print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}"
538 --integrated-initramfs)
539 CMD_INTEGRATED_INITRAMFS=1
540 print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}"
543 print_info 2 "CMD_GK_CONFIG: `parse_opt "$*"`"
562 CMD_NORAMDISKMODULES=1
563 print_info 2 "CMD_NORAMDISKMODULES: ${CMD_NORAMDISKMODULES}"
574 echo "Error: Unknown option '$*'!"