From 77dcff8c4b78cf523c10b2a44b4f8eaf6c468a21 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Fri, 23 Jan 2026 11:36:42 +0100 Subject: [PATCH 1/2] Add --custom-config argument as per #14 --- kernel_installer.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/kernel_installer.sh b/kernel_installer.sh index 18dbb89..f52fe4d 100755 --- a/kernel_installer.sh +++ b/kernel_installer.sh @@ -11,7 +11,7 @@ ###################################################################### -VERSION='1.2.5' +VERSION='1.2.6-dev' #------------------------------------------------------------------------------# # @@ -351,6 +351,7 @@ usage() { printf "%s\\n" " ${YELLOW}--dir |-d${NORMAL} install directory" printf "%s\\n" " ${YELLOW}--kexec |-x${NORMAL} load new kernel without reboot" printf "%s\\n" " ${YELLOW}--config |-c${NORMAL} set configuration target" + printf "%s\\n" " ${YELLOW}--custom-config |-cc${NORMAL} set custom configuration directive, can be used multiple times" printf "%s\\n" " ${YELLOW}--verbose |-v${NORMAL} increase verbosity" printf "%s\\n" " ${YELLOW}--get-verified-tarball |-gvt${NORMAL} cryptographically verify kernel tarball" printf "%s\\n" " ${YELLOW}--nproc |-n${NORMAL} set the number of processing units to use" @@ -367,6 +368,7 @@ usage() { } POSITIONAL_ARGS=() +CUSTOM_CONFIG_OPTIONS=() while [[ $# -gt 0 ]]; do case $1 in @@ -413,6 +415,11 @@ while [[ $# -gt 0 ]]; do shift shift ;; + --custom-config | -cc) + CUSTOM_CONFIG_OPTIONS+=("$2") + shift + shift + ;; --kexec | -x) shift KEXEC=1 @@ -467,6 +474,13 @@ set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters chk_kernel +if [ -n "$CUSTOM_CONFIG_OPTIONS" ]; then + SANITIZED_CUSTOM_CONFIG_OPTIONS=() + for custom_config_option in "${CUSTOM_CONFIG_OPTIONS[@]}"; do + SANITIZED_CUSTOM_CONFIG_OPTIONS+=("$(echo "$custom_config_option")") + done +fi + # Start with a clean log if [[ -f $LOGFILE ]]; then rm "$LOGFILE" @@ -1000,6 +1014,10 @@ install_kernel() { scripts/config --enable CONFIG_ZRAM_BACKEND_842 scripts/config --enable CONFIG_ZRAM_BACKEND_LZO fi + for custom_config_option in "${SANITIZED_CUSTOM_CONFIG_OPTIONS[@]}"; do + log_debug "Adding custom config option: \"$custom_config_option\"" + eval "$custom_config_option" + done echo # Compilation log_debug "Phase 5 of 6: Compilation" From d611c8491c4b9ee0879a4a04835d6d800727525c Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Fri, 23 Jan 2026 11:42:36 +0100 Subject: [PATCH 2/2] Document custom configuration usage in README Added documentation for custom configuration directives. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index ebffb60..7b7ed8a 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ If called without arguments, installs stable kernel using /opt/linux --dir |-d install directory --kexec |-x load new kernel without reboot --config |-c set configuration target +--custom-config |-cc set custom configuration directive, can be used multiple times --verbose |-v increase verbosity --get-verified-tarball |-gvt cryptographically verify kernel tarball --nproc |-n set the number of processing units to use @@ -149,6 +150,18 @@ kvmconfig - Enable additional options for guest kernel support tinyconfig - Configure the tiniest possible kernel ``` +### Custom configuration directives + +In order to enable specific kernel configs, one can use `--custom-config` like the following example: +``` +./kernel_installer.sh --custom-config "scripts/config --set-val CONFIG_DM_VDO m" +``` + +Note that `--custom-config can be used multiple times like: +``` +./kernel_installer.sh --custom-config "scripts/config --set-val CONFIG_DM_VDO m" --custom-config "scripts/config --set-val CONFIG_KERNEL_ZSTD y" +``` + To use --get-verified-tarball: ```bash ./kernel_installer.sh --get-verified-tarball