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 kernel and modules (not done yet)"
11 echo " initrd Build only initrd (not done yet)"
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 " Kernel Compile settings"
25 echo " --mrproper Run make mrproper before compilation"
26 echo " --clean Run make clean before compilation"
27 echo " --no-clean Do not run make clean before compilation"
28 echo " --no-mrproper Do not run make mrproper before compilation"
29 echo " --bootsplash Install bootsplash to initrd"
30 echo " --no-bootsplash Do not use bootsplash"
31 echo " --install Install kernel after building"
32 echo " --no-install Do not install kernel after building"
33 echo " --no-initrdmodules Don't copy any modules to the initrd"
34 echo " --callback=<...> Run the specified arguments after"
35 echo " the kernel and modules have been"
37 echo " Kernel settings"
38 echo " --kerneldir=<dir> Location of the kernel sources"
39 echo " --kernel-config=<file> Kernel configuration file to use for compilation"
40 echo " Low-Level Compile settings"
41 echo " --kernel-cc=<compiler> Compiler to use for kernel (e.g. distcc)"
42 echo " --kernel-as=<assembler> Assembler to use for kernel"
43 echo " --kernel-ld=<linker> Linker to use for kernel"
44 echo " --kernel-make=<makeprg> GNU Make to use for kernel"
45 echo " --utils-cc=<compiler> Compiler to use for utilities"
46 echo " --utils-as=<assembler> Assembler to use for utils"
47 echo " --utils-ld=<linker> Linker to use for utils"
48 echo " --utils-make=<makeprog> GNU Make to use for utils"
49 echo " --makeopts=<makeopts> Make options such as -j2, etc."
50 echo " Initialization"
51 echo " --do-keymap-auto Forces keymap selection at boot."
53 echo " --arch-override=<arch> Force to arch instead of autodetect"
54 echo " --busybox-config=<file> Busybox configuration file to use"
55 echo " --busybox-bin=<file> Don't compile busybox, use this _static_"
56 echo " bzip2'd binary"
57 # echo " Misc Settings"
58 # echo " --max-kernel-size=<k> Maximum kernel size"
59 # echo " --max-initrd-size=<k> Maximum initrd size"
60 # echo " --max-kernel-and-initrd-size=<k> Maximum combined initrd + kernel size"
61 echo " Output Settings"
62 echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd to"
63 echo " These will be renamed to simply 'kernel' and"
64 echo " 'initrd' inside the package without any path"
65 echo " information. No modules outside of the initrd"
66 echo " will be included."
72 echo "$1" | cut -f2 -d=
80 CMD_KERNEL_CC=`parse_opt "$*"`
81 print_info 2 "CMD_KERNEL_CC: $CMD_KERNEL_CC"
84 CMD_KERNEL_LD=`parse_opt "$*"`
85 print_info 2 "CMD_KERNEL_LD: $CMD_KERNEL_LD"
88 CMD_KERNEL_AS=`parse_opt "$*"`
89 print_info 2 "CMD_KERNEL_AS: $CMD_KERNEL_AS"
92 CMD_KERNEL_MAKE=`parse_opt "$*"`
93 print_info 2 "CMD_KERNEL_MAKE: $CMD_KERNEL_MAKE"
96 CMD_UTILS_CC=`parse_opt "$*"`
97 print_info 2 "CMD_UTILS_CC: $CMD_UTILS_CC"
100 CMD_UTILS_LD=`parse_opt "$*"`
101 print_info 2 "CMD_UTILS_LD: $CMD_UTILS_LD"
104 CMD_UTILS_AS=`parse_opt "$*"`
105 print_info 2 "CMD_UTILS_AS: $CMD_UTILS_AS"
108 CMD_UTILS_MAKE=`parse_opt "$*"`
109 print_info 2 "CMD_UTILS_MAKE: $CMD_UTILS_MAKE"
112 CMD_MAKEOPTS=`parse_opt "$*"`
113 print_info 2 "CMD_MAKEOPTS: $CMD_MAKEOPTS"
117 print_info 2 "CMD_DOKEYMAPAUTO: $CMD_DOKEYMAPAUTO"
120 CMD_DEBUGLEVEL=`parse_opt "$*"`
121 DEBUGLEVEL="${CMD_DEBUGLEVEL}"
122 print_info 2 "CMD_DEBUGLEVEL: $CMD_DEBUGLEVEL"
125 TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
126 TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
128 if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
130 echo "Error: You need a terminal with at least 80 columns"
131 echo " and 19 lines for --menuconfig; try --nomenuconfig..."
135 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
139 print_info 2 "CMD_MENUCONFIG: $CMD_MENUCONFIG"
143 print_info 2 "CMD_GCONFIG: $CMD_GCONFIG"
147 print_info 2 "CMD_XCONFIG: $CMD_XCONFIG"
151 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
155 print_info 2 "CMD_MRPROPER: $CMD_MRPROPER"
159 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
163 print_info 2 "CMD_CLEAN: $CMD_CLEAN"
167 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
171 print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
175 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
179 print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
182 CMD_NOINITRDMODULES=1
183 print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
186 CMD_CALLBACK=`parse_opt "$*"`
187 print_info 2 "CMD_CALLBACK: $CMD_CALLBACK/$*"
190 CMD_ARCHOVERRIDE=`parse_opt "$*"`
191 print_info 2 "CMD_ARCHOVERRIDE: $CMD_ARCHOVERRIDE"
195 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
199 print_info 2 "CMD_USECOLOR: $CMD_USECOLOR"
202 CMD_DEBUGFILE=`parse_opt "$*"`
203 print_info 2 "CMD_DEBUGFILE: $CMD_DEBUGFILE"
206 CMD_KERNELDIR=`parse_opt "$*"`
207 print_info 2 "CMD_KERNELDIR: $CMD_KERNELDIR"
210 CMD_KERNEL_CONFIG=`parse_opt "$*"`
211 print_info 2 "CMD_KERNEL_CONFIG: $CMD_KERNEL_CONFIG"
214 CMD_BUSYBOX_CONFIG=`parse_opt "$*"`
215 print_info 2 "CMD_BUSYBOX_CONFIG: $CMD_BUSYBOX_CONFIG"
218 CMD_BUSYBOX_BIN=`parse_opt "$*"`
219 print_info 2 "CMD_BUSYBOX_BIN: $CMD_BUSYBOX_BIN"
222 CMD_MAX_KERNEL_SIZE=`parse_opt "$*"`
223 print_info 2 "MAX_KERNEL_SIZE: $CMD_MAX_KERNEL_SIZE"
226 CMD_MAX_INITRD_SIZE=`parse_opt "$*"`
227 print_info 2 "MAX_INITRD_SIZE: $CMD_MAX_INITRD_SIZE"
229 --max-kernel-and-initrd-size*)
230 CMD_MAX_KERNEL_AND_INITRD_SIZE=`parse_opt "$*"`
231 print_info 2 "MAX_KERNEL_AND_INITRD_SIZE: $CMD_MAX_KERNEL_AND_INITRD_SIZE"
234 CMD_MINKERNPACKAGE=`parse_opt "$*"`
235 print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE"