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