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