diff --git a/kerninst b/kerninst index 5e8ba1046e39ebabecc7857e891d31884446917e..6d82ec272532f0df5c8cf52a502faec32c8fc1b7 100644 --- a/kerninst +++ b/kerninst @@ -23,8 +23,17 @@ # Pretty messages . /etc/init.d/functions.sh -# Configuration -. /etc/kerninst/kerninst.conf + +# Allow overriding of configuration +function getconf() { + V="${1}" + val=$(/bin/grep "^${V}=" "/etc/kerninst/kerninst.conf" | cut -d "=" -f 2) + if [ -z "${!V}" ]; then + echo -n "${val}" + else + echo -n "${!V}" + fi +} # Set the terminal title function termtitle() { @@ -44,8 +53,21 @@ function kinfo() { einfo "${1}" } -# Log file -LOGFILE=/var/log/kerninst.log +# Set configuration +LOGFILE=$(getconf "LOGFILE") +KERNEL_CONFIG=$(getconf "KERNEL_CONFIG") +BOOT_MANAGER=$(getconf "BOOT_MANAGER") +GRUB_CONFIG_FILE=$(getconf "GRUB_CONFIG_FILE") +BOOTCTL_TITLE=$(getconf "BOOTCTL_TITLE") +BOOTCTL_SPLASH=$(getconf "BOOTCTL_SPLASH") +INCLUDE_FIRMWARE=$(getconf "INCLUDE_FIRMWARE") +KERNEL_MAKEOPTS=$(getconf "KERNEL_MAKEOPTS") +KERNEL_COMMAND_LINE=$(getconf "KERNEL_COMMAND_LINE") +MODULES_REBUILD=$(getconf "MODULES_REBUILD") +UPDATE_KERNEL_CONFIG=$(getconf "UPDATE_KERNEL_CONFIG") +INCLUDES=$(getconf "INCLUDES") +MOUNT_BOOT=$(getconf "MOUNT_BOOT") +MOUNT_BOOT_EFI=$(getconf "MOUNT_BOOT_EFI") # Delete old log file /bin/rm -f "${LOGFILE}" diff --git a/kerninst.conf b/kerninst.conf index ddc335a298dff1ec8e07a161193b975bc8ad4fda..e757dc7940c19ec96e52de02778f73320803cd2d 100644 --- a/kerninst.conf +++ b/kerninst.conf @@ -1,3 +1,6 @@ +# Log file +LOGFILE="/var/log/kerninst.log" + # The file with the kernel configuration. This file should be in /etc. KERNEL_CONFIG="/etc/kerninst/kernel-config"