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 " --callback=<...> Run the specified arguments after"
38 echo " the kernel and modules have been"
40 echo " Kernel settings"
41 echo " --kerneldir=<dir> Location of the kernel sources"
42 echo " --kernel-config=<file> Kernel configuration file to use for compilation"
43 echo " --module-prefix=<dir> Prefix to kernel module destination, modules will"
44 echo " be installed in <prefix>/lib/modules"
45 echo " Low-Level Compile settings"
46 echo " --kernel-cc=<compiler> Compiler to use for kernel (e.g. distcc)"
47 echo " --kernel-as=<assembler> Assembler to use for kernel"
48 echo " --kernel-ld=<linker> Linker to use for kernel"
49 echo " --kernel-make=<makeprg> GNU Make to use for kernel"
50 echo " --utils-cc=<compiler> Compiler to use for utilities"
51 echo " --utils-as=<assembler> Assembler to use for utils"
52 echo " --utils-ld=<linker> Linker to use for utils"
53 echo " --utils-make=<makeprog> GNU Make to use for utils"
54 echo " --makeopts=<makeopts> Make options such as -j2, etc."
55 echo " --mountboot Mount /boot automatically"
56 echo " --no-mountboot Don't mount /boot automatically"
57 echo " Initialization"
58 echo " --bootsplash=<theme> Force bootsplash using <theme>."
59 echo " --do-keymap-auto Forces keymap selection at boot."
60 echo " --no-lvm2 Don't add in LVM2 support."
61 echo " --bootloader=grub Add new kernel to grub configuration"
63 echo " --tempdir=<dir> Location of Genkernel's temporary directory"
64 echo " --arch-override=<arch> Force to arch instead of autodetect"
65 echo " --busybox-config=<file> Busybox configuration file to use"
66 echo " --busybox-bin=<file> Don't compile busybox, use this _static_"
67 echo " bzip2'd binary"
68 echo " Output Settings"
69 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
70 echo " No modules outside of the initrd will be"
75 echo "Gentoo Linux Genkernel ${GK_V}"
77 echo " genkernel [options] all"
79 echo 'Some useful options:'
80 echo ' --menuconfig Run menuconfig after oldconfig'
81 echo ' --no-clean Do not run make clean before compilation'
82 echo ' --no-mrproper Do not run make mrproper before compilation,'
83 echo ' this is implied by --no-clean.'
85 echo 'For a detailed list of supported options and flags; issue:'
86 echo ' genkernel --help'
92 echo "$1" | cut -f2- -d=
100 CMD_KERNEL_CC=`parse_opt "$*"`
101 print_info 2 "CMD_KERNEL_CC: $CMD_KERNEL_CC"
104 CMD_KERNEL_LD=`parse_opt "$*"`
105 print_info 2 "CMD_KERNEL_LD: $CMD_KERNEL_LD"
108 CMD_KERNEL_AS=`parse_opt "$*"`
109 print_info 2 "CMD_KERNEL_AS: $CMD_KERNEL_AS"
112 CMD_KERNEL_MAKE=`parse_opt "$*"`
113 print_info 2 "CMD_KERNEL_MAKE: $CMD_KERNEL_MAKE"
116 CMD_UTILS_CC=`parse_opt "$*"`
117 print_info 2 "CMD_UTILS_CC: $CMD_UTILS_CC"
120 CMD_UTILS_LD=`parse_opt "$*"`
121 print_info 2 "CMD_UTILS_LD: $CMD_UTILS_LD"
124 CMD_UTILS_AS=`parse_opt "$*"`
125 print_info 2 "CMD_UTILS_AS: $CMD_UTILS_AS"
128 CMD_UTILS_MAKE=`parse_opt "$*"`
129 print_info 2 "CMD_UTILS_MAKE: $CMD_UTILS_MAKE"
132 CMD_MAKEOPTS=`parse_opt "$*"`
133 print_info 2 "CMD_MAKEOPTS: $CMD_MAKEOPTS"
137 print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
141 print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
145 print_info 2 "CMD_DOKEYMAPAUTO: $CMD_DOKEYMAPAUTO"
149 print_info 2 'CMD_NOLVM2: 1'
152 CMD_BOOTLOADER=`parse_opt "$*"`
153 print_info 2 "CMD_BOOTLOADER: $CMD_BOOTLOADER"
156 CMD_DEBUGLEVEL=`parse_opt "$*"`
157 DEBUGLEVEL="${CMD_DEBUGLEVEL}"
158 print_info 2 "CMD_DEBUGLEVEL: $CMD_DEBUGLEVEL"
161 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
162 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
164 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
166 echo "Error: You need a terminal with at least 80 columns"
167 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
171 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
175 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
179 print_info 2 "CMD_GCONFIG: $CMD_GCONFIG"
183 print_info 2 "CMD_XCONFIG: $CMD_XCONFIG"
187 print_info 2 "CMD_SAVE_CONFIG: $CMD_SAVE_CONFIG"
191 print_info 2 "CMD_SAVE_CONFIG: $CMD_SAVE_CONFIG"
195 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
199 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
203 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
207 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
212 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
213 print_info 2 "CMD_OLDCONFIG: $CMD_OLDCONFIG"
217 BOOTSPLASH_THEME=`parse_opt "$*"`
218 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
219 print_info 2 "BOOTSPLASH_THEME: $BOOTSPLASH_THEME"
223 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
227 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
231 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
235 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
238 CMD_NOINITRDMODULES=1
239 print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
242 CMD_CALLBACK=`parse_opt "$*"`
243 print_info 2 "CMD_CALLBACK: $CMD_CALLBACK/$*"
246 TEMP=`parse_opt "$*"`
247 print_info 2 "TEMP: $TEMP"
250 CMD_ARCHOVERRIDE=`parse_opt "$*"`
251 print_info 2 "CMD_ARCHOVERRIDE: $CMD_ARCHOVERRIDE"
255 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
259 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
262 CMD_DEBUGFILE=`parse_opt "$*"`
263 DEBUGFILE=`parse_opt "$*"`
264 print_info 2 "CMD_DEBUGFILE: $CMD_DEBUGFILE"
265 print_info 2 "DEBUGFILE: $CMD_DEBUGFILE"
268 CMD_KERNELDIR=`parse_opt "$*"`
269 print_info 2 "CMD_KERNELDIR: $CMD_KERNELDIR"
272 CMD_KERNEL_CONFIG=`parse_opt "$*"`
273 print_info 2 "CMD_KERNEL_CONFIG: $CMD_KERNEL_CONFIG"
276 CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
277 print_info 2 "CMD_INSTALL_MOD_PATH: $CMD_INSTALL_MOD_PATH"
280 CMD_BUSYBOX_CONFIG=`parse_opt "$*"`
281 print_info 2 "CMD_BUSYBOX_CONFIG: $CMD_BUSYBOX_CONFIG"
284 CMD_BUSYBOX_BIN=`parse_opt "$*"`
285 print_info 2 "CMD_BUSYBOX_BIN: $CMD_BUSYBOX_BIN"
288 CMD_MINKERNPACKAGE=`parse_opt "$*"`
289 print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE"
310 echo "Error: Unknown option '$*'!"