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