diff --git a/ChangeLog b/ChangeLog index b56941c..9079806 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,14 @@ # Distributed under the GPL v2 # $Id$ + 04 Jan 2012; Robin H. Johnson arch/mips/config.sh, + doc/genkernel.8.txt, gen_cmdline.sh, gen_compile.sh, gen_determineargs.sh, + gen_funcs.sh, gen_initramfs.sh, genkernel, genkernel.conf: + Provide real boolean commandline options for options that were previously + only available as booleans in the config, so that they can be enable in + configuration and overridden to disable on the commandline. Remove negation + on options: NOINSTALL, NORAMDISKMODULES, NO_KERNEL_SOURCES. + 08 Nov 2011; Sebastian Pipping genkernel: Bump version to 3.4.20 diff --git a/arch/mips/config.sh b/arch/mips/config.sh index 05b3c82..9d49c09 100755 --- a/arch/mips/config.sh +++ b/arch/mips/config.sh @@ -16,7 +16,7 @@ DISKLABEL=0 # genkernel on mips is only used for LiveCDs && netboots. Catalyst # will know where to get the kernels at. -CMD_NOINSTALL=1 +CMD_INSTALL=0 # # Arch-specific defaults that can be overridden in the config file or on the diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index bf621ce..35c7ff3 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -95,11 +95,11 @@ KERNEL CONFIGURATION Saves, or does not save the kernel configuration to '/etc/kernels' if the kernel is successfully compiled. -*--gconfig*:: - Run "make gconfig" after "make oldconfig". +*--*[*no-*]*gconfig*:: + Runs, or does not run "make gconfig" after "make oldconfig". -*--xconfig*:: - Run "make xconfig" after "make oldconfig". +*--*[*no-*]*xconfig*:: + Runs, or does not run "make xconfig" after "make oldconfig". KERNEL COMPILATION @@ -140,19 +140,19 @@ KERNEL COMPILATION *--*[*no-*]*splash*:: Installs, or not, framebuffer splash support into initramfs. -*--no-ramdisk-modules*:: - Don't copy any modules to the ramdisk. +*--*[*no-*]*ramdisk-modules*:: + Copies or does not copy configured modules to the ramdisk. -*--all-ramdisk-modules*:: - Copy all kernel modules to the initrd. +*--*[*no-*]*all-ramdisk-modules*:: + Copies or does not copy all kernel modules to the initrd. *--callback*=<...>:: Run the specified arguments in the current environment after the kernel and modules have been compiled. -*--static*:: - This builds a monolithic kernel without any modules on any - initial ramdisks. +*--*[*no-*]*static*:: + Builds, or does not build a monolithic kernel without any modules on any + initial ramdisks. KERNEL LOCATIONS @@ -241,16 +241,15 @@ INITIALIZATION *--do-keymap-auto*:: Force keymap selection at boot. -*--no-keymap*:: - Disables keymap selection at boot. +*--*[*no-*]*keymap*:: + Enables or disables keymap selection at boot. -*--lvm*:: - Add in LVM support from static binaries if they exist on the - system, or compile static LVM binaries if static ones do not - exist. +*--*[*no-*]*lvm*:: + Adds or skips in LVM support from static binaries if they exist on the + system, or compile static LVM binaries if static ones do not exist. -*--mdadm*:: - Include mdadm/mdmon support. +*--*[*no-*]*mdadm*:: + Includes or excludes mdadm/mdmon support. Without sys-fs/mdadm[static] installed, this will compile mdadm for you. *--mdadm-config*=:: @@ -258,14 +257,14 @@ INITIALIZATION By default the ramdisk will be built *without* an mdadm.conf and will auto-detect arrays during boot-up. -*--dmraid*:: - Include DMRAID support. +*--*[*no-*]*dmraid*:: + Includes or excludes DMRAID support. -*--multipath*:: - Include Multipath support +*--*[*no-*]*multipath*:: + Includes or excludes Multipath support -*--iscsi*:: - Include iSCSI support +*--*[*no-*]*iscsi*:: + Includes or excludes iSCSI support *--bootloader*=*grub*:: Add new kernel to GRUB configuration. @@ -279,27 +278,27 @@ INITIALIZATION *--genzimage*:: Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'. -*--disklabel*:: - Include disk label and uuid support in your initrd. +*--*[*no-*]*disklabel*:: + Includes or excludes disk label and uuid support in your initrd. -*--luks*:: - Add in Luks support from static binaries if they exist on the - system. +*--*[*no-*]*luks*:: + Includes or excludes Luks support from static binaries if they exist on + the system. -*--gpg*:: - Add support for GnuPG 1.x, the portable standalone branch of GnuPG. - A key can be made from +*--*[*no-*]*gpg*:: + Includes or excludes support for GnuPG 1.x, the portable standalone branch + of GnuPG. A key can be made from `gpg --symmetric -o /path/to/LUKS-key.gpg /path/to/LUKS-key` . After that, re-point the *root_key* argument to the new .gpg file. -*--no-busybox*:: - Do not include busybox in the initrd or initramfs. +*--*[*no-*]*busybox*:: + Includes or excludes busybox in the initrd or initramfs. -*--unionfs*:: - Include support for unionfs +*--*[*no-*]*unionfs*:: + Includes or excludes support for unionfs -*--netboot*:: - Create a self-contained env in the initramfs +*--*[*no-*]*netboot*:: + Creates or does not create a self-contained env in the initramfs *--real-root*=:: Specify a default for *real_root*= kernel option. @@ -317,8 +316,8 @@ INTERNALS *--tempdir*=:: Sets genkernel's temporary working directory to . -*--postclear*:: - Clear all tmp files and caches after genkernel has run. +*--*[*no-*]*postclear*:: + Clears or skips clearing all tmp files and caches after genkernel has run. OUTPUT SETTINGS @@ -339,7 +338,7 @@ OUTPUT SETTINGS and the kernel config. NOTE: This is created before the callbacks are run. -*--no-kernel-sources*=:: +*--*[*no-*]*kernel-sources*:: This option is only valid if kerncache is defined If there is a valid kerncache no checks will be made against a kernel source tree. @@ -348,8 +347,8 @@ OUTPUT SETTINGS Directory structure to include in the initramfs, only available on >=2.6 kernels -*--firmware*:: - Enable copying of firmware into initramfs. +*--*[*no-*]*firmware*:: + Enable or disables copying of firmware into initramfs. *--firmware-dir*=:: Specify directory to copy firmware from (defaults to '/lib/firmware'). @@ -358,8 +357,9 @@ OUTPUT SETTINGS Specifies specific firmware files to copy. This overrides *--firmware-dir*. For multiple files, separate the filenames with a comma. -*--integrated-initramfs*:: - Build the generated initramfs into the kernel instead of keeping it as a separate file. +*--*[*no-*]*integrated-initramfs*:: + Builds or does not build the generated initramfs into the kernel instead + of keeping it as a separate file. RAMDISK OPTIONS @@ -573,6 +573,8 @@ AUTHORS ------- - Tim Yamin - Eric Edgar +- Chris Gianelloni +- Sebastian Pipping - NFS Support by Thomas Seiler - GnuPG 1.x integration by dacook - MDADM integration by Matthias Dahl diff --git a/gen_cmdline.sh b/gen_cmdline.sh index f048b28..a89636c 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -25,27 +25,31 @@ longusage() { echo " Kernel Configuration settings" echo " --menuconfig Run menuconfig after oldconfig" echo " --no-menuconfig Do not run menuconfig after oldconfig" - echo " --gconfig Run gconfig after oldconfig" - echo " --xconfig Run xconfig after oldconfig" + echo " --gconfig Run gconfig after oldconfig" + echo " --no-gconfig Don't run gconfig after oldconfig" + echo " --xconfig Run xconfig after oldconfig" + echo " --no-xconfig Don't run xconfig after oldconfig" echo " --save-config Save the configuration to /etc/kernels" echo " --no-save-config Don't save the configuration to /etc/kernels" echo " Kernel Compile settings" + echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'" echo " --clean Run make clean before compilation" - echo " --mrproper Run make mrproper before compilation" echo " --no-clean Do not run make clean before compilation" - echo " --no-mrproper Do not run make mrproper before compilation" - echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'" + echo " --mrproper Run make mrproper before compilation" + echo " --no-mrproper Do not run make mrproper before compilation" echo " --splash Install framebuffer splash support into initramfs" echo " --no-splash Do not install framebuffer splash" echo " --install Install the kernel after building" echo " --no-install Do not install the kernel after building" echo " --symlink Manage symlinks in /boot for installed images" echo " --no-symlink Do not manage symlinks" + echo " --ramdisk-modules Copy required modules to the ramdisk" echo " --no-ramdisk-modules Don't copy any modules to the ramdisk" echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk" echo " --callback=<...> Run the specified arguments after the" echo " kernel and modules have been compiled" echo " --static Build a static (monolithic kernel)." + echo " --no-static Do not build a static (monolithic kernel)." echo " Kernel settings" echo " --kerneldir= Location of the kernel sources" echo " --kernel-config= Kernel configuration file to use for compilation" @@ -77,31 +81,43 @@ longusage() { echo " --splash= Enable framebuffer splash using " echo " --splash-res= Select splash theme resolutions to install" echo " --do-keymap-auto Forces keymap selection at boot" + echo " --keymap Enables keymap selection support" echo " --no-keymap Disables keymap selection support" echo " --lvm Include LVM support" + echo " --no-lvm Exclude LVM support" echo " --mdadm Include MDADM/MDMON support" + echo " --no-mdadm Exclude MDADM/MDMON support" echo " --mdadm-config= Use file as mdadm.conf in initramfs" echo " --dmraid Include DMRAID support" + echo " --no-dmraid Exclude DMRAID support" echo " --multipath Include Multipath support" + echo " --no-multipath Exclude Multipath support" echo " --iscsi Include iSCSI support" + echo " --no-iscsi Exclude iSCSI support" echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --linuxrc= Specifies a user created linuxrc" echo " --busybox-config= Specifies a user created busybox config" echo " --genzimage Make and install kernelz image (PowerPC)" - echo " --disklabel Include disk label and uuid support in your" - echo " ramdisk" + echo " --disklabel Include disk label and uuid support in your ramdisk" + echo " --no-disklabel Exclude disk label and uuid support in your ramdisk" echo " --luks Include LUKS support" echo " --> 'emerge cryptsetup-luks' with USE=-dynamic" + echo " --no-luks Exclude LUKS support" echo " --gpg Include GPG-armored LUKS key support" - echo " --no-busybox Do not include busybox in the initramfs." + echo " --no-gpg Exclude GPG-armored LUKS key support" + echo " --busybox Include busybox" + echo " --no-busybox Exclude busybox" echo " --unionfs Include support for unionfs" + echo " --no-unionfs Exclude support for unionfs" echo " --netboot Create a self-contained env in the initramfs" + echo " --no-netboot Exclude --netboot env" echo " --real-root= Specify a default for real_root=" echo " Internals" echo " --arch-override= Force to arch instead of autodetect" echo " --cachedir= Override the default cache location" echo " --tempdir= Location of Genkernel's temporary directory" - echo " --postclear Clear all tmp files and caches after genkernel has run" + echo " --postclear Clear all tmp files and caches after genkernel has run" + echo " --no-postclear Do not clean up after genkernel has run" echo " Output Settings" echo " --kernname=<...> Tag the kernel and ramdisk with a name:" echo " If not defined the option defaults to" @@ -130,9 +146,9 @@ longusage() { echo " Specifies specific firmware files to copy. This" echo " overrides --firmware-dir. For multiple files," echo " separate the filenames with a comma" - echo " --integrated-initramfs" - echo " Build the generated initramfs into the kernel instead of" - echo " keeping it as a separate file" + echo " --integrated-initramfs, --no-integrated-initramfs" + echo " Include/exclude the generated initramfs in the kernel" + echo " instead of keeping it as a separate file" } usage() { @@ -151,6 +167,12 @@ usage() { echo ' genkernel --help' } +parse_optbool() { + local opt=${1/--no-*/0} # false + opt=${opt/--*/1} # true + echo $opt +} + parse_cmdline() { case "$*" in --kernel-cc=*) @@ -211,12 +233,8 @@ parse_cmdline() { CMD_MAKEOPTS=`parse_opt "$*"` print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}" ;; - --mountboot) - CMD_MOUNTBOOT=1 - print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}" - ;; - --no-mountboot) - CMD_MOUNTBOOT=0 + --mountboot|--no-mountboot) + CMD_MOUNTBOOT=`parse_optbool "$*"` print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}" ;; --bootdir=*) @@ -228,70 +246,70 @@ parse_cmdline() { CMD_KEYMAP=1 print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}" ;; - --no-keymap) - CMD_KEYMAP=0 + --keymap|--no-keymap) + CMD_KEYMAP=`parse_optbool "$*"` print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" ;; - --lvm) - CMD_LVM=1 + --lvm|--no-lvm) + CMD_LVM=`parse_optbool "$*"` print_info 2 "CMD_LVM: ${CMD_LVM}" ;; - --lvm2) - CMD_LVM=1 + --lvm2|--no-lvm2) + CMD_LVM=`parse_optbool "$*"` print_info 2 "CMD_LVM: ${CMD_LVM}" echo print_warning 1 "Please use --lvm, as --lvm2 is deprecated." ;; - --mdadm) - CMD_MDADM=1 + --mdadm|--no-mdadm) + CMD_MDADM=`parse_optbool "$*"` print_info 2 "CMD_MDADM: $CMD_MDADM" ;; --mdadm-config=*) CMD_MDADM_CONFIG=`parse_opt "$*"` print_info 2 "CMD_MDADM_CONFIG: $CMD_MDADM_CONFIG" ;; - --no-busybox) - CMD_BUSYBOX=0 + --busybox|--no-busybox) + CMD_BUSYBOX=`parse_optbool "$*"` print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}" ;; - --unionfs) - CMD_UNIONFS=1 + --unionfs|--no-unionfs) + CMD_UNIONFS=`parse_optbool "$*"` print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}" ;; - --netboot) - CMD_NETBOOT=1 + --netboot|--no-netboot) + CMD_NETBOOT=`parse_optbool "$*"` print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}" ;; --real-root=*) CMD_REAL_ROOT=`parse_opt "$*"` print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}" ;; - --dmraid) - if [ ! -e /usr/include/libdevmapper.h ] + --dmraid|--no-dmraid) + CMD_DMRAID=`parse_optbool "$*"` + if [ "$CMD_DMRAID" = "1" -a ! -e /usr/include/libdevmapper.h ] then echo 'Error: --dmraid requires device-mapper to be installed' echo ' on the host system; try "emerge device-mapper".' exit 1 fi - CMD_DMRAID=1 print_info 2 "CMD_DMRAID: ${CMD_DMRAID}" ;; - --multipath) - if [ ! -e /usr/include/libdevmapper.h ] + --multipath|--no-multipath) + CMD_MULTIPATH=`parse_optbool "$*"` + if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ] then echo 'Error: --multipath requires device-mapper to be installed' echo ' on the host;system; try "emerge device-mapper".' exit 1 fi - CMD_MULTIPATH=1 print_info 2 "CMD_MULTIPATH: ${CMD_MULTIPATH}" ;; --bootloader=*) CMD_BOOTLOADER=`parse_opt "$*"` print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}" ;; - --iscsi) - CMD_ISCSI=1 + --iscsi|--no-iscsi) + CMD_ISCSI=`parse_optbool "$*"` print_info 2 "CMD_ISCSI: ${CMD_ISCSI}" ;; --loglevel=*) @@ -315,41 +333,29 @@ parse_cmdline() { CMD_MENUCONFIG=0 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}" ;; - --gconfig) - CMD_GCONFIG=1 + --gconfig|--no-gconfig) + CMD_GCONFIG=`parse_optbool "$*"` print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}" ;; - --xconfig) - CMD_XCONFIG=1 + --xconfig|--no-xconfig) + CMD_XCONFIG=`parse_optbool "$*"` print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}" ;; - --save-config) - CMD_SAVE_CONFIG=1 - print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}" - ;; - --no-save-config) - CMD_SAVE_CONFIG=0 + --save-config|--no-save-config) + CMD_SAVE_CONFIG=`parse_optbool "$*"` print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}" ;; - --mrproper) - CMD_MRPROPER=1 + --mrproper|--no-mrproper) + CMD_MRPROPER=`parse_optbool "$*"` print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}" ;; - --no-mrproper) - CMD_MRPROPER=0 - print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}" - ;; - --clean) - CMD_CLEAN=1 + --clean|--no-clean) + CMD_CLEAN=`parse_optbool "$*"` print_info 2 "CMD_CLEAN: ${CMD_CLEAN}" ;; - --no-clean) - CMD_CLEAN=0 - print_info 2 "CMD_CLEAN: ${CMD_CLEAN}" - ;; - --oldconfig) - CMD_CLEAN=0 - CMD_OLDCONFIG=1 + --oldconfig|--no-oldconfig) + CMD_OLDCONFIG=`parse_optbool "$*"` + [ "$CMD_OLDCONFIG" = "1" ] && CMD_CLEAN=0 print_info 2 "CMD_CLEAN: ${CMD_CLEAN}" print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}" ;; @@ -361,8 +367,8 @@ parse_cmdline() { echo print_warning 1 "Please use --splash, as --gensplash is deprecated." ;; - --gensplash) - CMD_SPLASH=1 + --gensplash|--no-gensplash) + CMD_SPLASH=`parse_optbool "$*"` SPLASH_THEME='default' print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" echo @@ -374,15 +380,11 @@ parse_cmdline() { print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" print_info 2 "SPLASH_THEME: ${SPLASH_THEME}" ;; - --splash) - CMD_SPLASH=1 + --splash|--no-splash) + CMD_SPLASH=`parse_optbool "$*"` SPLASH_THEME='default' print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" ;; - --no-splash) - CMD_SPLASH=0 - print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" - ;; --gensplash-res=*) SPLASH_RES=`parse_opt "$*"` print_info 2 "SPLASH_RES: ${SPLASH_RES}" @@ -393,28 +395,24 @@ parse_cmdline() { SPLASH_RES=`parse_opt "$*"` print_info 2 "SPLASH_RES: ${SPLASH_RES}" ;; - --install) - CMD_NOINSTALL=0 - print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}" - ;; - --no-install) - CMD_NOINSTALL=1 - print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}" + --install|--no-install) + CMD_INSTALL=`parse_optbool "$*"` + print_info 2 "CMD_INSTALL: ${CMD_INSTALL}" ;; - --no-ramdisk-modules) - CMD_NORAMDISKMODULES=1 - print_info 2 "CMD_NORAMDISKMODULES: ${CMD_NORAMDISKMODULES}" + --ramdisk-modules|--no-ramdisk-modules) + CMD_RAMDISKMODULES=`parse_optbool "$*"` + print_info 2 "CMD_RAMDISKMODULES: ${CMD_RAMDISKMODULES}" ;; - --all-ramdisk-modules) - CMD_ALLRAMDISKMODULES=1 + --all-ramdisk-modules|--no-all-ramdisk-modules) + CMD_ALLRAMDISKMODULES=`parse_optbool "$*"` print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}" ;; --callback=*) CMD_CALLBACK=`parse_opt "$*"` print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*" ;; - --static) - CMD_STATIC=1 + --static|--no-static) + CMD_STATIC=`parse_optbool "$*"` print_info 2 "CMD_STATIC: ${CMD_STATIC}" ;; --tempdir=*) @@ -423,21 +421,16 @@ parse_cmdline() { print_info 2 "TMPDIR: ${TMPDIR}" print_info 2 "TEMP: ${TEMP}" ;; - --postclear) - CMD_POSTCLEAR=1 + --postclear|--no-postclear) + CMD_POSTCLEAR=`parse_optbool "$*"` print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}" ;; --arch-override=*) CMD_ARCHOVERRIDE=`parse_opt "$*"` print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}" ;; - --color) - USECOLOR=1 - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; - --no-color) - USECOLOR=0 + --color|--no-color) + USECOLOR=`parse_optbool "$*"` print_info 2 "USECOLOR: ${USECOLOR}" setColorVars ;; @@ -479,17 +472,13 @@ parse_cmdline() { CMD_KERNNAME=`parse_opt "$*"` print_info 2 "KERNNAME: ${CMD_KERNNAME}" ;; - --symlink) - CMD_SYMLINK=1 + --symlink|--no-symlink) + CMD_SYMLINK=`parse_optbool "$*"` print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}" ;; - --no-symlink) - CMD_SYMLINK=0 - print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}" - ;; - --no-kernel-sources) - CMD_NO_KERNEL_SOURCES=1 - print_info 2 "CMD_NO_KERNEL_SOURCES: ${CMD_NO_KERNEL_SOURCES}" + --kernel-sources|--no-kernel-sources) + CMD_KERNEL_SOURCES=`parse_optbool "$*"` + print_info 2 "CMD_KERNEL_SOURCES: ${CMD_KERNEL_SOURCES}" ;; --initramfs-overlay=*) CMD_INITRAMFS_OVERLAY=`parse_opt "$*"` @@ -510,20 +499,20 @@ parse_cmdline() { # ENABLE_PEGASOS_HACKS="yes" # print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}" ;; - --disklabel) - CMD_DISKLABEL=1 + --disklabel|--no-disklabel) + CMD_DISKLABEL=`parse_optbool "$*"` print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}" ;; - --luks) - CMD_LUKS=1 + --luks|--no-luks) + CMD_LUKS=`parse_optbool "$*"` print_info 2 "CMD_LUKS: ${CMD_LUKS}" ;; - --gpg) - CMD_GPG=1 + --gpg|--no-gpg) + CMD_GPG=`parse_optbool "$*"` print_info 2 "CMD_GPG: ${CMD_GPG}" ;; - --firmware) - CMD_FIRMWARE=1 + --firmware|--no-firmware) + CMD_FIRMWARE=`parse_optbool "$*"` print_info 2 "CMD_FIRMWARE: ${CMD_FIRMWARE}" ;; --firmware-dir=*) @@ -536,8 +525,8 @@ parse_cmdline() { CMD_FIRMWARE=1 print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}" ;; - --integrated-initramfs) - CMD_INTEGRATED_INITRAMFS=1 + --integrated-initramfs|--no-integrated-initramfs) + CMD_INTEGRATED_INITRAMFS=`parse_optbool "$*"` print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}" ;; --config=*) @@ -560,8 +549,8 @@ parse_cmdline() { BUILD_KERNEL=1 BUILD_MODULES=0 BUILD_RAMDISK=1 - CMD_NORAMDISKMODULES=1 - print_info 2 "CMD_NORAMDISKMODULES: ${CMD_NORAMDISKMODULES}" + CMD_RAMDISKMODULES=0 + print_info 2 "CMD_RAMDISKMODULES: ${CMD_RAMDISKMODULES}" ;; --help) longusage diff --git a/gen_compile.sh b/gen_compile.sh index 4f4ed25..d865df8 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -324,7 +324,7 @@ compile_kernel() { gen_die "Cannot locate kernel binary" fi - if ! isTrue "${CMD_NOINSTALL}" + if isTrue "${CMD_INSTALL}" then copy_image_with_preserve "kernel" \ "${tmp_kernel_binary}" \ diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 8244269..b68f048 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -2,7 +2,7 @@ # $Id$ get_KV() { - if [ "${NO_KERNEL_SOURCES}" = '1' -a -e "${KERNCACHE}" ] + if [ "${KERNEL_SOURCES}" = '0' -a -e "${KERNCACHE}" ] then /bin/tar -xj -C ${TEMP} -f ${KERNCACHE} kerncache.config if [ -e ${TEMP}/kerncache.config ] @@ -72,7 +72,7 @@ determine_real_args() { # ------------------ ------------ ------------ set_config_with_override STRING LOGFILE CMD_LOGFILE set_config_with_override STRING KERNEL_DIR CMD_KERNEL_DIR "${DEFAULT_KERNEL_SOURCE}" - set_config_with_override BOOL NO_KERNEL_SOURCES CMD_NO_KERNEL_SOURCES + set_config_with_override BOOL KERNEL_SOURCES CMD_KERNEL_SOURCES set_config_with_override STRING KNAME CMD_KERNNAME "genkernel" set_config_with_override STRING MAKEOPTS CMD_MAKEOPTS "$DEFAULT_MAKEOPTS" @@ -98,7 +98,7 @@ determine_real_args() { set_config_with_override STRING MINKERNPACKAGE CMD_MINKERNPACKAGE set_config_with_override STRING MODULESPACKAGE CMD_MODULESPACKAGE set_config_with_override STRING KERNCACHE CMD_KERNCACHE - set_config_with_override BOOL NORAMDISKMODULES CMD_NORAMDISKMODULES + set_config_with_override BOOL RAMDISKMODULES CMD_RAMDISKMODULES set_config_with_override BOOL ALLRAMDISKMODULES CMD_ALLRAMDISKMODULES set_config_with_override STRING INITRAMFS_OVERLAY CMD_INITRAMFS_OVERLAY set_config_with_override BOOL MOUNTBOOT CMD_MOUNTBOOT @@ -128,6 +128,7 @@ determine_real_args() { set_config_with_override BOOL KEYMAP CMD_KEYMAP "yes" set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG + set_config_with_override BOOL INSTALL CMD_INSTALL BOOTDIR=`arch_replace "${BOOTDIR}"` BOOTDIR=${BOOTDIR%/} # Remove any trailing slash @@ -167,7 +168,7 @@ determine_real_args() { fi fi - if [ "${NO_KERNEL_SOURCES}" != "1" ] + if [ "${KERNEL_SOURCES}" != "0" ] then if [ ! -d ${KERNEL_DIR} ] then @@ -177,11 +178,11 @@ determine_real_args() { if [ -z "${KERNCACHE}" ] then - if [ "${KERNEL_DIR}" = '' -a "${NO_KERNEL_SOURCES}" != "1" ] + if [ "${KERNEL_DIR}" = '' -a "${KERNEL_SOURCES}" != "0" ] then gen_die 'No kernel source directory!' fi - if [ ! -e "${KERNEL_DIR}" -a "${NO_KERNEL_SOURCES}" != "1" ] + if [ ! -e "${KERNEL_DIR}" -a "${KERNEL_SOURCES}" != "0" ] then gen_die 'No kernel source directory!' fi diff --git a/gen_funcs.sh b/gen_funcs.sh index 13e57c7..3beabd7 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -257,7 +257,7 @@ fi clear_tmpdir() { -if ! isTrue ${CMD_NOINSTALL} +if isTrue ${CMD_INSTALL} then TMPDIR_CONTENTS=`ls ${TMPDIR}` print_info 1 "Removing tmp dir contents" diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 41c07a6..c644694 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -641,7 +641,7 @@ create_initramfs() { append_data 'multipath' "${MULTIPATH}" append_data 'gpg' "${GPG}" - if [ "${NORAMDISKMODULES}" = '0' ] + if [ "${RAMDISKMODULES}" = '1' ] then append_data 'modules' else @@ -677,7 +677,7 @@ create_initramfs() { echo -e "CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" >> ${KERNEL_DIR}/.config fi - if ! isTrue "${CMD_NOINSTALL}" + if isTrue "${CMD_INSTALL}" then if ! isTrue "${INTEGRATED_INITRAMFS}" then diff --git a/genkernel b/genkernel index 5cf33c5..0122b0a 100755 --- a/genkernel +++ b/genkernel @@ -131,7 +131,7 @@ dump_debugcache NORMAL=${BOLD} print_info 1 "Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..." # Check BOOTDIR is mounted -if isTrue ${CMD_NOINSTALL} +if ! isTrue ${CMD_INSTALL} then isTrue ${MOUNTBOOT} && print_info 2 'Skipping automatic mount of boot' else @@ -230,7 +230,7 @@ then fi fi -if ! isTrue "${CMD_NOINSTALL}" +if isTrue "${CMD_INSTALL}" then if [ "${KERNCACHE}" != "" -a "${KERNCACHE_IS_VALID}" != "0" ] then @@ -313,7 +313,7 @@ fi if [ "${BUILD_KERNEL}" = '1' ] then - if ! isTrue "${CMD_NOINSTALL}" + if isTrue "${CMD_INSTALL}" then set_bootloader fi diff --git a/genkernel.conf b/genkernel.conf index 24fcd54..8628267 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -258,7 +258,7 @@ GPG_BINCACHE="%%CACHE%%/gnupg-${GPG_VER}-%%ARCH%%.bz2" # This option is only valid if kerncache is # defined. If there is a valid kerncache no checks # will be made against a kernel source tree -#NO_KERNEL_SOURCES="1" +#KERNEL_SOURCES="0" # Build a static (monolithic kernel) @@ -289,7 +289,7 @@ GPG_BINCACHE="%%CACHE%%/gnupg-${GPG_VER}-%%ARCH%%.bz2" # Don't copy any modules to the ramdisk -#NORAMDISKMODULES="1" +#RAMDISKMODULES="0" # File to output a .tar.bz2'd kernel and ramdisk: