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 " --all-initrd-modules Copy all kernel modules to the initrd"
44 echo " --callback=<...> Run the specified arguments after the"
45 echo " kernel and modules have been compiled"
46 echo " --static Build a static (monolithic kernel)."
47 echo " --initramfs Builds initramfs before kernel and embeds it"
48 echo " into the 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 " --slowusb Enables extra pauses for slow USB CD boots"
89 echo " --bootloader=grub Add new kernel to GRUB configuration"
90 echo " --linuxrc=<file> Specifies a user created linuxrc"
91 echo " --disklabel Include disk label and uuid support in your"
93 echo " --luks Include LUKS support"
94 echo " --> 'emerge cryptsetup-luks' with USE=-dynamic"
95 echo " --no-busybox Do not include busybox in the initrd or initramfs."
97 echo " --arch-override=<arch> Force to arch instead of autodetect"
98 echo " --cachedir=<dir> Override the default cache location"
99 echo " --tempdir=<dir> Location of Genkernel's temporary directory"
100 echo " --postclear Clear all tmp files and caches after genkernel has run"
101 echo " Output Settings"
102 echo " --kernname=<...> Tag the kernel and initrd with a name:"
103 echo " If not defined the option defaults to"
105 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
106 echo " No modules outside of the initrd will be"
108 echo " --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the"
109 echo " callbacks have run"
110 echo " --kerncache=<tbz2> File to output a .tar.bz2'd kernel contents"
111 echo " of /lib/modules/ and the kernel config"
112 echo " NOTE: This is created before the callbacks"
114 echo " --no-kernel-sources This option is only valid if kerncache is"
115 echo " defined. If there is a valid kerncache no checks"
116 echo " will be made against a kernel source tree"
117 echo " --initramfs-overlay=<dir>"
118 echo " Directory structure to include in the initramfs,"
119 echo " only available on 2.6 kernels"
121 echo " Enable copying of firmware into initramfs"
122 echo " --firmware-dir=<dir>"
123 echo " Specify directory to copy firmware from (defaults"
124 echo " to /lib/firmware)"
125 echo " --firmware-files=<files>"
126 echo " Specifies specific firmware files to copy. This"
127 echo " overrides --firmware-dir. For multiple files,"
128 echo " separate the filenames with a comma"
129 echo " --integrated-initramfs"
130 echo " Build the generated initramfs into the kernel instead of"
131 echo " keeping it as a separate file"
135 echo "Gentoo Linux Genkernel ${GK_V}"
137 echo " genkernel [options] all"
139 echo 'Some useful options:'
140 echo ' --menuconfig Run menuconfig after oldconfig'
141 echo ' --no-clean Do not run make clean before compilation'
142 echo ' --no-mrproper Do not run make mrproper before compilation,'
143 echo ' this is implied by --no-clean.'
145 echo 'For a detailed list of supported options and flags; issue:'
146 echo ' genkernel --help'
152 CMD_KERNEL_CC=`parse_opt "$*"`
153 print_info 2 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}"
156 CMD_KERNEL_LD=`parse_opt "$*"`
157 print_info 2 "CMD_KERNEL_LD: ${CMD_KERNEL_LD}"
160 CMD_KERNEL_AS=`parse_opt "$*"`
161 print_info 2 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}"
164 CMD_KERNEL_MAKE=`parse_opt "$*"`
165 print_info 2 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}"
167 --kernel-cross-compile=*)
168 CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"`
169 CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
170 print_info 2 "CMD_KERNEL_CROSS_COMPILE: ${CMD_KERNEL_CROSS_COMPILE}"
173 CMD_UTILS_CC=`parse_opt "$*"`
174 print_info 2 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
177 CMD_UTILS_LD=`parse_opt "$*"`
178 print_info 2 "CMD_UTILS_LD: ${CMD_UTILS_LD}"
181 CMD_UTILS_AS=`parse_opt "$*"`
182 print_info 2 "CMD_UTILS_AS: ${CMD_UTILS_AS}"
185 CMD_UTILS_MAKE=`parse_opt "$*"`
186 print_info 2 "CMD_UTILS_MAKE: ${CMD_UTILS_MAKE}"
188 --utils-cross-compile=*)
189 CMD_UTILS_CROSS_COMPILE=`parse_opt "$*"`
190 CMD_UTILS_CROSS_COMPILE=$(echo ${CMD_UTILS_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
191 print_info 2 "CMD_UTILS_CROSS_COMPILE: ${CMD_UTILS_CROSS_COMPILE}"
194 CMD_UTILS_ARCH=`parse_opt "$*"`
195 print_info 2 "CMD_UTILS_ARCH: ${CMD_ARCHOVERRIDE}"
198 CMD_MAKEOPTS=`parse_opt "$*"`
199 print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"
203 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
207 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
210 CMD_BOOTDIR=`parse_opt "$*"`
211 print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
216 print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}"
220 print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}"
224 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
228 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
230 print_warning 1 "Please use --evms, as --evms2 is deprecated."
234 print_info 2 "CMD_LVM: ${CMD_LVM}"
238 print_info 2 "CMD_LVM: ${CMD_LVM}"
240 print_warning 1 "Please use --lvm, as --lvm2 is deprecated."
244 print_info 2 "CMD_MDADM: $CMD_MDADM"
248 print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
252 print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}"
255 if [ ! -e /usr/include/libdevmapper.h ]
257 echo 'Error: --dmraid requires device-mapper to be installed'
258 echo ' on the host system; try "emerge device-mapper".'
262 print_info 2 "CMD_DMRAID: ${CMD_DMRAID}"
265 CMD_BOOTLOADER=`parse_opt "$*"`
266 print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
269 CMD_LOGLEVEL=`parse_opt "$*"`
270 LOGLEVEL="${CMD_LOGLEVEL}"
271 print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}"
274 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
275 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
276 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
278 echo "Error: You need a terminal with at least 80 columns"
279 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
283 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
287 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
291 print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}"
295 print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}"
299 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
303 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
307 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
311 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
315 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
319 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
324 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
325 print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}"
329 SPLASH_THEME=`parse_opt "$*"`
330 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
331 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
333 print_warning 1 "Please use --splash, as --gensplash is deprecated."
337 SPLASH_THEME='default'
338 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
340 print_warning 1 "Please use --splash, as --gensplash is deprecated."
344 SPLASH_THEME=`parse_opt "$*"`
345 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
346 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
350 SPLASH_THEME='default'
351 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
355 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
358 SPLASH_RES=`parse_opt "$*"`
359 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
361 print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated."
364 SPLASH_RES=`parse_opt "$*"`
365 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
369 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
373 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
376 CMD_NOINITRDMODULES=1
377 print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
379 --all-initrd-modules)
380 CMD_ALLINITRDMODULES=1
381 print_info 2 "CMD_ALLINITRDMODULES: ${CMD_ALLINITRDMODULES}"
384 CMD_CALLBACK=`parse_opt "$*"`
385 print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
389 print_info 2 "CMD_STATIC: ${CMD_STATIC}"
393 print_info 2 "CMD_INITRAMFS: ${CMD_INITRAMFS}"
396 TMPDIR=`parse_opt "$*"`
397 TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
398 print_info 2 "TMPDIR: ${TMPDIR}"
399 print_info 2 "TEMP: ${TEMP}"
403 print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}"
406 CMD_ARCHOVERRIDE=`parse_opt "$*"`
407 print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}"
411 print_info 2 "USECOLOR: ${USECOLOR}"
416 print_info 2 "USECOLOR: ${USECOLOR}"
420 CMD_LOGFILE=`parse_opt "$*"`
421 LOGFILE=`parse_opt "$*"`
422 print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}"
423 print_info 2 "LOGFILE: ${CMD_LOGFILE}"
426 CMD_KERNEL_DIR=`parse_opt "$*"`
427 print_info 2 "CMD_KERNEL_DIR: ${CMD_KERNEL_DIR}"
430 CMD_KERNEL_CONFIG=`parse_opt "$*"`
431 print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}"
434 CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
435 print_info 2 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}"
438 CACHE_DIR=`parse_opt "$*"`
439 print_info 2 "CACHE_DIR: ${CACHE_DIR}"
442 CMD_MINKERNPACKAGE=`parse_opt "$*"`
443 print_info 2 "MINKERNPACKAGE: ${CMD_MINKERNPACKAGE}"
446 CMD_MODULESPACKAGE=`parse_opt "$*"`
447 print_info 2 "MODULESPACKAGE: ${CMD_MODULESPACKAGE}"
450 CMD_KERNCACHE=`parse_opt "$*"`
451 print_info 2 "KERNCACHE: ${CMD_KERNCACHE}"
454 CMD_KERNNAME=`parse_opt "$*"`
455 print_info 2 "KERNNAME: ${CMD_KERNNAME}"
459 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
463 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
466 CMD_NO_KERNEL_SOURCES=1
467 print_info 2 "CMD_NO_KERNEL_SOURCES: ${CMD_NO_KERNEL_SOURCES}"
469 --initramfs-overlay=*)
470 CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
471 print_info 2 "CMD_INITRAMFS_OVERLAY: ${CMD_INITRAMFS_OVERLAY}"
474 CMD_LINUXRC=`parse_opt "$*"`
475 print_info 2 "CMD_LINUXRC: ${CMD_LINUXRC}"
478 KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
479 KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd'
481 # ENABLE_PEGASOS_HACKS="yes"
482 # print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
486 print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}"
490 print_info 2 "CMD_LUKS: ${CMD_LUKS}"
494 print_info 2 "CMD_FIRMWARE: ${CMD_FIRMWARE}"
497 CMD_FIRMWARE_DIR=`parse_opt "$*"`
499 print_info 2 "CMD_FIRMWARE_DIR: ${CMD_FIRMWARE_DIR}"
502 CMD_FIRMWARE_FILES=`parse_opt "$*"`
504 print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}"
506 --integrated-initramfs)
507 CMD_INTEGRATED_INITRAMFS=1
508 print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}"
527 CMD_NOINITRDMODULES=1
528 print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
539 echo "Error: Unknown option '$*'!"