Some kernel config manipulation options already exist in genkernel
(--lvm, --multipath, ...), but this option allows you to override a
given config setting without rolling a new option specific to that
setting:
$ genkernel ... --kconfig=CONFIG_LOGO=n ...
Ordinarily it would be easier (and more robust, with dependency
checking) to use --menuconfig or similar, but for reproducible
catalyst builds its better to specify the overrides explicitly in the
spec file.
echo " --save-config Save the configuration to /etc/kernels"
echo " --no-save-config Don't save the configuration to /etc/kernels"
echo " --virtio Include VirtIO kernel code"
echo " --save-config Save the configuration to /etc/kernels"
echo " --no-save-config Don't save the configuration to /etc/kernels"
echo " --virtio Include VirtIO kernel code"
+ echo " --kconfig=<CONFIG>=<value> Set a specific kernel config option"
echo " Kernel Compile settings"
echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'"
echo " --clean Run make clean before compilation"
echo " Kernel Compile settings"
echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'"
echo " --clean Run make clean before compilation"
CMD_VIRTIO=`parse_optbool "$*"`
print_info 2 "CMD_VIRTIO: ${CMD_VIRTIO}"
;;
CMD_VIRTIO=`parse_optbool "$*"`
print_info 2 "CMD_VIRTIO: ${CMD_VIRTIO}"
;;
+ --kconfig=*)
+ KCONFIG_KEY=$(echo "$*" | cut -d= -f2)
+ KCONFIG_VALUE=$(echo "$*" | cut -d= -f3)
+ KCONFIG["$KCONFIG_KEY"]="$KCONFIG_VALUE"
+ print_info 2 "KCONFIG: ${KCONFIG_KEY}=${KCONFIG_VALUE}"
+ ;;
--multipath|--no-multipath)
CMD_MULTIPATH=`parse_optbool "$*"`
if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ]
--multipath|--no-multipath)
CMD_MULTIPATH=`parse_optbool "$*"`
if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ]
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_NET.*/CONFIG_VIRTIO_NET=y/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VHOST_NET.*/CONFIG_VHOST_NET=y/g'
fi
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VIRTIO_NET.*/CONFIG_VIRTIO_NET=y/g'
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_VHOST_NET.*/CONFIG_VHOST_NET=y/g'
fi
+
+ for KEY in "${!KCONFIG[@]}"; do
+ VALUE="${KCONFIG[$KEY]}"
+ sed -i ${KERNEL_DIR}/.config -e "s/#\? \?$KEY.*/$KEY=$VALUE/g'
+ done
BUILD_KERNEL=0
BUILD_RAMDISK=0
BUILD_MODULES=0
BUILD_KERNEL=0
BUILD_RAMDISK=0
BUILD_MODULES=0
# Parse all command line options...
Options=$* # Save for later
# Parse all command line options...
Options=$* # Save for later