Added a second patch from John R. Graham <john_r_graham@mindspring.com> from bug...
[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 "  Debug settings"
16   echo "        --debuglevel=<0-5>      Debug Verbosity Level"
17   echo "        --debugfile=<outfile>   Output file for debug info"
18   echo "        --color                 Output debug in color"
19   echo "        --no-color              Do not output debug in color"
20   echo "  Kernel Configuration settings"
21   echo "        --menuconfig            Run menuconfig after oldconfig"
22   echo "        --no-menuconfig         Do not run menuconfig after oldconfig"
23   echo "        --gconfig               Run gconfig after oldconfig"
24   echo "        --xconfig               Run xconfig after oldconfig"
25   echo "        --save-config           Save the configuration to /etc/kernels"
26   echo "        --no-save-config        Don't save the configuration to /etc/kernels"
27   echo "  Kernel Compile settings"
28   echo "        --clean                 Run make clean before compilation"
29   echo "        --mrproper              Run make mrproper before compilation"
30   echo "        --no-clean              Do not run make clean before compilation"
31   echo "        --no-mrproper           Do not run make mrproper before compilation"
32   echo "        --oldconfig             Implies --no-clean and runs a 'make oldconfig'"
33   echo "        --bootsplash            Install bootsplash support to the initrd"
34   echo "        --no-bootsplash         Do not use bootsplash"
35   echo "        --gensplash             Install gensplash support into bzImage"
36   echo "        --no-gensplash          Do not use gensplash"
37   echo "        --install               Install the kernel after building"
38   echo "        --no-install            Do not install the kernel after building"
39   echo "        --symlink               Manage symlinks in /boot for installed images"
40   echo "        --no-symlink            Do not manage symlinks"
41   echo "        --no-initrdmodules      Don't copy any modules to the initrd"
42   echo "        --no-udev               Disable udev support"
43   echo "        --no-devfs              Disable devfs support"
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 "        --bootsplash=<theme>    Force bootsplash using <theme>"
73   echo "        --gensplash=<theme>     Force gensplash using <theme>"
74   echo "        --gensplash-res=<res>   Select gensplash resolutions"
75   echo "        --do-keymap-auto        Forces keymap selection at boot"
76   echo "        --evms2                 Include EVMS2 support"
77   echo "                                --> 'emerge evms' in the host operating system"
78   echo "                                first"
79   echo "        --lvm2                  Include LVM2 support"
80 #  echo "       --unionfs               Include UNIONFS support"
81   echo "        --dmraid                Include DMRAID support"
82   echo "        --suspend               Include userspace suspend/resume (uswsusp) support"
83   echo "        --slowusb               Enables extra pauses for slow USB CD boots"
84   echo "        --bootloader=grub       Add new kernel to GRUB configuration"
85   echo "        --linuxrc=<file>        Specifies a user created linuxrc"
86   echo "        --disklabel             Include disk label and uuid support in your"
87   echo "                                initrd"
88   echo "        --luks                  Include LUKS support"
89   echo "                                --> 'emerge cryptsetup-luks' with USE=-dynamic"
90   echo "  Internals"
91   echo "        --arch-override=<arch>  Force to arch instead of autodetect"
92   echo "        --cachedir=<dir>        Override the default cache location"
93   echo "        --tempdir=<dir>         Location of Genkernel's temporary directory"
94   echo "        --postclear             Clear all tmp files and caches after genkernel has run"
95   echo "  Output Settings"
96   echo "        --kernname=<...>        Tag the kernel and initrd with a name:"
97   echo "                                If not defined the option defaults to"
98   echo "                                'genkernel'"
99   echo "        --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
100   echo "                                No modules outside of the initrd will be"
101   echo "                                included..."
102   echo "        --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the"
103   echo "                                callbacks have run"
104   echo "        --kerncache=<tbz2>      File to output a .tar.bz2'd kernel contents"
105   echo "                                of /lib/modules/ and the kernel config"
106   echo "                                NOTE: This is created before the callbacks"
107   echo "                                are run!"
108   echo "        --no-kernel-sources     This option is only valid if kerncache is"
109   echo "                                defined. If there is a valid kerncache no checks"
110   echo "                                will be made against a kernel source tree"
111   echo "        --initramfs-overlay=<dir>"
112   echo "                                Directory structure to include in the initramfs,"
113   echo "                                only available on 2.6 kernels that do not use"
114   echo "                                bootsplash"
115 }
116
117 usage() {
118   echo "Gentoo Linux Genkernel ${GK_V}"
119   echo "Usage: "
120   echo "        genkernel [options] all"
121   echo
122   echo 'Some useful options:'
123   echo '        --menuconfig            Run menuconfig after oldconfig'
124   echo '        --no-clean              Do not run make clean before compilation'
125   echo '        --no-mrproper           Do not run make mrproper before compilation,'
126   echo '                                this is implied by --no-clean.'
127   echo
128   echo 'For a detailed list of supported options and flags; issue:'
129   echo '        genkernel --help'
130 }
131
132 parse_opt() {
133         case "$1" in
134                 *\=*)
135                         echo "$1" | cut -f2- -d=
136                 ;;
137         esac
138 }
139
140 parse_cmdline() {
141         case "$*" in
142               --kernel-cc=*)
143                       CMD_KERNEL_CC=`parse_opt "$*"`
144                       print_info 2 "CMD_KERNEL_CC: $CMD_KERNEL_CC"
145               ;;
146               --kernel-ld=*)
147                       CMD_KERNEL_LD=`parse_opt "$*"`
148                       print_info 2 "CMD_KERNEL_LD: $CMD_KERNEL_LD"
149               ;;
150               --kernel-as=*)
151                       CMD_KERNEL_AS=`parse_opt "$*"`
152                       print_info 2 "CMD_KERNEL_AS: $CMD_KERNEL_AS"
153               ;;
154               --kernel-make=*)
155                       CMD_KERNEL_MAKE=`parse_opt "$*"`
156                       print_info 2 "CMD_KERNEL_MAKE: $CMD_KERNEL_MAKE"
157               ;;
158               --kernel-cross-compile=*)
159                       CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"`
160                       CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
161                       print_info 2 "CMD_KERNEL_CROSS_COMPILE: $CMD_KERNEL_CROSS_COMPILE"
162               ;;
163               --utils-cc=*)
164                       CMD_UTILS_CC=`parse_opt "$*"`
165                       print_info 2 "CMD_UTILS_CC: $CMD_UTILS_CC"
166               ;;
167               --utils-ld=*)
168                       CMD_UTILS_LD=`parse_opt "$*"`
169                       print_info 2 "CMD_UTILS_LD: $CMD_UTILS_LD"
170               ;;
171               --utils-as=*)
172                       CMD_UTILS_AS=`parse_opt "$*"`
173                       print_info 2 "CMD_UTILS_AS: $CMD_UTILS_AS"
174               ;;
175               --utils-make=*)
176                       CMD_UTILS_MAKE=`parse_opt "$*"`
177                       print_info 2 "CMD_UTILS_MAKE: $CMD_UTILS_MAKE"
178               ;;
179               --utils-cross-compile=*)
180                       CMD_UTILS_CROSS_COMPILE=`parse_opt "$*"`
181                       CMD_UTILS_CROSS_COMPILE=$(echo ${CMD_UTILS_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')
182                       print_info 2 "CMD_UTILS_CROSS_COMPILE: $CMD_UTILS_CROSS_COMPILE"
183               ;;
184               --utils-arch=*)
185                       CMD_UTILS_ARCH=`parse_opt "$*"`
186                       print_info 2 "CMD_UTILS_ARCH: $CMD_ARCHOVERRIDE"
187               ;;
188               --makeopts=*)
189                       CMD_MAKEOPTS=`parse_opt "$*"`
190                       print_info 2 "CMD_MAKEOPTS: $CMD_MAKEOPTS"
191               ;;
192               --mountboot)
193                       CMD_MOUNTBOOT=1
194                       print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
195               ;;
196               --no-mountboot)
197                       CMD_MOUNTBOOT=0
198                       print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT"
199               ;;
200               --bootdir=*)
201                       BOOTDIR=`parse_opt "$*"`
202                       print_info 2 "BOOTDIR: $BOOTDIR"
203               ;;
204               --do-keymap-auto)
205                       CMD_DOKEYMAPAUTO=1
206                       print_info 2 "CMD_DOKEYMAPAUTO: $CMD_DOKEYMAPAUTO"
207               ;;
208               --evms2)
209                       CMD_EVMS2=1
210                       print_info 2 "CMD_EVMS2: $CMD_EVMS2"
211               ;;
212               --unionfs)
213                       echo
214                       print_warning 1 "WARNING: unionfs support is in active development and is not meant for general"
215                           print_warning 1 "use."
216                       print_warning 1 "DISABLING UNIONFS SUPPORT AT THIS TIME."
217                       echo
218               ;;
219               --unionfs-dev)
220                       CMD_UNIONFS=1
221                       print_info 2 "CMD_UNIONFS: $CMD_UNIONFS"
222                       echo
223                       print_warning 1 "WARNING: unionfs support is in active development and is not meant for general"
224                           print_warning 1 "use."
225                       print_warning 1 "Bug Reports without patches/fixes will be ignored."
226                       print_warning 1 "Use at your own risk as this could blow up your system."
227                       print_warning 1 "This code is subject to change at any time."
228                       echo
229               ;;
230               --lvm2)
231                       CMD_LVM2=1
232                       print_info 2 "CMD_LVM2: $CMD_LVM2"
233               ;;
234               --suspend)
235                       if [ ! -e /etc/suspend.conf ]
236                       then
237                         echo 'Error: --suspend requires sys-power/suspend to be installed'
238                         echo '       on the host system; try "emerge sys-power/suspend".'
239                         echo '       Once installed, configure the resume settings in /etc/suspend.conf'
240                         exit 1
241                       fi
242                       CMD_SUSPEND=1
243                       print_info 2 "CMD_SUSPEND: $CMD_SUSPEND"
244               ;;
245               --no-busybox)
246                       CMD_NO_BUSYBOX=1
247                       print_info 2 "CMD_NO_BUSYBOX: $CMD_NO_BUSYBOX"
248               ;;
249               --slowusb)
250                       CMD_SLOWUSB=1
251                       print_info 2 "CMD_SLOWUSB: $CMD_SLOWUSB"
252               ;;
253               --dmraid)
254                       if [ ! -e /usr/include/libdevmapper.h ]
255                       then
256                         echo 'Error: --dmraid requires device-mapper to be installed'
257                         echo '       on the host system; try "emerge device-mapper".'
258                         exit 1
259                       fi
260                       CMD_DMRAID=1
261                       print_info 2 "CMD_DMRAID: $CMD_DMRAID"
262               ;;
263               --bootloader=*)
264                       CMD_BOOTLOADER=`parse_opt "$*"`
265                       print_info 2 "CMD_BOOTLOADER: $CMD_BOOTLOADER"
266               ;;
267               --debuglevel=*)
268                       CMD_DEBUGLEVEL=`parse_opt "$*"`
269                       DEBUGLEVEL="${CMD_DEBUGLEVEL}"
270                       print_info 2 "CMD_DEBUGLEVEL: $CMD_DEBUGLEVEL"
271               ;;
272               --menuconfig)
273                       TERM_LINES=`stty -a | head -n 1 | cut -d\  -f5 | cut -d\; -f1`
274                       TERM_COLUMNS=`stty -a | head -n 1 | cut -d\  -f7 | cut -d\; -f1`
275
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               --bootsplash=*)
328                       CMD_BOOTSPLASH=1
329                       CMD_GENSPLASH=0
330                       BOOTSPLASH_THEME=`parse_opt "$*"`
331                       print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
332                       print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
333                       print_info 2 "BOOTSPLASH_THEME: $BOOTSPLASH_THEME"
334               ;;
335               --bootsplash)
336                       CMD_BOOTSPLASH=1
337                       CMD_GENSPLASH=0
338                       print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
339                       print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
340               ;;
341               --no-bootsplash)
342                       CMD_BOOTSPLASH=0
343                       print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
344               ;;
345               --gensplash=*)
346                       CMD_GENSPLASH=1
347                       CMD_BOOTSPLASH=0
348                       GENSPLASH_THEME=`parse_opt "$*"`
349                       print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
350                       print_info 2 "GENSPLASH_THEME: $GENSPLASH_THEME"
351                       print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
352               ;;
353               --gensplash)
354                       CMD_GENSPLASH=1
355                       CMD_BOOTSPLASH=0
356                       GENSPLASH_THEME='default'
357                       print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
358                       print_info 2 "CMD_BOOTSPLASH: $CMD_BOOTSPLASH"
359               ;;
360               --no-gensplash)
361                       CMD_GENSPLASH=0
362                       print_info 2 "CMD_GENSPLASH: $CMD_GENSPLASH"
363               ;;
364               --gensplash-res=*)
365                       GENSPLASH_RES=`parse_opt "$*"`
366                       print_info 2 "GENSPLASH_RES: $GENSPLASH_RES"
367               ;;
368               --install)
369                       CMD_NOINSTALL=0
370                       print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
371               ;;
372               --no-install)
373                       CMD_NOINSTALL=1
374                       print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
375               ;;
376               --no-initrdmodules)
377                       CMD_NOINITRDMODULES=1
378                       print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
379               ;;
380               --udev)
381                       echo
382                       echo
383                       print_info 1 "--udev is deprecated and no longer necessary as udev is on by default"
384                       sleep 3
385                       echo
386                       echo
387                       print_info 2 "CMD_UDEV: $CMD_UDEV"
388               ;;
389               --no-udev)
390                       CMD_NO_UDEV=1
391                       print_info 2 "CMD_NO_UDEV: $CMD_NO_UDEV"
392               ;;
393               --no-devfs)
394                       CMD_NO_DEVFS=1
395                       print_info 2 "CMD_NO_DEVFS: $CMD_NO_DEVFS"
396               ;;
397               --callback=*)
398                       CMD_CALLBACK=`parse_opt "$*"`
399                       print_info 2 "CMD_CALLBACK: $CMD_CALLBACK/$*"
400               ;;
401               --static)
402                       CMD_STATIC=1
403                       print_info 2 "CMD_STATIC: $CMD_STATIC"
404               ;;
405               --initramfs)
406                       CMD_INITRAMFS=1
407                       print_info 2 "CMD_INITRAMFS: $CMD_INITRAMFS"
408               ;;
409               --tempdir=*)
410                       TMPDIR=`parse_opt "$*"`
411                       TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
412                       print_info 2 "TMPDIR: $TMPDIR"
413                       print_info 2 "TEMP: $TEMP"
414               ;; 
415               --postclear)
416                       CMD_POSTCLEAR=1
417                       print_info 2 "CMD_POSTCLEAR: $CMD_POSTCLEAR"
418               ;; 
419               --arch-override=*)
420                       CMD_ARCHOVERRIDE=`parse_opt "$*"`
421                       print_info 2 "CMD_ARCHOVERRIDE: $CMD_ARCHOVERRIDE"
422               ;;
423               --color)
424                       USECOLOR=1
425                       print_info 2 "USECOLOR: $USECOLOR"
426                       setColorVars
427               ;;
428               --no-color)
429                       USECOLOR=0
430                       print_info 2 "USECOLOR: $USECOLOR"
431                       setColorVars
432               ;;
433               --debugfile=*)
434                       CMD_DEBUGFILE=`parse_opt "$*"`
435                       DEBUGFILE=`parse_opt "$*"`
436                       print_info 2 "CMD_DEBUGFILE: $CMD_DEBUGFILE"
437                       print_info 2 "DEBUGFILE: $CMD_DEBUGFILE"
438               ;;
439               --kerneldir=*)
440                       CMD_KERNELDIR=`parse_opt "$*"`
441                       print_info 2 "CMD_KERNELDIR: $CMD_KERNELDIR"
442               ;;
443               --kernel-config=*)
444                       CMD_KERNEL_CONFIG=`parse_opt "$*"`
445                       print_info 2 "CMD_KERNEL_CONFIG: $CMD_KERNEL_CONFIG"
446               ;;
447               --module-prefix=*)
448                       CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
449                       print_info 2 "CMD_INSTALL_MOD_PATH: $CMD_INSTALL_MOD_PATH"
450               ;;
451               --cachedir=*)
452                       CACHE_DIR=`parse_opt "$*"`
453                       print_info 2 "CACHE_DIR: $CACHE_DIR"
454               ;;
455               --minkernpackage=*)
456                       CMD_MINKERNPACKAGE=`parse_opt "$*"`
457                       print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE"
458               ;;
459               --modulespackage=*)
460                       CMD_MODULESPACKAGE=`parse_opt "$*"`
461                       print_info 2 "MODULESPACKAGE: $CMD_MODULESPACKAGE"
462               ;;
463               --kerncache=*)
464                       CMD_KERNCACHE=`parse_opt "$*"`
465                       print_info 2 "KERNCACHE: $CMD_KERNCACHE"
466               ;;
467               --kernname=*)
468                       CMD_KERNNAME=`parse_opt "$*"`
469                       print_info 2 "KERNNAME: $CMD_KERNNAME"
470               ;;
471               --symlink)
472                       CMD_SYMLINK=1
473                       print_info 2 "CMD_SYMLINK: $CMD_SYMLINK"
474               ;;
475               --no-symlink)
476                       CMD_SYMLINK=0
477                       print_info 2 "CMD_SYMLINK: $CMD_SYMLINK"
478               ;;
479               --no-kernel-sources)
480                       CMD_NO_KERNEL_SOURCES=1
481                       print_info 2 "CMD_NO_KERNEL_SOURCES: $CMD_NO_KERNEL_SOURCES"
482               ;;
483               --initramfs-overlay=*)
484                       CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
485                       print_info 2 "CMD_INITRAMFS_OVERLAY: $CMD_INITRAMFS_OVERLAY"
486               ;;
487               --linuxrc=*)
488                         CMD_LINUXRC=`parse_opt "$*"`
489                         print_info 2 "CMD_LINUXRC: $CMD_LINUXRC"
490               ;;
491               --genzimage)
492                         KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
493                         KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd'
494                         GENERATE_Z_IMAGE=1
495                         print_info 2 "GENERATE_Z_IMAGE: $GENERATE_Z_IMAGE"
496               ;;
497               --disklabel)
498                       CMD_DISKLABEL=1
499                       print_info 2 "CMD_DISKLABEL: $CMD_DISKLABEL"
500               ;;
501               --luks)
502                       CMD_LUKS=1
503                       print_info 2 "CMD_LUKS: $CMD_LUKS"
504               ;;
505               all)
506                       BUILD_KERNEL=1
507                       BUILD_MODULES=1
508                       BUILD_INITRD=1
509               ;;
510               initrd)
511                       BUILD_INITRD=1
512               ;;
513               kernel)
514                       BUILD_KERNEL=1
515                       BUILD_MODULES=1
516                       BUILD_INITRD=0
517               ;;
518               bzImage)
519                       BUILD_KERNEL=1
520                       BUILD_MODULES=0
521                       BUILD_INITRD=1
522                       CMD_NOINITRDMODULES=1
523                       print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
524               ;;
525               --help)
526                       longusage
527                       exit 1
528               ;;
529               --version)
530                       echo "${GK_V}"
531                       exit 0
532               ;;
533               *)
534                       echo "Error: Unknown option '$*'!"
535                       exit 1
536               ;;
537         esac
538 }