From f1aafa632f58a5f0506cb66caa9619d110ff1a9b Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Dec 01 2018 01:02:16 +0000 Subject: grubby-bls: always generate the BLS snippets when adding new entries a BLS file is generated at build time and stored in /lib/modules/$kernel but this default BLS file assumes that /boot is a mount point and so the kernel and initrd paths are relative to the root of this boot partition. This is not the case if /boot is not a mount point or if the bootloader is zipl, since zipl expects the absolute path to be in the BLS snippet. The kernel-install scripts takes care of this and modifies the BLS file if needed, but grubby doesn't do that. So instead just generate the BLS always even if there is one for the kernel version of the added entry. Resolves: rhbz#1653365 Signed-off-by: Javier Martinez Canillas --- diff --git a/grubby-bls b/grubby-bls index 1e6a9e5..5f5ca6a 100755 --- a/grubby-bls +++ b/grubby-bls @@ -391,16 +391,12 @@ add_bls_fragment() { fi kernel_dir="/lib/modules/${kernelver}" - if [[ -f "${kernel_dir}/bls.conf" ]]; then - cp -aT "${kernel_dir}/bls.conf" "${bls_target}" || exit $? + if [[ -d $kernel_dir ]]; then + datetime="$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${kernel_dir}")")" else - if [[ -d $kernel_dir ]]; then - datetime="$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${kernel_dir}")")" - else - datetime=0 - fi - mkbls "${kernel}" "${kernelver}" "${datetime}" > "${bls_target}" + datetime=0 fi + mkbls "${kernel}" "${kernelver}" "${datetime}" > "${bls_target}" if [[ -n $title ]]; then set_bls_value "${bls_target}" "title" "${title}"