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"
94 echo " --arch-override=<arch> Force to arch instead of autodetect"
95 echo " --cachedir=<dir> Override the default cache location"
96 echo " --tempdir=<dir> Location of Genkernel's temporary directory"
97 echo " --postclear Clear all tmp files and caches after genkernel has run"
98 echo " Output Settings"
99 echo " --kernname=<...> Tag the kernel and initrd with a name:"
100 echo " If not defined the option defaults to"
102 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
103 echo " No modules outside of the initrd will be"
105 echo " --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the"
106 echo " callbacks have run"
107 echo " --kerncache=<tbz2> File to output a .tar.bz2'd kernel contents"
108 echo " of /lib/modules/ and the kernel config"
109 echo " NOTE: This is created before the callbacks"
111 echo " --no-kernel-sources This option is only valid if kerncache is"
112 echo " defined. If there is a valid kerncache no checks"
113 echo " will be made against a kernel source tree"
114 echo " --initramfs-overlay=<dir>"
115 echo " Directory structure to include in the initramfs,"
116 echo " only available on 2.6 kernels"
120 echo "Gentoo Linux Genkernel ${GK_V}"
122 echo " genkernel [options] all"
124 echo 'Some useful options:'
125 echo ' --menuconfig Run menuconfig after oldconfig'
126 echo ' --no-clean Do not run make clean before compilation'
127 echo ' --no-mrproper Do not run make mrproper before compilation,'
128 echo ' this is implied by --no-clean.'
130 echo 'For a detailed list of supported options and flags; issue:'
131 echo ' genkernel --help'
137 CMD_KERNEL_CC=`parse_opt "$*"`
138 print_info 2 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}"
141 CMD_KERNEL_LD=`parse_opt "$*"`
142 print_info 2 "CMD_KERNEL_LD: ${CMD_KERNEL_LD}"
145 CMD_KERNEL_AS=`parse_opt "$*"`
146 print_info 2 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}"
149 CMD_KERNEL_MAKE=`parse_opt "$*"`
150 print_info 2 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}"
152 --kernel-cross-compile=*)
153 CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"`
154 CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
155 print_info 2 "CMD_KERNEL_CROSS_COMPILE: ${CMD_KERNEL_CROSS_COMPILE}"
158 CMD_UTILS_CC=`parse_opt "$*"`
159 print_info 2 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
162 CMD_UTILS_LD=`parse_opt "$*"`
163 print_info 2 "CMD_UTILS_LD: ${CMD_UTILS_LD}"
166 CMD_UTILS_AS=`parse_opt "$*"`
167 print_info 2 "CMD_UTILS_AS: ${CMD_UTILS_AS}"
170 CMD_UTILS_MAKE=`parse_opt "$*"`
171 print_info 2 "CMD_UTILS_MAKE: ${CMD_UTILS_MAKE}"
173 --utils-cross-compile=*)
174 CMD_UTILS_CROSS_COMPILE=`parse_opt "$*"`
175 CMD_UTILS_CROSS_COMPILE=$(echo ${CMD_UTILS_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
176 print_info 2 "CMD_UTILS_CROSS_COMPILE: ${CMD_UTILS_CROSS_COMPILE}"
179 CMD_UTILS_ARCH=`parse_opt "$*"`
180 print_info 2 "CMD_UTILS_ARCH: ${CMD_ARCHOVERRIDE}"
183 CMD_MAKEOPTS=`parse_opt "$*"`
184 print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"
188 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
192 print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
195 BOOTDIR=`parse_opt "$*"`
196 print_info 2 "BOOTDIR: ${BOOTDIR}"
200 print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}"
204 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
208 print_info 2 "CMD_EVMS: ${CMD_EVMS}"
210 print_warning 1 "Please use --evms, as --evms2 is deprecated."
214 print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
216 print_warning 1 "WARNING: unionfs support is in active development and is not meant for general"
217 print_warning 1 "use."
218 print_warning 1 "Bug Reports without patches/fixes will be ignored."
219 print_warning 1 "Use at your own risk as this could blow up your system."
220 print_warning 1 "This code is subject to change at any time."
225 print_info 2 "CMD_LVM: ${CMD_LVM}"
229 print_info 2 "CMD_LVM: ${CMD_LVM}"
231 print_warning 1 "Please use --lvm, as --lvm2 is deprecated."
235 print_info 2 "CMD_MDADM: $CMD_MDADM"
239 print_info 2 "CMD_NO_BUSYBOX: ${CMD_NO_BUSYBOX}"
243 print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}"
246 if [ ! -e /usr/include/libdevmapper.h ]
248 echo 'Error: --dmraid requires device-mapper to be installed'
249 echo ' on the host system; try "emerge device-mapper".'
253 print_info 2 "CMD_DMRAID: ${CMD_DMRAID}"
256 CMD_BOOTLOADER=`parse_opt "$*"`
257 print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
260 CMD_LOGLEVEL=`parse_opt "$*"`
261 LOGLEVEL="${CMD_LOGLEVEL}"
262 print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}"
265 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
266 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
267 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
269 echo "Error: You need a terminal with at least 80 columns"
270 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
274 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
278 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
282 print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}"
286 print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}"
290 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
294 print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
298 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
302 print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
306 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
310 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
315 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
316 print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}"
320 SPLASH_THEME=`parse_opt "$*"`
321 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
322 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
324 print_warning 1 "Please use --splash, as --gensplash is deprecated."
328 SPLASH_THEME='default'
329 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
331 print_warning 1 "Please use --splash, as --gensplash is deprecated."
335 SPLASH_THEME=`parse_opt "$*"`
336 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
337 print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
341 SPLASH_THEME='default'
342 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
346 print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
349 SPLASH_RES=`parse_opt "$*"`
350 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
352 print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated."
355 SPLASH_RES=`parse_opt "$*"`
356 print_info 2 "SPLASH_RES: ${SPLASH_RES}"
360 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
364 print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
367 CMD_NOINITRDMODULES=1
368 print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
371 CMD_CALLBACK=`parse_opt "$*"`
372 print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
376 print_info 2 "CMD_STATIC: ${CMD_STATIC}"
380 print_info 2 "CMD_INITRAMFS: ${CMD_INITRAMFS}"
383 TMPDIR=`parse_opt "$*"`
384 TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
385 print_info 2 "TMPDIR: ${TMPDIR}"
386 print_info 2 "TEMP: ${TEMP}"
390 print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}"
393 CMD_ARCHOVERRIDE=`parse_opt "$*"`
394 print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}"
398 print_info 2 "USECOLOR: ${USECOLOR}"
403 print_info 2 "USECOLOR: ${USECOLOR}"
407 CMD_LOGFILE=`parse_opt "$*"`
408 LOGFILE=`parse_opt "$*"`
409 print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}"
410 print_info 2 "LOGFILE: ${CMD_LOGFILE}"
413 CMD_KERNELDIR=`parse_opt "$*"`
414 print_info 2 "CMD_KERNELDIR: ${CMD_KERNELDIR}"
417 CMD_KERNEL_CONFIG=`parse_opt "$*"`
418 print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}"
421 CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
422 print_info 2 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}"
425 CACHE_DIR=`parse_opt "$*"`
426 print_info 2 "CACHE_DIR: ${CACHE_DIR}"
429 CMD_MINKERNPACKAGE=`parse_opt "$*"`
430 print_info 2 "MINKERNPACKAGE: ${CMD_MINKERNPACKAGE}"
433 CMD_MODULESPACKAGE=`parse_opt "$*"`
434 print_info 2 "MODULESPACKAGE: ${CMD_MODULESPACKAGE}"
437 CMD_KERNCACHE=`parse_opt "$*"`
438 print_info 2 "KERNCACHE: ${CMD_KERNCACHE}"
441 CMD_KERNNAME=`parse_opt "$*"`
442 print_info 2 "KERNNAME: ${CMD_KERNNAME}"
446 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
450 print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
453 CMD_NO_KERNEL_SOURCES=1
454 print_info 2 "CMD_NO_KERNEL_SOURCES: ${CMD_NO_KERNEL_SOURCES}"
456 --initramfs-overlay=*)
457 CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
458 print_info 2 "CMD_INITRAMFS_OVERLAY: ${CMD_INITRAMFS_OVERLAY}"
461 CMD_LINUXRC=`parse_opt "$*"`
462 print_info 2 "CMD_LINUXRC: ${CMD_LINUXRC}"
465 KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
466 KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd'
467 ENABLE_PEGASOS_HACKS="yes"
468 print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
472 print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}"
476 print_info 2 "CMD_LUKS: ${CMD_LUKS}"
495 CMD_NOINITRDMODULES=1
496 print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
507 echo "Error: Unknown option '$*'!"