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