Skip to content
Snippets Groups Projects
Commit a47706aa authored by Canek Peláez Valdés's avatar Canek Peláez Valdés :slight_smile:
Browse files

Allow to override the config file.

parent 303d8522
Branches
No related tags found
No related merge requests found
...@@ -23,8 +23,17 @@ ...@@ -23,8 +23,17 @@
# Pretty messages # Pretty messages
. /etc/init.d/functions.sh . /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 # Set the terminal title
function termtitle() { function termtitle() {
...@@ -44,8 +53,21 @@ function kinfo() { ...@@ -44,8 +53,21 @@ function kinfo() {
einfo "${1}" einfo "${1}"
} }
# Log file # Set configuration
LOGFILE=/var/log/kerninst.log 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 # Delete old log file
/bin/rm -f "${LOGFILE}" /bin/rm -f "${LOGFILE}"
......
# Log file
LOGFILE="/var/log/kerninst.log"
# The file with the kernel configuration. This file should be in /etc. # The file with the kernel configuration. This file should be in /etc.
KERNEL_CONFIG="/etc/kerninst/kernel-config" KERNEL_CONFIG="/etc/kerninst/kernel-config"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment