4 echo "Gentoo Linux Genkernel ${GK_V}"
6 echo " genkernel [options] action"
8 echo "Available Actions: "
9 echo " all Build all steps"
10 echo " kernel Build only the kernel and modules"
11 echo " initrd Build only the initrd"
13 echo "Available Options: "
14 echo " Debug settings"
15 echo " --debuglevel=<0-5> Debug Verbosity Level"
16 echo " --debugfile=<outfile> Output file for debug info"
17 echo " --color Output debug in color"
18 echo " --no-color Do not output debug in color"
19 echo " Kernel Configuration settings"
20 echo " --menuconfig Run menuconfig after oldconfig"
21 echo " --no-menuconfig Do not run menuconfig after oldconfig"
22 echo " --gconfig Run gconfig after oldconfig"
23 echo " --xconfig Run xconfig after oldconfig"
24 echo " --save-config Save the configuration to /etc/kernels"
25 echo " --no-save-config Don't save the configuration to /etc/kernels"
26 echo " Kernel Compile settings"
27 echo " --clean Run make clean before compilation"
28 echo " --mrproper Run make mrproper before compilation"
29 echo " --no-clean Do not run make clean before compilation"
30 echo " --no-mrproper Do not run make mrproper before compilation"
31 echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'"
32 echo " --bootsplash Install bootsplash support to the initrd"
33 echo " --no-bootsplash Do not use bootsplash"
34 echo " --gensplash Install gensplash support into bzImage"
35 echo " --no-gensplash Do not use gensplash"
36 echo " --install Install the kernel after building"
37 echo " --no-install Do not install the kernel after building"
38 echo " --no-initrdmodules Don't copy any modules to the initrd"
39 echo " --udev Enables udev support in your initrd"
40 echo " --no-udev Remove udev support."
41 echo " --callback=<...> Run the specified arguments after"
42 echo " the kernel and modules have been"
44 echo " --postconf=<...> Run the specified arguments after"
45 echo " the kernel has been configured."
46 echo " Kernel settings"
47 echo " --kerneldir=<dir> Location of the kernel sources"
48 echo " --kernel-config=<file> Kernel configuration file to use for compilation"
49 echo " --module-prefix=<dir> Prefix to kernel module destination, modules will"
50 echo " be installed in <prefix>/lib/modules"
51 echo " Low-Level Compile settings"
52 echo " --kernel-cc=<compiler> Compiler to use for kernel (e.g. distcc)"
53 echo " --kernel-as=<assembler> Assembler to use for kernel"
54 echo " --kernel-ld=<linker> Linker to use for kernel"
55 echo " --kernel-make=<makeprg> GNU Make to use for kernel"
56 echo " --utils-cc=<compiler> Compiler to use for utilities"
57 echo " --utils-as=<assembler> Assembler to use for utils"
58 echo " --utils-ld=<linker> Linker to use for utils"
59 echo " --utils-make=<makeprog> GNU Make to use for utils"
60 echo " --makeopts=<makeopts> Make options such as -j2, etc."
61 echo " --mountboot Mount /boot automatically"
62 echo " --no-mountboot Don't mount /boot automatically"
63 echo " Initialization"
64 echo " --bootsplash=<theme> Force bootsplash using <theme>."
65 echo " --gensplash=<theme> Force gensplash using <theme>."
66 echo " --do-keymap-auto Forces keymap selection at boot."
67 echo " --no-lvm2 Don't add in LVM2 support."
68 echo " --bootloader=grub Add new kernel to GRUB configuration"
70 echo " --arch-override=<arch> Force to arch instead of autodetect"
71 echo " --cachedir=<dir> Override the default cache location"
72 echo " --tempdir=<dir> Location of Genkernel's temporary directory"
73 echo " Output Settings"
74 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
75 echo " No modules outside of the initrd will be"
80 echo "Gentoo Linux Genkernel ${GK_V}"
82 echo " genkernel [options] all"
84 echo 'Some useful options:'
85 echo ' --menuconfig Run menuconfig after oldconfig'
86 echo ' --no-clean Do not run make clean before compilation'
87 echo ' --no-mrproper Do not run make mrproper before compilation,'
88 echo ' this is implied by --no-clean.'
90 echo 'For a detailed list of supported options and flags; issue:'
91 echo ' genkernel --help'
97 echo "$1" | cut -f2- -d=
105 CMD_KERNEL_CC=`parse_opt "$*"`
106 print_info 2 "CMD_KERNEL_CC: $CMD_KERNEL_CC"
109 CMD_KERNEL_LD=`parse_opt "$*"`
110 print_info 2 "CMD_KERNEL_LD: $CMD_KERNEL_LD"
113 CMD_KERNEL_AS=`parse_opt "$*"`
114 print_info 2 "CMD_KERNEL_AS: $CMD_KERNEL_AS"
117 CMD_KERNEL_MAKE=`parse_opt "$*"`
118 print_info 2 "CMD_KERNEL_MAKE: $CMD_KERNEL_MAKE"
121 CMD_UTILS_CC=`parse_opt "$*"`
122 print_info 2 "CMD_UTILS_CC: $CMD_UTILS_CC"
125 CMD_UTILS_LD=`parse_opt "$*"`
126 print_info 2 "CMD_UTILS_LD: $CMD_UTILS_LD"
129 CMD_UTILS_AS=`parse_opt "$*"`
130 print_info 2 "CMD_UTILS_AS: $CMD_UTILS_AS"
133 CMD_UTILS_MAKE=`parse_opt "$*"`
134 print_info 2 "CMD_UTILS_MAKE: $CMD_UTILS_MAKE"
137 CMD_MAKEOPTS=`parse_opt "$*"`
138 print_info 2 "CMD_MAKEOPTS: $CMD_MAKEOPTS"
142 print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
146 print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
150 print_info 2 "CMD_DOKEYMAPAUTO: $CMD_DOKEYMAPAUTO"
154 print_info 2 'CMD_NOLVM2: 1'
157 CMD_BOOTLOADER=`parse_opt "$*"`
158 print_info 2 "CMD_BOOTLOADER: $CMD_BOOTLOADER"
161 CMD_DEBUGLEVEL=`parse_opt "$*"`
162 DEBUGLEVEL="${CMD_DEBUGLEVEL}"
163 print_info 2 "CMD_DEBUGLEVEL: $CMD_DEBUGLEVEL"
166 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
167 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
169 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
171 echo "Error: You need a terminal with at least 80 columns"
172 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
176 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
180 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
184 print_info 2 "CMD_GCONFIG: $CMD_GCONFIG"
188 print_info 2 "CMD_XCONFIG: $CMD_XCONFIG"
192 print_info 2 "CMD_SAVE_CONFIG: $CMD_SAVE_CONFIG"
196 print_info 2 "CMD_SAVE_CONFIG: $CMD_SAVE_CONFIG"
200 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
204 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
208 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
212 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
217 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
218 print_info 2 "CMD_OLDCONFIG: $CMD_OLDCONFIG"
223 BOOTSPLASH_THEME=`parse_opt "$*"`
224 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
225 print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
226 print_info 2 "BOOTSPLASH_THEME: $BOOTSPLASH_THEME"
231 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
232 print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
236 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
241 GENSPLASH_THEME=`parse_opt "$*"`
242 print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
243 print_info 2 "GENSPLASH_THEME: $GENSPLASH_THEME"
244 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
249 GENSPLASH_THEME='default'
250 print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
251 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
255 print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
259 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
263 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
266 CMD_NOINITRDMODULES=1
267 print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
271 print_info 2 "CMD_UDEV: $CMD_UDEV"
275 print_info 2 "CMD_UDEV: $CMD_UDEV"
278 CMD_CALLBACK=`parse_opt "$*"`
279 print_info 2 "CMD_CALLBACK: $CMD_CALLBACK/$*"
282 CMD_POSTCONF=`parse_opt "$*"`
283 print_info 2 "CMD_POSTCONF: $CMD_POSTCONF/$*"
286 TEMP=`parse_opt "$*"`
287 print_info 2 "TEMP: $TEMP"
290 CMD_ARCHOVERRIDE=`parse_opt "$*"`
291 print_info 2 "CMD_ARCHOVERRIDE: $CMD_ARCHOVERRIDE"
295 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
299 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
302 CMD_DEBUGFILE=`parse_opt "$*"`
303 DEBUGFILE=`parse_opt "$*"`
304 print_info 2 "CMD_DEBUGFILE: $CMD_DEBUGFILE"
305 print_info 2 "DEBUGFILE: $CMD_DEBUGFILE"
308 CMD_KERNELDIR=`parse_opt "$*"`
309 print_info 2 "CMD_KERNELDIR: $CMD_KERNELDIR"
312 CMD_KERNEL_CONFIG=`parse_opt "$*"`
313 print_info 2 "CMD_KERNEL_CONFIG: $CMD_KERNEL_CONFIG"
316 CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
317 print_info 2 "CMD_INSTALL_MOD_PATH: $CMD_INSTALL_MOD_PATH"
320 CACHE_DIR=`parse_opt "$*"`
321 print_info 2 "CACHE_DIR: $CACHE_DIR"
324 CMD_MINKERNPACKAGE=`parse_opt "$*"`
325 print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE"
346 echo "Error: Unknown option '$*'!"