Make e2fsprogs optional (and off by default)
[genkernel.git] / gen_cmdline.sh
1 #!/bin/bash
2 # $Id$
3
4 longusage() {
5   echo "Gentoo Linux Genkernel ${GK_V}"
6   echo
7   echo "Usage: "
8   echo "  genkernel [options] action"
9   echo
10   echo "Available Actions: "
11   echo "  all                           Build all steps"
12   echo "  bzImage                       Build only the kernel"
13   echo "  initramfs                     Build only the ramdisk/initramfs"
14   echo "  kernel                        Build only the kernel and modules"
15   echo "  ramdisk                       Build only the ramdisk/initramfs"
16   echo
17   echo "Available Options: "
18   echo "  Configuration settings"
19   echo "        --config=<file> genkernel configuration file to use"
20   echo "  Debug settings"
21   echo "        --loglevel=<0-5>        Debug Verbosity Level"
22   echo "        --logfile=<outfile>     Output file for debug info"
23   echo "        --color                 Output debug in color"
24   echo "        --no-color              Do not output debug in color"
25   echo "  Kernel Configuration settings"
26   echo "        --menuconfig            Run menuconfig after oldconfig"
27   echo "        --no-menuconfig         Do not run menuconfig after oldconfig"
28   echo "        --gconfig                       Run gconfig after oldconfig"
29   echo "        --no-gconfig            Don't run gconfig after oldconfig"
30   echo "        --xconfig                       Run xconfig after oldconfig"
31   echo "        --no-xconfig            Don't run xconfig after oldconfig"
32   echo "        --save-config           Save the configuration to /etc/kernels"
33   echo "        --no-save-config        Don't save the configuration to /etc/kernels"
34   echo "  Kernel Compile settings"
35   echo "        --oldconfig             Implies --no-clean and runs a 'make oldconfig'"
36   echo "        --clean                 Run make clean before compilation"
37   echo "        --no-clean              Do not run make clean before compilation"
38   echo "        --mrproper              Run make mrproper before compilation"
39   echo "        --no-mrproper   Do not run make mrproper before compilation"
40   echo "        --splash                Install framebuffer splash support into initramfs"
41   echo "        --no-splash             Do not install framebuffer splash"
42   echo "        --install               Install the kernel after building"
43   echo "        --no-install            Do not install the kernel after building"
44   echo "        --symlink               Manage symlinks in /boot for installed images"
45   echo "        --no-symlink            Do not manage symlinks"
46   echo "        --ramdisk-modules       Copy required modules to the ramdisk"
47   echo "        --no-ramdisk-modules    Don't copy any modules to the ramdisk"
48   echo "        --all-ramdisk-modules   Copy all kernel modules to the ramdisk"
49   echo "        --callback=<...>        Run the specified arguments after the"
50   echo "                                kernel and modules have been compiled"
51   echo "        --static                Build a static (monolithic kernel)."
52   echo "        --no-static             Do not build a static (monolithic kernel)."
53   echo "  Kernel settings"
54   echo "        --kerneldir=<dir>       Location of the kernel sources"
55   echo "        --kernel-config=<file>  Kernel configuration file to use for compilation"
56   echo "        --module-prefix=<dir>   Prefix to kernel module destination, modules"
57   echo "                                will be installed in <prefix>/lib/modules"
58   echo "  Low-Level Compile settings"
59   echo "        --kernel-cc=<compiler>  Compiler to use for kernel (e.g. distcc)"
60   echo "        --kernel-as=<assembler> Assembler to use for kernel"
61   echo "        --kernel-ld=<linker>    Linker to use for kernel"
62   echo "        --kernel-cross-compile=<cross var> CROSS_COMPILE kernel variable"
63   echo "        --kernel-make=<makeprg> GNU Make to use for kernel"
64   echo "        --kernel-target=<t>     Override default make target (bzImage)"
65   echo "        --kernel-binary=<path>  Override default kernel binary path (arch/foo/boot/bar)"
66
67   echo "        --utils-cc=<compiler>   Compiler to use for utilities"
68   echo "        --utils-as=<assembler>  Assembler to use for utils"
69   echo "        --utils-ld=<linker>     Linker to use for utils"
70   echo "        --utils-make=<makeprog> GNU Make to use for utils"
71   echo "        --utils-cross-compile=<cross var> CROSS_COMPILE utils variable"
72   echo "        --utils-arch=<arch>     Force to arch for utils only instead of"
73   echo "                                autodetect."
74   echo "        --makeopts=<makeopts>   Make options such as -j2, etc..."
75   echo "        --mountboot             Mount BOOTDIR automatically if mountable"
76   echo "        --no-mountboot          Don't mount BOOTDIR automatically"  
77   echo "        --bootdir=<dir>         Set the location of the boot-directory, default is /boot"
78   echo "        --modprobedir=<dir>     Set the location of the modprobe.d-directory, default is /etc/modprobe.d"
79   echo "  Initialization"
80   echo "        --splash=<theme>        Enable framebuffer splash using <theme>"
81   echo "        --splash-res=<res>      Select splash theme resolutions to install"
82   echo "        --splash=<theme>        Enable framebuffer splash using <theme>"
83   echo "        --splash-res=<res>      Select splash theme resolutions to install"
84   echo "        --do-keymap-auto        Forces keymap selection at boot"
85   echo "        --keymap                Enables keymap selection support"
86   echo "        --no-keymap             Disables keymap selection support"
87   echo "        --lvm                   Include LVM support"
88   echo "        --no-lvm                Exclude LVM support"
89   echo "        --mdadm                 Include MDADM/MDMON support"
90   echo "        --no-mdadm              Exclude MDADM/MDMON support"
91   echo "        --mdadm-config=<file>   Use file as mdadm.conf in initramfs"
92   echo "        --dmraid                Include DMRAID support"
93   echo "        --no-dmraid             Exclude DMRAID support"
94   echo "        --e2fsprogs             Include e2fsprogs"
95   echo "        --no-e2fsprogs          Exclude e2fsprogs"
96   echo "        --zfs                   Include ZFS support"
97   echo "        --no-zfs                Exclude ZFS support"
98   echo "        --multipath             Include Multipath support"
99   echo "        --no-multipath  Exclude Multipath support"
100   echo "        --iscsi                 Include iSCSI support"
101   echo "        --no-iscsi              Exclude iSCSI support"
102   echo "        --bootloader=grub       Add new kernel to GRUB configuration"
103   echo "        --linuxrc=<file>        Specifies a user created linuxrc"
104   echo "        --busybox-config=<file> Specifies a user created busybox config"
105   echo "        --genzimage             Make and install kernelz image (PowerPC)"
106   echo "        --disklabel             Include disk label and uuid support in your ramdisk"
107   echo "        --no-disklabel  Exclude disk label and uuid support in your ramdisk"
108   echo "        --luks                  Include LUKS support"
109   echo "                                --> 'emerge cryptsetup-luks' with USE=-dynamic"
110   echo "        --no-luks               Exclude LUKS support"
111   echo "        --gpg                   Include GPG-armored LUKS key support"
112   echo "        --no-gpg                Exclude GPG-armored LUKS key support"
113   echo "        --busybox               Include busybox"
114   echo "        --no-busybox    Exclude busybox"
115   echo "        --unionfs               Include support for unionfs"
116   echo "        --no-unionfs    Exclude support for unionfs"
117   echo "        --netboot               Create a self-contained env in the initramfs"
118   echo "        --no-netboot    Exclude --netboot env"
119   echo "        --real-root=<foo>       Specify a default for real_root="
120   echo "  Internals"
121   echo "        --arch-override=<arch>  Force to arch instead of autodetect"
122   echo "        --cachedir=<dir>        Override the default cache location"
123   echo "        --tempdir=<dir>         Location of Genkernel's temporary directory"
124   echo "        --postclear                     Clear all tmp files and caches after genkernel has run"
125   echo "        --no-postclear          Do not clean up after genkernel has run"
126   echo "  Output Settings"
127   echo "        --kernname=<...>        Tag the kernel and ramdisk with a name:"
128   echo "                                If not defined the option defaults to"
129   echo "                                'genkernel'"
130   echo "        --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and ramdisk:"
131   echo "                                No modules outside of the ramdisk will be"
132   echo "                                included..."
133   echo "        --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the"
134   echo "                                callbacks have run"
135   echo "        --kerncache=<tbz2>      File to output a .tar.bz2'd kernel contents"
136   echo "                                of /lib/modules/ and the kernel config"
137   echo "                                NOTE: This is created before the callbacks"
138   echo "                                are run!"
139   echo "        --no-kernel-sources     This option is only valid if kerncache is"
140   echo "                                defined. If there is a valid kerncache no checks"
141   echo "                                will be made against a kernel source tree"
142   echo "        --initramfs-overlay=<dir>"
143   echo "                                Directory structure to include in the initramfs,"
144   echo "                                only available on 2.6 kernels"
145   echo "        --firmware"
146   echo "                                Enable copying of firmware into initramfs"
147   echo "        --firmware-dir=<dir>"
148   echo "                                Specify directory to copy firmware from (defaults"
149   echo "                                to /lib/firmware)"
150   echo "        --firmware-files=<files>"
151   echo "                                Specifies specific firmware files to copy. This"
152   echo "                                overrides --firmware-dir. For multiple files,"
153   echo "                                separate the filenames with a comma"
154   echo "        --integrated-initramfs, --no-integrated-initramfs"
155   echo "                                Include/exclude the generated initramfs in the kernel"
156   echo "                                instead of keeping it as a separate file"
157   echo "        --compress-initramfs, --no-compress-initramfs,"
158   echo "        --compress-initrd, --no-compress-initrd"
159   echo "                                Compress or do not compress the generated initramfs"
160   echo "        --compress-initramfs-type=<arg>"
161   echo "                                Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop)"
162 }
163
164 usage() {
165   echo "Gentoo Linux Genkernel ${GK_V}"
166   echo
167   echo "Usage: "
168   echo "        genkernel [options] all"
169   echo
170   echo 'Some useful options:'
171   echo '        --menuconfig            Run menuconfig after oldconfig'
172   echo '        --no-clean              Do not run make clean before compilation'
173   echo '        --no-mrproper           Do not run make mrproper before compilation,'
174   echo '                                this is implied by --no-clean.'
175   echo
176   echo 'For a detailed list of supported options and flags; issue:'
177   echo '        genkernel --help'
178 }
179
180 parse_optbool() {
181         local opt=${1/--no-*/0} # false
182         opt=${opt/--*/1} # true
183         echo $opt
184 }
185
186 parse_cmdline() {
187         case "$*" in
188                 --kernel-cc=*)
189                         CMD_KERNEL_CC=`parse_opt "$*"`
190                         print_info 2 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}"
191                         ;;
192                 --kernel-ld=*)
193                         CMD_KERNEL_LD=`parse_opt "$*"`
194                         print_info 2 "CMD_KERNEL_LD: ${CMD_KERNEL_LD}"
195                         ;;
196                 --kernel-as=*)
197                         CMD_KERNEL_AS=`parse_opt "$*"`
198                         print_info 2 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}"
199                         ;;
200                 --kernel-make=*)
201                         CMD_KERNEL_MAKE=`parse_opt "$*"`
202                         print_info 2 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}"
203                         ;;
204                 --kernel-target=*)
205                         KERNEL_MAKE_DIRECTIVE_OVERRIDE=`parse_opt "$*"`
206                         print_info 2 "KERNEL_MAKE_DIRECTIVE_OVERRIDE: ${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
207                         ;;
208                 --kernel-binary=*)
209                         KERNEL_BINARY_OVERRIDE=`parse_opt "$*"`
210                         print_info 2 "KERNEL_BINARY_OVERRIDE: ${KERNEL_BINARY_OVERRIDE}"
211                         ;;
212                 --kernel-cross-compile=*)
213                         CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"`
214                         CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
215                         print_info 2 "CMD_KERNEL_CROSS_COMPILE: ${CMD_KERNEL_CROSS_COMPILE}"
216                         ;;
217                 --utils-cc=*)
218                         CMD_UTILS_CC=`parse_opt "$*"`
219                         print_info 2 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
220                         ;;
221                 --utils-ld=*)
222                         CMD_UTILS_LD=`parse_opt "$*"`
223                         print_info 2 "CMD_UTILS_LD: ${CMD_UTILS_LD}"
224                         ;;
225                 --utils-as=*)
226                         CMD_UTILS_AS=`parse_opt "$*"`
227                         print_info 2 "CMD_UTILS_AS: ${CMD_UTILS_AS}"
228                         ;;
229                 --utils-make=*)
230                         CMD_UTILS_MAKE=`parse_opt "$*"`
231                         print_info 2 "CMD_UTILS_MAKE: ${CMD_UTILS_MAKE}"
232                         ;;
233                 --utils-cross-compile=*)
234                         CMD_UTILS_CROSS_COMPILE=`parse_opt "$*"`
235                         CMD_UTILS_CROSS_COMPILE=$(echo ${CMD_UTILS_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
236                         print_info 2 "CMD_UTILS_CROSS_COMPILE: ${CMD_UTILS_CROSS_COMPILE}"
237                         ;;
238                 --utils-arch=*)
239                         CMD_UTILS_ARCH=`parse_opt "$*"`
240                         print_info 2 "CMD_UTILS_ARCH: ${CMD_ARCHOVERRIDE}"
241                         ;;
242                 --makeopts=*)
243                         CMD_MAKEOPTS=`parse_opt "$*"`
244                         print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"
245                         ;;
246                 --mountboot|--no-mountboot)
247                         CMD_MOUNTBOOT=`parse_optbool "$*"`
248                         print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
249                         ;;
250                 --bootdir=*)
251                         CMD_BOOTDIR=`parse_opt "$*"`
252                         print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
253                         ;;
254                 --modprobedir=*)
255                         CMD_MODPROBEDIR=`parse_opt "$*"`
256                         print_info 2 "CMD_MODPROBEDIR: ${CMD_MODPROBEDIR}"
257                         ;;
258                 --do-keymap-auto)
259                         CMD_DOKEYMAPAUTO=1
260                         CMD_KEYMAP=1
261                         print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}"
262                         ;;
263                 --keymap|--no-keymap)
264                         CMD_KEYMAP=`parse_optbool "$*"`
265                         print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}"
266                         ;;
267                 --lvm|--no-lvm)
268                         CMD_LVM=`parse_optbool "$*"`
269                         print_info 2 "CMD_LVM: ${CMD_LVM}"
270                         ;;
271                 --lvm2|--no-lvm2)
272                         CMD_LVM=`parse_optbool "$*"`
273                         print_info 2 "CMD_LVM: ${CMD_LVM}"
274                         echo
275                         print_warning 1 "Please use --lvm, as --lvm2 is deprecated."
276                         ;;
277                 --mdadm|--no-mdadm)
278                         CMD_MDADM=`parse_optbool "$*"`
279                         print_info 2 "CMD_MDADM: $CMD_MDADM"
280                         ;;
281                 --mdadm-config=*)
282                         CMD_MDADM_CONFIG=`parse_opt "$*"`
283                         print_info 2 "CMD_MDADM_CONFIG: $CMD_MDADM_CONFIG"
284                         ;;
285                 --busybox|--no-busybox)
286                         CMD_BUSYBOX=`parse_optbool "$*"`
287                         print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
288                         ;;
289                 --unionfs|--no-unionfs)
290                         CMD_UNIONFS=`parse_optbool "$*"`
291                         print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
292                         ;;
293                 --netboot|--no-netboot)
294                         CMD_NETBOOT=`parse_optbool "$*"`
295                         print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}"
296                         ;;
297                 --real-root=*)
298                         CMD_REAL_ROOT=`parse_opt "$*"`
299                         print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}"
300                         ;;
301                 --dmraid|--no-dmraid)
302                         CMD_DMRAID=`parse_optbool "$*"`
303                         if [ "$CMD_DMRAID" = "1" -a ! -e /usr/include/libdevmapper.h ]
304                         then
305                                 echo 'Error: --dmraid requires LVM2 to be installed'
306                                 echo '           on the host system; try "emerge lvm2".'
307                                 exit 1
308                         fi
309                         print_info 2 "CMD_DMRAID: ${CMD_DMRAID}"
310                         ;;
311                 --e2fsprogs|--no-e2fsprogs)
312                         CMD_E2FSPROGS=`parse_optbool "$*"`
313                         print_info 2 "CMD_E2FSPROGS: ${CMD_E2FSPROGS}"
314                         ;;
315                 --zfs|--no-zfs)
316                         CMD_ZFS=`parse_optbool "$*"`
317                         print_info 2 "CMD_ZFS: ${CMD_ZFS}"
318                         ;;
319                 --multipath|--no-multipath)
320                         CMD_MULTIPATH=`parse_optbool "$*"`
321                         if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ]
322                         then
323                                 echo 'Error: --multipath requires LVM2 to be installed'
324                                 echo '           on the host;system; try "emerge lvm2".'
325                                 exit 1
326                         fi
327                         print_info 2 "CMD_MULTIPATH: ${CMD_MULTIPATH}"
328                         ;;
329                 --bootloader=*)
330                         CMD_BOOTLOADER=`parse_opt "$*"`
331                         print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
332                         ;;
333                 --iscsi|--no-iscsi)
334                         CMD_ISCSI=`parse_optbool "$*"`
335                         print_info 2 "CMD_ISCSI: ${CMD_ISCSI}"
336                         ;;
337                 --loglevel=*)
338                         CMD_LOGLEVEL=`parse_opt "$*"`
339                         LOGLEVEL="${CMD_LOGLEVEL}"
340                         print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}"
341                         ;;
342                 --menuconfig)
343                         TERM_LINES=`stty -a | head -n 1 | cut -d\  -f5 | cut -d\; -f1`
344                         TERM_COLUMNS=`stty -a | head -n 1 | cut -d\  -f7 | cut -d\; -f1`
345                         if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
346                         then
347                                 echo "Error: You need a terminal with at least 80 columns"
348                                 echo "           and 19 lines for --menuconfig; try --no-menuconfig..."
349                                 exit 1
350                         fi
351                         CMD_MENUCONFIG=1
352                         print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
353                         ;;
354                 --no-menuconfig)
355                         CMD_MENUCONFIG=0
356                         print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
357                         ;;
358                 --gconfig|--no-gconfig)
359                         CMD_GCONFIG=`parse_optbool "$*"`
360                         print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}"
361                         ;;
362                 --xconfig|--no-xconfig)
363                         CMD_XCONFIG=`parse_optbool "$*"`
364                         print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}"
365                         ;;
366                 --save-config|--no-save-config)
367                         CMD_SAVE_CONFIG=`parse_optbool "$*"`
368                         print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
369                         ;;
370                 --mrproper|--no-mrproper)
371                         CMD_MRPROPER=`parse_optbool "$*"`
372                         print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
373                         ;;
374                 --clean|--no-clean)
375                         CMD_CLEAN=`parse_optbool "$*"`
376                         print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
377                         ;;
378                 --oldconfig|--no-oldconfig)
379                         CMD_OLDCONFIG=`parse_optbool "$*"`
380                         [ "$CMD_OLDCONFIG" = "1" ] && CMD_CLEAN=0
381                         print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
382                         print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}"
383                         ;;
384                 --gensplash=*)
385                         CMD_SPLASH=1
386                         SPLASH_THEME=`parse_opt "$*"`
387                         print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
388                         print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
389                         echo
390                         print_warning 1 "Please use --splash, as --gensplash is deprecated."
391                         ;;
392                 --gensplash|--no-gensplash)
393                         CMD_SPLASH=`parse_optbool "$*"`
394                         SPLASH_THEME='default'
395                         print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
396                         echo
397                         print_warning 1 "Please use --splash, as --gensplash is deprecated."
398                         ;;
399                 --splash=*)
400                         CMD_SPLASH=1
401                         SPLASH_THEME=`parse_opt "$*"`
402                         print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
403                         print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
404                         ;;
405                 --splash|--no-splash)
406                         CMD_SPLASH=`parse_optbool "$*"`
407                         SPLASH_THEME='default'
408                         print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
409                         ;;
410                 --gensplash-res=*)
411                         SPLASH_RES=`parse_opt "$*"`
412                         print_info 2 "SPLASH_RES: ${SPLASH_RES}"
413                         echo
414                         print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated."
415                         ;;
416                 --splash-res=*)
417                         SPLASH_RES=`parse_opt "$*"`
418                         print_info 2 "SPLASH_RES: ${SPLASH_RES}"
419                         ;;
420                 --install|--no-install)
421                         CMD_INSTALL=`parse_optbool "$*"`
422                         print_info 2 "CMD_INSTALL: ${CMD_INSTALL}"
423                         ;;
424                 --ramdisk-modules|--no-ramdisk-modules)
425                         CMD_RAMDISKMODULES=`parse_optbool "$*"`
426                         print_info 2 "CMD_RAMDISKMODULES: ${CMD_RAMDISKMODULES}"
427                         ;;
428                 --all-ramdisk-modules|--no-all-ramdisk-modules)
429                         CMD_ALLRAMDISKMODULES=`parse_optbool "$*"`
430                         print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}"
431                         ;;
432                 --callback=*)
433                         CMD_CALLBACK=`parse_opt "$*"`
434                         print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
435                         ;;
436                 --static|--no-static)
437                         CMD_STATIC=`parse_optbool "$*"`
438                         print_info 2 "CMD_STATIC: ${CMD_STATIC}"
439                         ;;
440                 --tempdir=*)
441                         TMPDIR=`parse_opt "$*"`
442                         TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
443                         print_info 2 "TMPDIR: ${TMPDIR}"
444                         print_info 2 "TEMP: ${TEMP}"
445                         ;;
446                 --postclear|--no-postclear)
447                         CMD_POSTCLEAR=`parse_optbool "$*"`
448                         print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}"
449                         ;;
450                 --arch-override=*)
451                         CMD_ARCHOVERRIDE=`parse_opt "$*"`
452                         print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}"
453                         ;;
454                 --color|--no-color)
455                         USECOLOR=`parse_optbool "$*"`
456                         print_info 2 "USECOLOR: ${USECOLOR}"
457                         setColorVars
458                         ;;
459                 --logfile=*)
460                         CMD_LOGFILE=`parse_opt "$*"`
461                         LOGFILE=`parse_opt "$*"`
462                         print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}"
463                         print_info 2 "LOGFILE: ${CMD_LOGFILE}"
464                         ;;
465                 --kerneldir=*)
466                         CMD_KERNEL_DIR=`parse_opt "$*"`
467                         print_info 2 "CMD_KERNEL_DIR: ${CMD_KERNEL_DIR}"
468                         ;;
469                 --kernel-config=*)
470                         CMD_KERNEL_CONFIG=`parse_opt "$*"`
471                         print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}"
472                         ;;
473                 --module-prefix=*)
474                         CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
475                         print_info 2 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}"
476                         ;;
477                 --cachedir=*)
478                         CACHE_DIR=`parse_opt "$*"`
479                         print_info 2 "CACHE_DIR: ${CACHE_DIR}"
480                         ;;
481                 --minkernpackage=*)
482                         CMD_MINKERNPACKAGE=`parse_opt "$*"`
483                         print_info 2 "MINKERNPACKAGE: ${CMD_MINKERNPACKAGE}"
484                         ;;
485                 --modulespackage=*)
486                         CMD_MODULESPACKAGE=`parse_opt "$*"`
487                         print_info 2 "MODULESPACKAGE: ${CMD_MODULESPACKAGE}"
488                         ;;
489                 --kerncache=*)
490                         CMD_KERNCACHE=`parse_opt "$*"`
491                         print_info 2 "KERNCACHE: ${CMD_KERNCACHE}"
492                         ;;
493                 --kernname=*)
494                         CMD_KERNNAME=`parse_opt "$*"`
495                         print_info 2 "KERNNAME: ${CMD_KERNNAME}"
496                         ;;
497                 --symlink|--no-symlink)
498                         CMD_SYMLINK=`parse_optbool "$*"`
499                         print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
500                         ;;
501                 --kernel-sources|--no-kernel-sources)
502                         CMD_KERNEL_SOURCES=`parse_optbool "$*"`
503                         print_info 2 "CMD_KERNEL_SOURCES: ${CMD_KERNEL_SOURCES}"
504                         ;;
505                 --initramfs-overlay=*)
506                         CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
507                         print_info 2 "CMD_INITRAMFS_OVERLAY: ${CMD_INITRAMFS_OVERLAY}"
508                         ;;
509                 --linuxrc=*)
510                         CMD_LINUXRC=`parse_opt "$*"`
511                         print_info 2 "CMD_LINUXRC: ${CMD_LINUXRC}"
512                         ;;
513                 --busybox-config=*)
514                         CMD_BUSYBOX_CONFIG=`parse_opt "$*"`
515                         print_info 2 "CMD_BUSYBOX_CONFIG: ${CMD_BUSYBOX_CONFIG}"
516                         ;;
517                 --genzimage)
518                         KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
519                         KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd'
520                         CMD_GENZIMAGE="yes"
521 #                       ENABLE_PEGASOS_HACKS="yes"
522 #                       print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
523                         ;;
524                 --disklabel|--no-disklabel)
525                         CMD_DISKLABEL=`parse_optbool "$*"`
526                         print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}"
527                         ;;
528                 --luks|--no-luks)
529                         CMD_LUKS=`parse_optbool "$*"`
530                         print_info 2 "CMD_LUKS: ${CMD_LUKS}"
531                         ;;
532                 --gpg|--no-gpg)
533                         CMD_GPG=`parse_optbool "$*"`
534                         print_info 2 "CMD_GPG: ${CMD_GPG}"
535                         ;;
536                 --firmware|--no-firmware)
537                         CMD_FIRMWARE=`parse_optbool "$*"`
538                         print_info 2 "CMD_FIRMWARE: ${CMD_FIRMWARE}"
539                         ;;
540                 --firmware-dir=*)
541                         CMD_FIRMWARE_DIR=`parse_opt "$*"`
542                         CMD_FIRMWARE=1
543                         print_info 2 "CMD_FIRMWARE_DIR: ${CMD_FIRMWARE_DIR}"
544                         ;;
545                 --firmware-files=*)
546                         CMD_FIRMWARE_FILES=`parse_opt "$*"`
547                         CMD_FIRMWARE=1
548                         print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}"
549                         ;;
550                 --integrated-initramfs|--no-integrated-initramfs)
551                         CMD_INTEGRATED_INITRAMFS=`parse_optbool "$*"`
552                         print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}"
553                         ;;
554                 --compress-initramfs|--no-compress-initramfs|--compress-initrd|--no-compress-initrd)
555                         CMD_COMPRESS_INITRD=`parse_optbool "$*"`
556                         print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}"
557                         ;;
558                 --compress-initramfs-type=*|--compress-initrd-type=*)
559                         COMPRESS_INITRD_TYPE=`parse_opt "$*"`
560                         print_info 2 "CMD_COMPRESS_INITRD_TYPE: ${CMD_LINUXRC}"
561                         ;;
562                 --config=*)
563                         print_info 2 "CMD_GK_CONFIG: `parse_opt "$*"`"
564                         ;;
565                 all)
566                         BUILD_KERNEL=1
567                         BUILD_MODULES=1
568                         BUILD_RAMDISK=1
569                         ;;
570                 ramdisk|initramfs)
571                         BUILD_RAMDISK=1
572                         ;;
573                 kernel)
574                         BUILD_KERNEL=1
575                         BUILD_MODULES=1
576                         BUILD_RAMDISK=0
577                         ;;
578                 bzImage)
579                         BUILD_KERNEL=1
580                         BUILD_MODULES=0
581                         BUILD_RAMDISK=1
582                         CMD_RAMDISKMODULES=0
583                         print_info 2 "CMD_RAMDISKMODULES: ${CMD_RAMDISKMODULES}"
584                         ;;
585                 --help)
586                         longusage
587                         exit 1
588                         ;;
589                 --version)
590                         echo "${GK_V}"
591                         exit 0
592                         ;;
593                 *)
594                         echo "Error: Unknown option '$*'!"
595                         exit 1
596                         ;;
597         esac
598 }