Improve option handling.

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.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
cleanup-cruft
Robin H. Johnson 13 years ago
parent daedf62c30
commit a141d71531

@ -5,6 +5,14 @@
# Distributed under the GPL v2 # Distributed under the GPL v2
# $Id$ # $Id$
04 Jan 2012; Robin H. Johnson <robbat2@gentoo.org> 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 <sping@gentoo.org> genkernel: 08 Nov 2011; Sebastian Pipping <sping@gentoo.org> genkernel:
Bump version to 3.4.20 Bump version to 3.4.20

@ -16,7 +16,7 @@ DISKLABEL=0
# genkernel on mips is only used for LiveCDs && netboots. Catalyst # genkernel on mips is only used for LiveCDs && netboots. Catalyst
# will know where to get the kernels at. # 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 # Arch-specific defaults that can be overridden in the config file or on the

@ -95,11 +95,11 @@ KERNEL CONFIGURATION
Saves, or does not save the kernel configuration to '/etc/kernels' Saves, or does not save the kernel configuration to '/etc/kernels'
if the kernel is successfully compiled. if the kernel is successfully compiled.
*--gconfig*:: *--*[*no-*]*gconfig*::
Run "make gconfig" after "make oldconfig". Runs, or does not run "make gconfig" after "make oldconfig".
*--xconfig*:: *--*[*no-*]*xconfig*::
Run "make xconfig" after "make oldconfig". Runs, or does not run "make xconfig" after "make oldconfig".
KERNEL COMPILATION KERNEL COMPILATION
@ -140,19 +140,19 @@ KERNEL COMPILATION
*--*[*no-*]*splash*:: *--*[*no-*]*splash*::
Installs, or not, framebuffer splash support into initramfs. Installs, or not, framebuffer splash support into initramfs.
*--no-ramdisk-modules*:: *--*[*no-*]*ramdisk-modules*::
Don't copy any modules to the ramdisk. Copies or does not copy configured modules to the ramdisk.
*--all-ramdisk-modules*:: *--*[*no-*]*all-ramdisk-modules*::
Copy all kernel modules to the initrd. Copies or does not copy all kernel modules to the initrd.
*--callback*=<...>:: *--callback*=<...>::
Run the specified arguments in the current environment after the Run the specified arguments in the current environment after the
kernel and modules have been compiled. kernel and modules have been compiled.
*--static*:: *--*[*no-*]*static*::
This builds a monolithic kernel without any modules on any Builds, or does not build a monolithic kernel without any modules on any
initial ramdisks. initial ramdisks.
KERNEL LOCATIONS KERNEL LOCATIONS
@ -241,16 +241,15 @@ INITIALIZATION
*--do-keymap-auto*:: *--do-keymap-auto*::
Force keymap selection at boot. Force keymap selection at boot.
*--no-keymap*:: *--*[*no-*]*keymap*::
Disables keymap selection at boot. Enables or disables keymap selection at boot.
*--lvm*:: *--*[*no-*]*lvm*::
Add in LVM support from static binaries if they exist on the 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 system, or compile static LVM binaries if static ones do not exist.
exist.
*--mdadm*:: *--*[*no-*]*mdadm*::
Include mdadm/mdmon support. Includes or excludes mdadm/mdmon support.
Without sys-fs/mdadm[static] installed, this will compile mdadm for you. Without sys-fs/mdadm[static] installed, this will compile mdadm for you.
*--mdadm-config*=<file>:: *--mdadm-config*=<file>::
@ -258,14 +257,14 @@ INITIALIZATION
By default the ramdisk will be built *without* an mdadm.conf and By default the ramdisk will be built *without* an mdadm.conf and
will auto-detect arrays during boot-up. will auto-detect arrays during boot-up.
*--dmraid*:: *--*[*no-*]*dmraid*::
Include DMRAID support. Includes or excludes DMRAID support.
*--multipath*:: *--*[*no-*]*multipath*::
Include Multipath support Includes or excludes Multipath support
*--iscsi*:: *--*[*no-*]*iscsi*::
Include iSCSI support Includes or excludes iSCSI support
*--bootloader*=*grub*:: *--bootloader*=*grub*::
Add new kernel to GRUB configuration. Add new kernel to GRUB configuration.
@ -279,27 +278,27 @@ INITIALIZATION
*--genzimage*:: *--genzimage*::
Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'. Make and install kernelz image from 'arch/powerpc/boot/zImage.initrd'.
*--disklabel*:: *--*[*no-*]*disklabel*::
Include disk label and uuid support in your initrd. Includes or excludes disk label and uuid support in your initrd.
*--luks*:: *--*[*no-*]*luks*::
Add in Luks support from static binaries if they exist on the Includes or excludes Luks support from static binaries if they exist on
system. the system.
*--gpg*:: *--*[*no-*]*gpg*::
Add support for GnuPG 1.x, the portable standalone branch of GnuPG. Includes or excludes support for GnuPG 1.x, the portable standalone branch
A key can be made from of GnuPG. A key can be made from
`gpg --symmetric -o /path/to/LUKS-key.gpg /path/to/LUKS-key` . `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. After that, re-point the *root_key* argument to the new .gpg file.
*--no-busybox*:: *--*[*no-*]*busybox*::
Do not include busybox in the initrd or initramfs. Includes or excludes busybox in the initrd or initramfs.
*--unionfs*:: *--*[*no-*]*unionfs*::
Include support for unionfs Includes or excludes support for unionfs
*--netboot*:: *--*[*no-*]*netboot*::
Create a self-contained env in the initramfs Creates or does not create a self-contained env in the initramfs
*--real-root*=<foo>:: *--real-root*=<foo>::
Specify a default for *real_root*= kernel option. Specify a default for *real_root*= kernel option.
@ -317,8 +316,8 @@ INTERNALS
*--tempdir*=<dir>:: *--tempdir*=<dir>::
Sets genkernel's temporary working directory to <dir>. Sets genkernel's temporary working directory to <dir>.
*--postclear*:: *--*[*no-*]*postclear*::
Clear all tmp files and caches after genkernel has run. Clears or skips clearing all tmp files and caches after genkernel has run.
OUTPUT SETTINGS OUTPUT SETTINGS
@ -339,7 +338,7 @@ OUTPUT SETTINGS
and the kernel config. NOTE: This is created before the callbacks and the kernel config. NOTE: This is created before the callbacks
are run. are run.
*--no-kernel-sources*=<tbz2>:: *--*[*no-*]*kernel-sources*::
This option is only valid if kerncache is defined If there is a This option is only valid if kerncache is defined If there is a
valid kerncache no checks will be made against a kernel source valid kerncache no checks will be made against a kernel source
tree. tree.
@ -348,8 +347,8 @@ OUTPUT SETTINGS
Directory structure to include in the initramfs, only available Directory structure to include in the initramfs, only available
on >=2.6 kernels on >=2.6 kernels
*--firmware*:: *--*[*no-*]*firmware*::
Enable copying of firmware into initramfs. Enable or disables copying of firmware into initramfs.
*--firmware-dir*=<dir>:: *--firmware-dir*=<dir>::
Specify directory to copy firmware from (defaults to '/lib/firmware'). 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*. Specifies specific firmware files to copy. This overrides *--firmware-dir*.
For multiple files, separate the filenames with a comma. For multiple files, separate the filenames with a comma.
*--integrated-initramfs*:: *--*[*no-*]*integrated-initramfs*::
Build the generated initramfs into the kernel instead of keeping it as a separate file. Builds or does not build the generated initramfs into the kernel instead
of keeping it as a separate file.
RAMDISK OPTIONS RAMDISK OPTIONS
@ -573,6 +573,8 @@ AUTHORS
------- -------
- Tim Yamin <plasmaroo@gentoo.org> - Tim Yamin <plasmaroo@gentoo.org>
- Eric Edgar <rocket@gentoo.org> - Eric Edgar <rocket@gentoo.org>
- Chris Gianelloni <wolf31o2@gentoo.org>
- Sebastian Pipping <sebastian@pipping.org>
- NFS Support by Thomas Seiler <thseiler@gmail.com> - NFS Support by Thomas Seiler <thseiler@gmail.com>
- GnuPG 1.x integration by dacook <schism@subverted.org> - GnuPG 1.x integration by dacook <schism@subverted.org>
- MDADM integration by Matthias Dahl <ua_bugz_gentoo@mortal-soul.de> - MDADM integration by Matthias Dahl <ua_bugz_gentoo@mortal-soul.de>

@ -25,27 +25,31 @@ longusage() {
echo " Kernel Configuration settings" echo " Kernel Configuration settings"
echo " --menuconfig Run menuconfig after oldconfig" echo " --menuconfig Run menuconfig after oldconfig"
echo " --no-menuconfig Do not run menuconfig after oldconfig" echo " --no-menuconfig Do not run menuconfig after oldconfig"
echo " --gconfig Run gconfig after oldconfig" echo " --gconfig Run gconfig after oldconfig"
echo " --xconfig Run xconfig 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 " --save-config Save the configuration to /etc/kernels"
echo " --no-save-config Don't save the configuration to /etc/kernels" echo " --no-save-config Don't save the configuration to /etc/kernels"
echo " Kernel Compile settings" echo " Kernel Compile settings"
echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'"
echo " --clean Run make clean before compilation" 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-clean Do not run make clean before compilation"
echo " --no-mrproper Do not run make mrproper before compilation" echo " --mrproper Run make mrproper before compilation"
echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'" echo " --no-mrproper Do not run make mrproper before compilation"
echo " --splash Install framebuffer splash support into initramfs" echo " --splash Install framebuffer splash support into initramfs"
echo " --no-splash Do not install framebuffer splash" echo " --no-splash Do not install framebuffer splash"
echo " --install Install the kernel after building" echo " --install Install the kernel after building"
echo " --no-install Do not 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 " --symlink Manage symlinks in /boot for installed images"
echo " --no-symlink Do not manage symlinks" 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 " --no-ramdisk-modules Don't copy any modules to the ramdisk"
echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk" echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk"
echo " --callback=<...> Run the specified arguments after the" echo " --callback=<...> Run the specified arguments after the"
echo " kernel and modules have been compiled" echo " kernel and modules have been compiled"
echo " --static Build a static (monolithic kernel)." echo " --static Build a static (monolithic kernel)."
echo " --no-static Do not build a static (monolithic kernel)."
echo " Kernel settings" echo " Kernel settings"
echo " --kerneldir=<dir> Location of the kernel sources" echo " --kerneldir=<dir> Location of the kernel sources"
echo " --kernel-config=<file> Kernel configuration file to use for compilation" echo " --kernel-config=<file> Kernel configuration file to use for compilation"
@ -77,31 +81,43 @@ longusage() {
echo " --splash=<theme> Enable framebuffer splash using <theme>" echo " --splash=<theme> Enable framebuffer splash using <theme>"
echo " --splash-res=<res> Select splash theme resolutions to install" echo " --splash-res=<res> Select splash theme resolutions to install"
echo " --do-keymap-auto Forces keymap selection at boot" echo " --do-keymap-auto Forces keymap selection at boot"
echo " --keymap Enables keymap selection support"
echo " --no-keymap Disables keymap selection support" echo " --no-keymap Disables keymap selection support"
echo " --lvm Include LVM support" echo " --lvm Include LVM support"
echo " --no-lvm Exclude LVM support"
echo " --mdadm Include MDADM/MDMON support" echo " --mdadm Include MDADM/MDMON support"
echo " --no-mdadm Exclude MDADM/MDMON support"
echo " --mdadm-config=<file> Use file as mdadm.conf in initramfs" echo " --mdadm-config=<file> Use file as mdadm.conf in initramfs"
echo " --dmraid Include DMRAID support" echo " --dmraid Include DMRAID support"
echo " --no-dmraid Exclude DMRAID support"
echo " --multipath Include Multipath support" echo " --multipath Include Multipath support"
echo " --no-multipath Exclude Multipath support"
echo " --iscsi Include iSCSI support" echo " --iscsi Include iSCSI support"
echo " --no-iscsi Exclude iSCSI support"
echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --bootloader=grub Add new kernel to GRUB configuration"
echo " --linuxrc=<file> Specifies a user created linuxrc" echo " --linuxrc=<file> Specifies a user created linuxrc"
echo " --busybox-config=<file> Specifies a user created busybox config" echo " --busybox-config=<file> Specifies a user created busybox config"
echo " --genzimage Make and install kernelz image (PowerPC)" echo " --genzimage Make and install kernelz image (PowerPC)"
echo " --disklabel Include disk label and uuid support in your" echo " --disklabel Include disk label and uuid support in your ramdisk"
echo " ramdisk" echo " --no-disklabel Exclude disk label and uuid support in your ramdisk"
echo " --luks Include LUKS support" echo " --luks Include LUKS support"
echo " --> 'emerge cryptsetup-luks' with USE=-dynamic" echo " --> 'emerge cryptsetup-luks' with USE=-dynamic"
echo " --no-luks Exclude LUKS support"
echo " --gpg Include GPG-armored LUKS key 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 " --unionfs Include support for unionfs"
echo " --no-unionfs Exclude support for unionfs"
echo " --netboot Create a self-contained env in the initramfs" echo " --netboot Create a self-contained env in the initramfs"
echo " --no-netboot Exclude --netboot env"
echo " --real-root=<foo> Specify a default for real_root=" echo " --real-root=<foo> Specify a default for real_root="
echo " Internals" echo " Internals"
echo " --arch-override=<arch> Force to arch instead of autodetect" echo " --arch-override=<arch> Force to arch instead of autodetect"
echo " --cachedir=<dir> Override the default cache location" echo " --cachedir=<dir> Override the default cache location"
echo " --tempdir=<dir> Location of Genkernel's temporary directory" echo " --tempdir=<dir> 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 " Output Settings"
echo " --kernname=<...> Tag the kernel and ramdisk with a name:" echo " --kernname=<...> Tag the kernel and ramdisk with a name:"
echo " If not defined the option defaults to" echo " If not defined the option defaults to"
@ -130,9 +146,9 @@ longusage() {
echo " Specifies specific firmware files to copy. This" echo " Specifies specific firmware files to copy. This"
echo " overrides --firmware-dir. For multiple files," echo " overrides --firmware-dir. For multiple files,"
echo " separate the filenames with a comma" echo " separate the filenames with a comma"
echo " --integrated-initramfs" echo " --integrated-initramfs, --no-integrated-initramfs"
echo " Build the generated initramfs into the kernel instead of" echo " Include/exclude the generated initramfs in the kernel"
echo " keeping it as a separate file" echo " instead of keeping it as a separate file"
} }
usage() { usage() {
@ -151,6 +167,12 @@ usage() {
echo ' genkernel --help' echo ' genkernel --help'
} }
parse_optbool() {
local opt=${1/--no-*/0} # false
opt=${opt/--*/1} # true
echo $opt
}
parse_cmdline() { parse_cmdline() {
case "$*" in case "$*" in
--kernel-cc=*) --kernel-cc=*)
@ -211,12 +233,8 @@ parse_cmdline() {
CMD_MAKEOPTS=`parse_opt "$*"` CMD_MAKEOPTS=`parse_opt "$*"`
print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}" print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"
;; ;;
--mountboot) --mountboot|--no-mountboot)
CMD_MOUNTBOOT=1 CMD_MOUNTBOOT=`parse_optbool "$*"`
print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
;;
--no-mountboot)
CMD_MOUNTBOOT=0
print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}" print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
;; ;;
--bootdir=*) --bootdir=*)
@ -228,70 +246,70 @@ parse_cmdline() {
CMD_KEYMAP=1 CMD_KEYMAP=1
print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}" print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}"
;; ;;
--no-keymap) --keymap|--no-keymap)
CMD_KEYMAP=0 CMD_KEYMAP=`parse_optbool "$*"`
print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}"
;; ;;
--lvm) --lvm|--no-lvm)
CMD_LVM=1 CMD_LVM=`parse_optbool "$*"`
print_info 2 "CMD_LVM: ${CMD_LVM}" print_info 2 "CMD_LVM: ${CMD_LVM}"
;; ;;
--lvm2) --lvm2|--no-lvm2)
CMD_LVM=1 CMD_LVM=`parse_optbool "$*"`
print_info 2 "CMD_LVM: ${CMD_LVM}" print_info 2 "CMD_LVM: ${CMD_LVM}"
echo echo
print_warning 1 "Please use --lvm, as --lvm2 is deprecated." print_warning 1 "Please use --lvm, as --lvm2 is deprecated."
;; ;;
--mdadm) --mdadm|--no-mdadm)
CMD_MDADM=1 CMD_MDADM=`parse_optbool "$*"`
print_info 2 "CMD_MDADM: $CMD_MDADM" print_info 2 "CMD_MDADM: $CMD_MDADM"
;; ;;
--mdadm-config=*) --mdadm-config=*)
CMD_MDADM_CONFIG=`parse_opt "$*"` CMD_MDADM_CONFIG=`parse_opt "$*"`
print_info 2 "CMD_MDADM_CONFIG: $CMD_MDADM_CONFIG" print_info 2 "CMD_MDADM_CONFIG: $CMD_MDADM_CONFIG"
;; ;;
--no-busybox) --busybox|--no-busybox)
CMD_BUSYBOX=0 CMD_BUSYBOX=`parse_optbool "$*"`
print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}" print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
;; ;;
--unionfs) --unionfs|--no-unionfs)
CMD_UNIONFS=1 CMD_UNIONFS=`parse_optbool "$*"`
print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}" print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
;; ;;
--netboot) --netboot|--no-netboot)
CMD_NETBOOT=1 CMD_NETBOOT=`parse_optbool "$*"`
print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}" print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}"
;; ;;
--real-root=*) --real-root=*)
CMD_REAL_ROOT=`parse_opt "$*"` CMD_REAL_ROOT=`parse_opt "$*"`
print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}" print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}"
;; ;;
--dmraid) --dmraid|--no-dmraid)
if [ ! -e /usr/include/libdevmapper.h ] CMD_DMRAID=`parse_optbool "$*"`
if [ "$CMD_DMRAID" = "1" -a ! -e /usr/include/libdevmapper.h ]
then then
echo 'Error: --dmraid requires device-mapper to be installed' echo 'Error: --dmraid requires device-mapper to be installed'
echo ' on the host system; try "emerge device-mapper".' echo ' on the host system; try "emerge device-mapper".'
exit 1 exit 1
fi fi
CMD_DMRAID=1
print_info 2 "CMD_DMRAID: ${CMD_DMRAID}" print_info 2 "CMD_DMRAID: ${CMD_DMRAID}"
;; ;;
--multipath) --multipath|--no-multipath)
if [ ! -e /usr/include/libdevmapper.h ] CMD_MULTIPATH=`parse_optbool "$*"`
if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ]
then then
echo 'Error: --multipath requires device-mapper to be installed' echo 'Error: --multipath requires device-mapper to be installed'
echo ' on the host;system; try "emerge device-mapper".' echo ' on the host;system; try "emerge device-mapper".'
exit 1 exit 1
fi fi
CMD_MULTIPATH=1
print_info 2 "CMD_MULTIPATH: ${CMD_MULTIPATH}" print_info 2 "CMD_MULTIPATH: ${CMD_MULTIPATH}"
;; ;;
--bootloader=*) --bootloader=*)
CMD_BOOTLOADER=`parse_opt "$*"` CMD_BOOTLOADER=`parse_opt "$*"`
print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}" print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
;; ;;
--iscsi) --iscsi|--no-iscsi)
CMD_ISCSI=1 CMD_ISCSI=`parse_optbool "$*"`
print_info 2 "CMD_ISCSI: ${CMD_ISCSI}" print_info 2 "CMD_ISCSI: ${CMD_ISCSI}"
;; ;;
--loglevel=*) --loglevel=*)
@ -315,41 +333,29 @@ parse_cmdline() {
CMD_MENUCONFIG=0 CMD_MENUCONFIG=0
print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}" print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
;; ;;
--gconfig) --gconfig|--no-gconfig)
CMD_GCONFIG=1 CMD_GCONFIG=`parse_optbool "$*"`
print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}" print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}"
;; ;;
--xconfig) --xconfig|--no-xconfig)
CMD_XCONFIG=1 CMD_XCONFIG=`parse_optbool "$*"`
print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}" print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}"
;; ;;
--save-config) --save-config|--no-save-config)
CMD_SAVE_CONFIG=1 CMD_SAVE_CONFIG=`parse_optbool "$*"`
print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
;;
--no-save-config)
CMD_SAVE_CONFIG=0
print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}" print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
;; ;;
--mrproper) --mrproper|--no-mrproper)
CMD_MRPROPER=1 CMD_MRPROPER=`parse_optbool "$*"`
print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}" print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
;; ;;
--no-mrproper) --clean|--no-clean)
CMD_MRPROPER=0 CMD_CLEAN=`parse_optbool "$*"`
print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
;;
--clean)
CMD_CLEAN=1
print_info 2 "CMD_CLEAN: ${CMD_CLEAN}" print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
;; ;;
--no-clean) --oldconfig|--no-oldconfig)
CMD_CLEAN=0 CMD_OLDCONFIG=`parse_optbool "$*"`
print_info 2 "CMD_CLEAN: ${CMD_CLEAN}" [ "$CMD_OLDCONFIG" = "1" ] && CMD_CLEAN=0
;;
--oldconfig)
CMD_CLEAN=0
CMD_OLDCONFIG=1
print_info 2 "CMD_CLEAN: ${CMD_CLEAN}" print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}" print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}"
;; ;;
@ -361,8 +367,8 @@ parse_cmdline() {
echo echo
print_warning 1 "Please use --splash, as --gensplash is deprecated." print_warning 1 "Please use --splash, as --gensplash is deprecated."
;; ;;
--gensplash) --gensplash|--no-gensplash)
CMD_SPLASH=1 CMD_SPLASH=`parse_optbool "$*"`
SPLASH_THEME='default' SPLASH_THEME='default'
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
echo echo
@ -374,15 +380,11 @@ parse_cmdline() {
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
print_info 2 "SPLASH_THEME: ${SPLASH_THEME}" print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
;; ;;
--splash) --splash|--no-splash)
CMD_SPLASH=1 CMD_SPLASH=`parse_optbool "$*"`
SPLASH_THEME='default' SPLASH_THEME='default'
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
;; ;;
--no-splash)
CMD_SPLASH=0
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
;;
--gensplash-res=*) --gensplash-res=*)
SPLASH_RES=`parse_opt "$*"` SPLASH_RES=`parse_opt "$*"`
print_info 2 "SPLASH_RES: ${SPLASH_RES}" print_info 2 "SPLASH_RES: ${SPLASH_RES}"
@ -393,28 +395,24 @@ parse_cmdline() {
SPLASH_RES=`parse_opt "$*"` SPLASH_RES=`parse_opt "$*"`
print_info 2 "SPLASH_RES: ${SPLASH_RES}" print_info 2 "SPLASH_RES: ${SPLASH_RES}"
;; ;;
--install) --install|--no-install)
CMD_NOINSTALL=0 CMD_INSTALL=`parse_optbool "$*"`
print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}" print_info 2 "CMD_INSTALL: ${CMD_INSTALL}"
;;
--no-install)
CMD_NOINSTALL=1
print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}"
;; ;;
--no-ramdisk-modules) --ramdisk-modules|--no-ramdisk-modules)
CMD_NORAMDISKMODULES=1 CMD_RAMDISKMODULES=`parse_optbool "$*"`
print_info 2 "CMD_NORAMDISKMODULES: ${CMD_NORAMDISKMODULES}" print_info 2 "CMD_RAMDISKMODULES: ${CMD_RAMDISKMODULES}"
;; ;;
--all-ramdisk-modules) --all-ramdisk-modules|--no-all-ramdisk-modules)
CMD_ALLRAMDISKMODULES=1 CMD_ALLRAMDISKMODULES=`parse_optbool "$*"`
print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}" print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}"
;; ;;
--callback=*) --callback=*)
CMD_CALLBACK=`parse_opt "$*"` CMD_CALLBACK=`parse_opt "$*"`
print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*" print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
;; ;;
--static) --static|--no-static)
CMD_STATIC=1 CMD_STATIC=`parse_optbool "$*"`
print_info 2 "CMD_STATIC: ${CMD_STATIC}" print_info 2 "CMD_STATIC: ${CMD_STATIC}"
;; ;;
--tempdir=*) --tempdir=*)
@ -423,21 +421,16 @@ parse_cmdline() {
print_info 2 "TMPDIR: ${TMPDIR}" print_info 2 "TMPDIR: ${TMPDIR}"
print_info 2 "TEMP: ${TEMP}" print_info 2 "TEMP: ${TEMP}"
;; ;;
--postclear) --postclear|--no-postclear)
CMD_POSTCLEAR=1 CMD_POSTCLEAR=`parse_optbool "$*"`
print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}" print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}"
;; ;;
--arch-override=*) --arch-override=*)
CMD_ARCHOVERRIDE=`parse_opt "$*"` CMD_ARCHOVERRIDE=`parse_opt "$*"`
print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}" print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}"
;; ;;
--color) --color|--no-color)
USECOLOR=1 USECOLOR=`parse_optbool "$*"`
print_info 2 "USECOLOR: ${USECOLOR}"
setColorVars
;;
--no-color)
USECOLOR=0
print_info 2 "USECOLOR: ${USECOLOR}" print_info 2 "USECOLOR: ${USECOLOR}"
setColorVars setColorVars
;; ;;
@ -479,17 +472,13 @@ parse_cmdline() {
CMD_KERNNAME=`parse_opt "$*"` CMD_KERNNAME=`parse_opt "$*"`
print_info 2 "KERNNAME: ${CMD_KERNNAME}" print_info 2 "KERNNAME: ${CMD_KERNNAME}"
;; ;;
--symlink) --symlink|--no-symlink)
CMD_SYMLINK=1 CMD_SYMLINK=`parse_optbool "$*"`
print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}" print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
;; ;;
--no-symlink) --kernel-sources|--no-kernel-sources)
CMD_SYMLINK=0 CMD_KERNEL_SOURCES=`parse_optbool "$*"`
print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}" print_info 2 "CMD_KERNEL_SOURCES: ${CMD_KERNEL_SOURCES}"
;;
--no-kernel-sources)
CMD_NO_KERNEL_SOURCES=1
print_info 2 "CMD_NO_KERNEL_SOURCES: ${CMD_NO_KERNEL_SOURCES}"
;; ;;
--initramfs-overlay=*) --initramfs-overlay=*)
CMD_INITRAMFS_OVERLAY=`parse_opt "$*"` CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
@ -510,20 +499,20 @@ parse_cmdline() {
# ENABLE_PEGASOS_HACKS="yes" # ENABLE_PEGASOS_HACKS="yes"
# print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}" # print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
;; ;;
--disklabel) --disklabel|--no-disklabel)
CMD_DISKLABEL=1 CMD_DISKLABEL=`parse_optbool "$*"`
print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}" print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}"
;; ;;
--luks) --luks|--no-luks)
CMD_LUKS=1 CMD_LUKS=`parse_optbool "$*"`
print_info 2 "CMD_LUKS: ${CMD_LUKS}" print_info 2 "CMD_LUKS: ${CMD_LUKS}"
;; ;;
--gpg) --gpg|--no-gpg)
CMD_GPG=1 CMD_GPG=`parse_optbool "$*"`
print_info 2 "CMD_GPG: ${CMD_GPG}" print_info 2 "CMD_GPG: ${CMD_GPG}"
;; ;;
--firmware) --firmware|--no-firmware)
CMD_FIRMWARE=1 CMD_FIRMWARE=`parse_optbool "$*"`
print_info 2 "CMD_FIRMWARE: ${CMD_FIRMWARE}" print_info 2 "CMD_FIRMWARE: ${CMD_FIRMWARE}"
;; ;;
--firmware-dir=*) --firmware-dir=*)
@ -536,8 +525,8 @@ parse_cmdline() {
CMD_FIRMWARE=1 CMD_FIRMWARE=1
print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}" print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}"
;; ;;
--integrated-initramfs) --integrated-initramfs|--no-integrated-initramfs)
CMD_INTEGRATED_INITRAMFS=1 CMD_INTEGRATED_INITRAMFS=`parse_optbool "$*"`
print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}" print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}"
;; ;;
--config=*) --config=*)
@ -560,8 +549,8 @@ parse_cmdline() {
BUILD_KERNEL=1 BUILD_KERNEL=1
BUILD_MODULES=0 BUILD_MODULES=0
BUILD_RAMDISK=1 BUILD_RAMDISK=1
CMD_NORAMDISKMODULES=1 CMD_RAMDISKMODULES=0
print_info 2 "CMD_NORAMDISKMODULES: ${CMD_NORAMDISKMODULES}" print_info 2 "CMD_RAMDISKMODULES: ${CMD_RAMDISKMODULES}"
;; ;;
--help) --help)
longusage longusage

@ -324,7 +324,7 @@ compile_kernel() {
gen_die "Cannot locate kernel binary" gen_die "Cannot locate kernel binary"
fi fi
if ! isTrue "${CMD_NOINSTALL}" if isTrue "${CMD_INSTALL}"
then then
copy_image_with_preserve "kernel" \ copy_image_with_preserve "kernel" \
"${tmp_kernel_binary}" \ "${tmp_kernel_binary}" \

@ -2,7 +2,7 @@
# $Id$ # $Id$
get_KV() { get_KV() {
if [ "${NO_KERNEL_SOURCES}" = '1' -a -e "${KERNCACHE}" ] if [ "${KERNEL_SOURCES}" = '0' -a -e "${KERNCACHE}" ]
then then
/bin/tar -xj -C ${TEMP} -f ${KERNCACHE} kerncache.config /bin/tar -xj -C ${TEMP} -f ${KERNCACHE} kerncache.config
if [ -e ${TEMP}/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 LOGFILE CMD_LOGFILE
set_config_with_override STRING KERNEL_DIR CMD_KERNEL_DIR "${DEFAULT_KERNEL_SOURCE}" 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 KNAME CMD_KERNNAME "genkernel"
set_config_with_override STRING MAKEOPTS CMD_MAKEOPTS "$DEFAULT_MAKEOPTS" 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 MINKERNPACKAGE CMD_MINKERNPACKAGE
set_config_with_override STRING MODULESPACKAGE CMD_MODULESPACKAGE set_config_with_override STRING MODULESPACKAGE CMD_MODULESPACKAGE
set_config_with_override STRING KERNCACHE CMD_KERNCACHE 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 BOOL ALLRAMDISKMODULES CMD_ALLRAMDISKMODULES
set_config_with_override STRING INITRAMFS_OVERLAY CMD_INITRAMFS_OVERLAY set_config_with_override STRING INITRAMFS_OVERLAY CMD_INITRAMFS_OVERLAY
set_config_with_override BOOL MOUNTBOOT CMD_MOUNTBOOT 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 KEYMAP CMD_KEYMAP "yes"
set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO
set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG
set_config_with_override BOOL INSTALL CMD_INSTALL
BOOTDIR=`arch_replace "${BOOTDIR}"` BOOTDIR=`arch_replace "${BOOTDIR}"`
BOOTDIR=${BOOTDIR%/} # Remove any trailing slash BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
@ -167,7 +168,7 @@ determine_real_args() {
fi fi
fi fi
if [ "${NO_KERNEL_SOURCES}" != "1" ] if [ "${KERNEL_SOURCES}" != "0" ]
then then
if [ ! -d ${KERNEL_DIR} ] if [ ! -d ${KERNEL_DIR} ]
then then
@ -177,11 +178,11 @@ determine_real_args() {
if [ -z "${KERNCACHE}" ] if [ -z "${KERNCACHE}" ]
then then
if [ "${KERNEL_DIR}" = '' -a "${NO_KERNEL_SOURCES}" != "1" ] if [ "${KERNEL_DIR}" = '' -a "${KERNEL_SOURCES}" != "0" ]
then then
gen_die 'No kernel source directory!' gen_die 'No kernel source directory!'
fi fi
if [ ! -e "${KERNEL_DIR}" -a "${NO_KERNEL_SOURCES}" != "1" ] if [ ! -e "${KERNEL_DIR}" -a "${KERNEL_SOURCES}" != "0" ]
then then
gen_die 'No kernel source directory!' gen_die 'No kernel source directory!'
fi fi

@ -257,7 +257,7 @@ fi
clear_tmpdir() clear_tmpdir()
{ {
if ! isTrue ${CMD_NOINSTALL} if isTrue ${CMD_INSTALL}
then then
TMPDIR_CONTENTS=`ls ${TMPDIR}` TMPDIR_CONTENTS=`ls ${TMPDIR}`
print_info 1 "Removing tmp dir contents" print_info 1 "Removing tmp dir contents"

@ -641,7 +641,7 @@ create_initramfs() {
append_data 'multipath' "${MULTIPATH}" append_data 'multipath' "${MULTIPATH}"
append_data 'gpg' "${GPG}" append_data 'gpg' "${GPG}"
if [ "${NORAMDISKMODULES}" = '0' ] if [ "${RAMDISKMODULES}" = '1' ]
then then
append_data 'modules' append_data 'modules'
else 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 echo -e "CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" >> ${KERNEL_DIR}/.config
fi fi
if ! isTrue "${CMD_NOINSTALL}" if isTrue "${CMD_INSTALL}"
then then
if ! isTrue "${INTEGRATED_INITRAMFS}" if ! isTrue "${INTEGRATED_INITRAMFS}"
then then

@ -131,7 +131,7 @@ dump_debugcache
NORMAL=${BOLD} print_info 1 "Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..." NORMAL=${BOLD} print_info 1 "Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..."
# Check BOOTDIR is mounted # Check BOOTDIR is mounted
if isTrue ${CMD_NOINSTALL} if ! isTrue ${CMD_INSTALL}
then then
isTrue ${MOUNTBOOT} && print_info 2 'Skipping automatic mount of boot' isTrue ${MOUNTBOOT} && print_info 2 'Skipping automatic mount of boot'
else else
@ -230,7 +230,7 @@ then
fi fi
fi fi
if ! isTrue "${CMD_NOINSTALL}" if isTrue "${CMD_INSTALL}"
then then
if [ "${KERNCACHE}" != "" -a "${KERNCACHE_IS_VALID}" != "0" ] if [ "${KERNCACHE}" != "" -a "${KERNCACHE_IS_VALID}" != "0" ]
then then
@ -313,7 +313,7 @@ fi
if [ "${BUILD_KERNEL}" = '1' ] if [ "${BUILD_KERNEL}" = '1' ]
then then
if ! isTrue "${CMD_NOINSTALL}" if isTrue "${CMD_INSTALL}"
then then
set_bootloader set_bootloader
fi fi

@ -258,7 +258,7 @@ GPG_BINCACHE="%%CACHE%%/gnupg-${GPG_VER}-%%ARCH%%.bz2"
# This option is only valid if kerncache is # This option is only valid if kerncache is
# defined. If there is a valid kerncache no checks # defined. If there is a valid kerncache no checks
# will be made against a kernel source tree # will be made against a kernel source tree
#NO_KERNEL_SOURCES="1" #KERNEL_SOURCES="0"
# Build a static (monolithic kernel) # 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 # Don't copy any modules to the ramdisk
#NORAMDISKMODULES="1" #RAMDISKMODULES="0"
# File to output a .tar.bz2'd kernel and ramdisk: # File to output a .tar.bz2'd kernel and ramdisk:

Loading…
Cancel
Save