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 " --install Install the kernel after building"
35 echo " --no-install Do not install the kernel after building"
36 echo " --no-initrdmodules Don't copy any modules to the initrd"
37 echo " --udev Add in udev support."
38 echo " --callback=<...> Run the specified arguments after"
39 echo " the kernel and modules have been"
41 echo " Kernel settings"
42 echo " --kerneldir=<dir> Location of the kernel sources"
43 echo " --kernel-config=<file> Kernel configuration file to use for compilation"
44 echo " --module-prefix=<dir> Prefix to kernel module destination, modules will"
45 echo " be installed in <prefix>/lib/modules"
46 echo " Low-Level Compile settings"
47 echo " --kernel-cc=<compiler> Compiler to use for kernel (e.g. distcc)"
48 echo " --kernel-as=<assembler> Assembler to use for kernel"
49 echo " --kernel-ld=<linker> Linker to use for kernel"
50 echo " --kernel-make=<makeprg> GNU Make to use for kernel"
51 echo " --utils-cc=<compiler> Compiler to use for utilities"
52 echo " --utils-as=<assembler> Assembler to use for utils"
53 echo " --utils-ld=<linker> Linker to use for utils"
54 echo " --utils-make=<makeprog> GNU Make to use for utils"
55 echo " --makeopts=<makeopts> Make options such as -j2, etc."
56 echo " --mountboot Mount /boot automatically"
57 echo " --no-mountboot Don't mount /boot automatically"
58 echo " Initialization"
59 echo " --bootsplash=<theme> Force bootsplash using <theme>."
60 echo " --do-keymap-auto Forces keymap selection at boot."
61 echo " --no-lvm2 Don't add in LVM2 support."
62 echo " --bootloader=grub Add new kernel to GRUB configuration"
64 echo " --arch-override=<arch> Force to arch instead of autodetect"
65 echo " --cachedir=<dir> Override the default cache location"
66 echo " --tempdir=<dir> Location of Genkernel's temporary directory"
67 echo " Output Settings"
68 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
69 echo " No modules outside of the initrd will be"
74 echo "Gentoo Linux Genkernel ${GK_V}"
76 echo " genkernel [options] all"
78 echo 'Some useful options:'
79 echo ' --menuconfig Run menuconfig after oldconfig'
80 echo ' --no-clean Do not run make clean before compilation'
81 echo ' --no-mrproper Do not run make mrproper before compilation,'
82 echo ' this is implied by --no-clean.'
84 echo 'For a detailed list of supported options and flags; issue:'
85 echo ' genkernel --help'
91 echo "$1" | cut -f2- -d=
99 CMD_KERNEL_CC=`parse_opt "$*"`
100 print_info 2 "CMD_KERNEL_CC: $CMD_KERNEL_CC"
103 CMD_KERNEL_LD=`parse_opt "$*"`
104 print_info 2 "CMD_KERNEL_LD: $CMD_KERNEL_LD"
107 CMD_KERNEL_AS=`parse_opt "$*"`
108 print_info 2 "CMD_KERNEL_AS: $CMD_KERNEL_AS"
111 CMD_KERNEL_MAKE=`parse_opt "$*"`
112 print_info 2 "CMD_KERNEL_MAKE: $CMD_KERNEL_MAKE"
115 CMD_UTILS_CC=`parse_opt "$*"`
116 print_info 2 "CMD_UTILS_CC: $CMD_UTILS_CC"
119 CMD_UTILS_LD=`parse_opt "$*"`
120 print_info 2 "CMD_UTILS_LD: $CMD_UTILS_LD"
123 CMD_UTILS_AS=`parse_opt "$*"`
124 print_info 2 "CMD_UTILS_AS: $CMD_UTILS_AS"
127 CMD_UTILS_MAKE=`parse_opt "$*"`
128 print_info 2 "CMD_UTILS_MAKE: $CMD_UTILS_MAKE"
131 CMD_MAKEOPTS=`parse_opt "$*"`
132 print_info 2 "CMD_MAKEOPTS: $CMD_MAKEOPTS"
136 print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
140 print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
144 print_info 2 "CMD_DOKEYMAPAUTO: $CMD_DOKEYMAPAUTO"
148 print_info 2 'CMD_NOLVM2: 1'
151 CMD_BOOTLOADER=`parse_opt "$*"`
152 print_info 2 "CMD_BOOTLOADER: $CMD_BOOTLOADER"
155 CMD_DEBUGLEVEL=`parse_opt "$*"`
156 DEBUGLEVEL="${CMD_DEBUGLEVEL}"
157 print_info 2 "CMD_DEBUGLEVEL: $CMD_DEBUGLEVEL"
160 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
161 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
163 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
165 echo "Error: You need a terminal with at least 80 columns"
166 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
170 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
174 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
178 print_info 2 "CMD_GCONFIG: $CMD_GCONFIG"
182 print_info 2 "CMD_XCONFIG: $CMD_XCONFIG"
186 print_info 2 "CMD_SAVE_CONFIG: $CMD_SAVE_CONFIG"
190 print_info 2 "CMD_SAVE_CONFIG: $CMD_SAVE_CONFIG"
194 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
198 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
202 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
206 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
211 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
212 print_info 2 "CMD_OLDCONFIG: $CMD_OLDCONFIG"
216 BOOTSPLASH_THEME=`parse_opt "$*"`
217 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
218 print_info 2 "BOOTSPLASH_THEME: $BOOTSPLASH_THEME"
222 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
226 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
230 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
234 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
237 CMD_NOINITRDMODULES=1
238 print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
242 print_info 2 "CMD_UDEV: $CMD_UDEV"
245 CMD_CALLBACK=`parse_opt "$*"`
246 print_info 2 "CMD_CALLBACK: $CMD_CALLBACK/$*"
249 TEMP=`parse_opt "$*"`
250 print_info 2 "TEMP: $TEMP"
253 CMD_ARCHOVERRIDE=`parse_opt "$*"`
254 print_info 2 "CMD_ARCHOVERRIDE: $CMD_ARCHOVERRIDE"
258 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
262 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
265 CMD_DEBUGFILE=`parse_opt "$*"`
266 DEBUGFILE=`parse_opt "$*"`
267 print_info 2 "CMD_DEBUGFILE: $CMD_DEBUGFILE"
268 print_info 2 "DEBUGFILE: $CMD_DEBUGFILE"
271 CMD_KERNELDIR=`parse_opt "$*"`
272 print_info 2 "CMD_KERNELDIR: $CMD_KERNELDIR"
275 CMD_KERNEL_CONFIG=`parse_opt "$*"`
276 print_info 2 "CMD_KERNEL_CONFIG: $CMD_KERNEL_CONFIG"
279 CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
280 print_info 2 "CMD_INSTALL_MOD_PATH: $CMD_INSTALL_MOD_PATH"
283 CACHE_DIR=`parse_opt "$*"`
284 print_info 2 "CACHE_DIR: $CACHE_DIR"
287 CMD_MINKERNPACKAGE=`parse_opt "$*"`
288 print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE"
309 echo "Error: Unknown option '$*'!"