From: Zbigniew Jędrzejewski-Szmek Date: Thu, 19 May 2022 12:50:07 +0000 (+0200) Subject: kernel-install: debug the configuration detection if --verbose X-Git-Tag: v251~3^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4db4c28dc6928e0040db7c273f3017ebc1368760;p=thirdparty%2Fsystemd.git kernel-install: debug the configuration detection if --verbose No changes to behaviour, but let's print everything out as we discover it. The docs say that BOOT_ROOT can be specified by the environment. I have it locally in /etc/kernel/install.conf, and then the override doesn't work. It'd be nice to handle such cases more reliably. --- diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in index 48072e346b1..8ed9bfbb33c 100755 --- a/src/kernel-install/kernel-install.in +++ b/src/kernel-install/kernel-install.in @@ -103,19 +103,44 @@ layout= initrd_generator= if [ -r "/etc/kernel/install.conf" ]; then - . /etc/kernel/install.conf + install_conf="/etc/kernel/install.conf" elif [ -r "/usr/lib/kernel/install.conf" ]; then - . /usr/lib/kernel/install.conf + install_conf="/usr/lib/kernel/install.conf" +else + install_conf= +fi + +if [ -n "$install_conf" ]; then + [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Reading $install_conf…" + . "$install_conf" + # FIXME: This may override configuration in environment variables, e.g. $BOOT_ROOT. fi +[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && [ -n "$layout" ] && \ + echo "$install_conf configures layout=$layout" +[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && [ -n "$initrd_generator" ] && \ + echo "$install_conf configures initrd_generator=$initrd_generator" + +[ -n "$MACHINE_ID" ] && [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ + echo "machine-id $MACHINE_ID set via environment or install.conf" +[ -n "$BOOT_ROOT" ] && [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ + echo "BOOT_ROOT=$BOOT_ROOT set via environment or install.conf" + # If /etc/machine-id is initialized we'll use it, otherwise we'll use a freshly # generated one. If the user configured an explicit machine ID to use in # /etc/machine-info to use for our purpose, we'll use that instead (for # compatibility). -[ -z "$MACHINE_ID" ] && [ -r /etc/machine-info ] && . /etc/machine-info && MACHINE_ID="$KERNEL_INSTALL_MACHINE_ID" -[ -z "$MACHINE_ID" ] && [ -r /etc/machine-id ] && read -r MACHINE_ID