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