Lines 44-50
Link Here
|
44 |
echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk" |
44 |
echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk" |
45 |
echo " --callback=<...> Run the specified arguments after the" |
45 |
echo " --callback=<...> Run the specified arguments after the" |
46 |
echo " kernel and modules have been compiled" |
46 |
echo " kernel and modules have been compiled" |
47 |
echo " --static Build a static (monolithic kernel)." |
47 |
echo " --static Build a static (monolithic kernel)" |
|
|
48 |
echo " --genzimage Build zImage.initrd for PowerPC arch" |
49 |
echo " --no-genzimage Do not build zImage.initrd" |
48 |
echo " Kernel settings" |
50 |
echo " Kernel settings" |
49 |
echo " --kerneldir=<dir> Location of the kernel sources" |
51 |
echo " --kerneldir=<dir> Location of the kernel sources" |
50 |
echo " --kernel-config=<file> Kernel configuration file to use for compilation" |
52 |
echo " --kernel-config=<file> Kernel configuration file to use for compilation" |
Lines 92-97
Link Here
|
92 |
echo " --busybox-config=<file> Specifies a user created busybox config" |
94 |
echo " --busybox-config=<file> Specifies a user created busybox config" |
93 |
echo " --disklabel Include disk label and uuid support in your" |
95 |
echo " --disklabel Include disk label and uuid support in your" |
94 |
echo " ramdisk" |
96 |
echo " ramdisk" |
|
|
97 |
echo " --no-disklabel Do not include disk label and uuid support" |
95 |
echo " --luks Include LUKS support" |
98 |
echo " --luks Include LUKS support" |
96 |
echo " --> 'emerge cryptsetup-luks' with USE=-dynamic" |
99 |
echo " --> 'emerge cryptsetup-luks' with USE=-dynamic" |
97 |
echo " --no-busybox Do not include busybox in the initramfs." |
100 |
echo " --no-busybox Do not include busybox in the initramfs." |
Lines 151-156
Link Here
|
151 |
echo ' genkernel --help' |
154 |
echo ' genkernel --help' |
152 |
} |
155 |
} |
153 |
|
156 |
|
|
|
157 |
# |
158 |
# Notes on adding command line options: |
159 |
# |
160 |
# To allow all command line options to (a) have a genkernel or architecture-specific |
161 |
# default defined in a consistent location, (b) have a site default defined in |
162 |
# "/etc/genkernel.conf", and (c) override these other two settings on the command |
163 |
# line, please follow the following coding guidelines when adding command line |
164 |
# options: |
165 |
# |
166 |
# Step 1: |
167 |
# For boolean command line options (for example --foo), |
168 |
# * Set up both a --foo and --no-foo case below. |
169 |
# * Set the CMD_FOO variable to 1 in the --foo case and 0 in the |
170 |
# --no-foo case. |
171 |
# |
172 |
# For parametric command line options (for example --foo=bar), |
173 |
# * Set up both a --foo and --no-foo case below. |
174 |
# * Just set the CMD_FOO variable appropriately. In most cases, |
175 |
# use `parse_opt "$*"`. |
176 |
# |
177 |
# Include a logging call to the print_info function. |
178 |
# |
179 |
# Step 2: |
180 |
# Add a call to the set_config_with_override() function in the |
181 |
# determine_real_args() function in "gen_determineargs.sh". It should look |
182 |
# something like this: |
183 |
# |
184 |
# set_config_with_override <type> FOO CMD_FOO "<default>" |
185 |
# |
186 |
# <type> should be 1 for boolean command line options and 2 for parametric |
187 |
# command line options. |
188 |
# |
189 |
# "<default>" can either be blank (if there's no default), a constant (if |
190 |
# there's a fixed default), or a calculated architecture specific value. |
191 |
# |
192 |
# Step 3: |
193 |
# Later on in the determine_real_args() function, run any code that needs |
194 |
# to be run based on the value of your command line option or its default |
195 |
# value. Putting it there makes sure that it's run against all sources |
196 |
# of the argument value. |
197 |
# |
198 |
# Step 4: |
199 |
# Document your new command in the longusage() function and in the man |
200 |
# page source. It's probably also a good idea to include a commented out |
201 |
# example of the site default in genkernel.conf. |
202 |
# |
203 |
# Note that these are just guidelines; you will see some well thought out |
204 |
# exceptions coded below. |
205 |
# |
206 |
# - JRG |
207 |
|
154 |
parse_cmdline() { |
208 |
parse_cmdline() { |
155 |
case "$*" in |
209 |
case "$*" in |
156 |
--kernel-cc=*) |
210 |
--kernel-cc=*) |
Lines 197-203
Link Here
|
197 |
;; |
251 |
;; |
198 |
--utils-arch=*) |
252 |
--utils-arch=*) |
199 |
CMD_UTILS_ARCH=`parse_opt "$*"` |
253 |
CMD_UTILS_ARCH=`parse_opt "$*"` |
200 |
print_info 2 "CMD_UTILS_ARCH: ${CMD_ARCHOVERRIDE}" |
254 |
print_info 2 "CMD_UTILS_ARCH: ${CMD_UTILS_ARCH}" |
201 |
;; |
255 |
;; |
202 |
--makeopts=*) |
256 |
--makeopts=*) |
203 |
CMD_MAKEOPTS=`parse_opt "$*"` |
257 |
CMD_MAKEOPTS=`parse_opt "$*"` |
Lines 298-329
Link Here
|
298 |
;; |
352 |
;; |
299 |
--loglevel=*) |
353 |
--loglevel=*) |
300 |
CMD_LOGLEVEL=`parse_opt "$*"` |
354 |
CMD_LOGLEVEL=`parse_opt "$*"` |
|
|
355 |
# Exception: Set the log file immediately so that it provides |
356 |
# the most comrehensive trace. - JRG |
301 |
LOGLEVEL="${CMD_LOGLEVEL}" |
357 |
LOGLEVEL="${CMD_LOGLEVEL}" |
302 |
print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}" |
358 |
print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}" |
303 |
;; |
359 |
;; |
304 |
--menuconfig) |
360 |
--menuconfig) |
305 |
TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1` |
361 |
CMD_MENUCONFIG="menuconfig" |
306 |
TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1` |
362 |
print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}" |
307 |
if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]] |
|
|
308 |
then |
309 |
echo "Error: You need a terminal with at least 80 columns" |
310 |
echo " and 19 lines for --menuconfig; try --nomenuconfig..." |
311 |
exit 1 |
312 |
fi |
313 |
CMD_MENUCONFIG=1 |
314 |
print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}" |
315 |
;; |
363 |
;; |
316 |
--no-menuconfig) |
364 |
--no-menuconfig) |
317 |
CMD_MENUCONFIG=0 |
365 |
CMD_MENUCONFIG="no" |
318 |
print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}" |
366 |
print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}" |
319 |
;; |
367 |
;; |
320 |
--gconfig) |
368 |
--gconfig) |
321 |
CMD_GCONFIG=1 |
369 |
CMD_MENUCONFIG="gconfig" |
322 |
print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}" |
370 |
print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}" |
323 |
;; |
371 |
;; |
324 |
--xconfig) |
372 |
--xconfig) |
325 |
CMD_XCONFIG=1 |
373 |
CMD_MENUCONFIG="xconfig" |
326 |
print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}" |
374 |
print_info 2 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}" |
327 |
;; |
375 |
;; |
328 |
--save-config) |
376 |
--save-config) |
329 |
CMD_SAVE_CONFIG=1 |
377 |
CMD_SAVE_CONFIG=1 |
Lines 357-384
Link Here
|
357 |
;; |
405 |
;; |
358 |
--gensplash=*) |
406 |
--gensplash=*) |
359 |
CMD_SPLASH=1 |
407 |
CMD_SPLASH=1 |
360 |
SPLASH_THEME=`parse_opt "$*"` |
408 |
CMD_SPLASH_THEME=`parse_opt "$*"` |
361 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
409 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
362 |
print_info 2 "SPLASH_THEME: ${SPLASH_THEME}" |
410 |
print_info 2 "CMD_SPLASH_THEME: ${CMD_SPLASH_THEME}" |
363 |
echo |
411 |
echo |
364 |
print_warning 1 "Please use --splash, as --gensplash is deprecated." |
412 |
print_warning 1 "Please use --splash, as --gensplash is deprecated." |
365 |
;; |
413 |
;; |
366 |
--gensplash) |
414 |
--gensplash) |
367 |
CMD_SPLASH=1 |
415 |
CMD_SPLASH=1 |
368 |
SPLASH_THEME='default' |
416 |
CMD_SPLASH_THEME='default' |
369 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
417 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
370 |
echo |
418 |
echo |
371 |
print_warning 1 "Please use --splash, as --gensplash is deprecated." |
419 |
print_warning 1 "Please use --splash, as --gensplash is deprecated." |
372 |
;; |
420 |
;; |
373 |
--splash=*) |
421 |
--splash=*) |
374 |
CMD_SPLASH=1 |
422 |
CMD_SPLASH=1 |
375 |
SPLASH_THEME=`parse_opt "$*"` |
423 |
CMD_SPLASH_THEME=`parse_opt "$*"` |
376 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
424 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
377 |
print_info 2 "SPLASH_THEME: ${SPLASH_THEME}" |
425 |
print_info 2 "CMD_SPLASH_THEME: ${CMD_SPLASH_THEME}" |
378 |
;; |
426 |
;; |
379 |
--splash) |
427 |
--splash) |
380 |
CMD_SPLASH=1 |
428 |
CMD_SPLASH=1 |
381 |
SPLASH_THEME='default' |
429 |
CMD_SPLASH_THEME='default' |
382 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
430 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
383 |
;; |
431 |
;; |
384 |
--no-splash) |
432 |
--no-splash) |
Lines 386-399
Link Here
|
386 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
434 |
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" |
387 |
;; |
435 |
;; |
388 |
--gensplash-res=*) |
436 |
--gensplash-res=*) |
389 |
SPLASH_RES=`parse_opt "$*"` |
437 |
CMD_SPLASH_RES=`parse_opt "$*"` |
390 |
print_info 2 "SPLASH_RES: ${SPLASH_RES}" |
438 |
print_info 2 "CMD_SPLASH_RES: ${CMD_SPLASH_RES}" |
391 |
echo |
439 |
echo |
392 |
print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated." |
440 |
print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated." |
393 |
;; |
441 |
;; |
394 |
--splash-res=*) |
442 |
--splash-res=*) |
395 |
SPLASH_RES=`parse_opt "$*"` |
443 |
CMD_SPLASH_RES=`parse_opt "$*"` |
396 |
print_info 2 "SPLASH_RES: ${SPLASH_RES}" |
444 |
print_info 2 "CMD_SPLASH_RES: ${CMD_SPLASH_RES}" |
397 |
;; |
445 |
;; |
398 |
--install) |
446 |
--install) |
399 |
CMD_NOINSTALL=0 |
447 |
CMD_NOINSTALL=0 |
Lines 413-453
Link Here
|
413 |
;; |
461 |
;; |
414 |
--callback=*) |
462 |
--callback=*) |
415 |
CMD_CALLBACK=`parse_opt "$*"` |
463 |
CMD_CALLBACK=`parse_opt "$*"` |
416 |
print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*" |
464 |
print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}" |
417 |
;; |
465 |
;; |
418 |
--static) |
466 |
--static) |
419 |
CMD_STATIC=1 |
467 |
CMD_STATIC=1 |
420 |
print_info 2 "CMD_STATIC: ${CMD_STATIC}" |
468 |
print_info 2 "CMD_STATIC: ${CMD_STATIC}" |
421 |
;; |
469 |
;; |
422 |
--tempdir=*) |
470 |
--tempdir=*) |
423 |
TMPDIR=`parse_opt "$*"` |
471 |
CMD_TMPDIR=`parse_opt "$*"` |
424 |
TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ |
472 |
print_info 2 "CMD_TMPDIR: ${CMD_TMPDIR}" |
425 |
print_info 2 "TMPDIR: ${TMPDIR}" |
|
|
426 |
print_info 2 "TEMP: ${TEMP}" |
427 |
;; |
473 |
;; |
428 |
--postclear) |
474 |
--postclear) |
429 |
CMD_POSTCLEAR=1 |
475 |
CMD_POSTCLEAR=1 |
430 |
print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}" |
476 |
print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}" |
431 |
;; |
477 |
;; |
432 |
--arch-override=*) |
478 |
--arch-override=*) |
433 |
CMD_ARCHOVERRIDE=`parse_opt "$*"` |
479 |
CMD_ARCH_OVERRIDE=`parse_opt "$*"` |
434 |
print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}" |
480 |
print_info 2 "CMD_ARCH_OVERRIDE: ${CMD_ARCH_OVERRIDE}" |
435 |
;; |
481 |
;; |
436 |
--color) |
482 |
--color) |
437 |
USECOLOR=1 |
483 |
CMD_USECOLOR=1 |
438 |
print_info 2 "USECOLOR: ${USECOLOR}" |
484 |
print_info 2 "CMD_USECOLOR: ${CMD_USECOLOR}" |
|
|
485 |
USECOLOR="${CMD_USECOLOR}" |
439 |
setColorVars |
486 |
setColorVars |
440 |
;; |
487 |
;; |
441 |
--no-color) |
488 |
--no-color) |
442 |
USECOLOR=0 |
489 |
CMD_USECOLOR=0 |
443 |
print_info 2 "USECOLOR: ${USECOLOR}" |
490 |
print_info 2 "CMD_USECOLOR: ${CMD_USECOLOR}" |
|
|
491 |
USECOLOR="${CMD_USECOLOR}" |
444 |
setColorVars |
492 |
setColorVars |
445 |
;; |
493 |
;; |
446 |
--logfile=*) |
494 |
--logfile=*) |
447 |
CMD_LOGFILE=`parse_opt "$*"` |
495 |
CMD_LOGFILE=`parse_opt "$*"` |
448 |
LOGFILE=`parse_opt "$*"` |
496 |
# Exception: Set the log file immediately so that it provides |
|
|
497 |
# the most comrehensive trace. - JRG |
498 |
LOGFILE="${CMD_LOGFILE}" |
449 |
print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}" |
499 |
print_info 2 "CMD_LOGFILE: ${CMD_LOGFILE}" |
450 |
print_info 2 "LOGFILE: ${CMD_LOGFILE}" |
|
|
451 |
;; |
500 |
;; |
452 |
--kerneldir=*) |
501 |
--kerneldir=*) |
453 |
CMD_KERNEL_DIR=`parse_opt "$*"` |
502 |
CMD_KERNEL_DIR=`parse_opt "$*"` |
Lines 506-521
Link Here
|
506 |
print_info 2 "CMD_BUSYBOX_CONFIG: ${CMD_BUSYBOX_CONFIG}" |
555 |
print_info 2 "CMD_BUSYBOX_CONFIG: ${CMD_BUSYBOX_CONFIG}" |
507 |
;; |
556 |
;; |
508 |
--genzimage) |
557 |
--genzimage) |
509 |
KERNEL_MAKE_DIRECTIVE_2='zImage.initrd' |
558 |
CMD_GENZIMAGE=1 |
510 |
KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd' |
559 |
print_info 2 "CMD_GENZIMAGE: ${CMD_GENZIMAGE}" |
511 |
CMD_GENZIMAGE="yes" |
560 |
;; |
512 |
# ENABLE_PEGASOS_HACKS="yes" |
561 |
--no-genzimage) |
513 |
# print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}" |
562 |
CMD_GENZIMAGE=0 |
|
|
563 |
print_info 2 "CMD_GENZIMAGE: ${CMD_GENZIMAGE}" |
514 |
;; |
564 |
;; |
515 |
--disklabel) |
565 |
--disklabel) |
516 |
CMD_DISKLABEL=1 |
566 |
CMD_DISKLABEL=1 |
517 |
print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}" |
567 |
print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}" |
518 |
;; |
568 |
;; |
|
|
569 |
--no-disklabel) |
570 |
CMD_DISKLABEL=0 |
571 |
print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}" |
572 |
;; |
519 |
--luks) |
573 |
--luks) |
520 |
CMD_LUKS=1 |
574 |
CMD_LUKS=1 |
521 |
print_info 2 "CMD_LUKS: ${CMD_LUKS}" |
575 |
print_info 2 "CMD_LUKS: ${CMD_LUKS}" |