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