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