From 6c94c020205da3445a9e718210cd9a63de90a4e7 Mon Sep 17 00:00:00 2001 From: Konstantin Vlasov Date: Wed, 24 May 2023 19:16:31 +0300 Subject: [PATCH] Fixed grub-switch-to-blscfg Two issues are fixed: 1. mkbls() always puts vmlinuz and initrd in the partition's root, which may not be the case when separate /boot is not used. 2. mkbls() is called twice, and both times incorrectly. It expects 3 arguments, namely: `kernelver`, `datetime`, `kernelopts`. But the first time (for the main entry) it's called with additional `bootprefix` argument inserted between the 2nd and 3rd; and the second time (for the rescue entry) it's called with 3 arguments, but 3rd being `bootprefix` instead of kernel options. --- util/grub-switch-to-blscfg.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in index a851424..9081e4b 100644 --- a/util/grub-switch-to-blscfg.in +++ b/util/grub-switch-to-blscfg.in @@ -190,6 +190,7 @@ fi mkbls() { local kernelver=$1 && shift local datetime=$1 && shift + local bootprefix=$1 && shift local kernelopts=$1 && shift local debugname="" @@ -209,8 +210,8 @@ mkbls() { cat <"${blsdir}/${MACHINE_ID}-0-rescue.conf" + mkbls "0-rescue-${MACHINE_ID}" "0" "${bootprefix}" "${cmdline}" >"${blsdir}/${MACHINE_ID}-0-rescue.conf" fi } -- 2.24.4