rEFInd 0.14.0 seems to have an issue with refind-install not calling grep correctly:
Notice: Backed up existing icons directory as icons-backup.
Existing refind.conf file found; copying sample file as refind.conf-sample
to avoid overwriting your customizations.
grep: warning: stray \ before E
grep: warning: stray \ before r
grep: warning: stray \ before r
grep: warning: stray \ before E
grep: warning: stray \ before r
grep: warning: stray \ before r
Creating new NVRAM entry
rEFInd is set as the default boot manager.
Existing //boot/refind_linux.conf found; not overwriting.
And a duplicate rEFInd Boot Manager entry gets inserted via efibootmgr.
With the attached patch it works without error again, though I did not check the cause yet.
That bug actually existed in 0.13.3 and forced the release of 0.13.3.1. It recurred because, in both cases, it was caused by my accepting bad advice from the shellcheck shell script analysis tool. I've just released a 0.14.0.2 version to address this problem. I've also added comments to the script to deter me from making the same mistake a third time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
rEFInd 0.14.0 seems to have an issue with refind-install not calling grep correctly:
And a duplicate rEFInd Boot Manager entry gets inserted via efibootmgr.
With the attached patch it works without error again, though I did not check the cause yet.
artist
Last edit: artist 2023-03-06
To quote Homer Simpson, "d'oh!"
That bug actually existed in 0.13.3 and forced the release of 0.13.3.1. It recurred because, in both cases, it was caused by my accepting bad advice from the
shellcheck
shell script analysis tool. I've just released a 0.14.0.2 version to address this problem. I've also added comments to the script to deter me from making the same mistake a third time.Thx for the swift update; 0.14.0.2 works OK indeed.
As for shellcheck; someone once told me "free advice is worth every cent of it" ;-)
Why don't we use 'grep -F' instead?
refind-install | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/refind-install b/refind-install
index 4416178..d32cbe1 100755
--- a/refind-install
+++ b/refind-install
@@ -1304,13 +1304,10 @@ AddBootEntry() {
fi
EntryFilename="$TargetDir/$Refind"
EfiEntryFilename=$(echo "${EntryFilename}" | tr '/' '\')
- # DO NOT change the below to use "$(...)" syntax; despite shellcheck's complaint,
- # such a change will BREAK IT!
- EfiEntryFilename2=
echo "${EfiEntryFilename}" | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g
InstallPartGuid=$(blkid -s PARTUUID -o value "$InstallPart")
FirstBoot=$("$Efibootmgr" | grep BootOrder | cut -c 12-15)
- ExistingEntry=$("$Efibootmgr" -v | grep -i "$EfiEntryFilename2" | grep -i "$InstallPartGuid" | head -n 1)
- ExistingEntryFirstBoot=$("$Efibootmgr" -v | grep -i "$EfiEntryFilename2" | grep -i "$InstallPartGuid" | grep "Boot$FirstBoot")
+ ExistingEntry=$("$Efibootmgr" -v | grep -F -i "$EfiEntryFilename" | grep -i "$InstallPartGuid" | head -n 1)
+ ExistingEntryFirstBoot=$("$Efibootmgr" -v | grep -F -i "$EfiEntryFilename" | grep -i "$InstallPartGuid" | grep "Boot$FirstBoot")
--
2.40.0.rc1.2.gd15644fe02
On 2023-03-07 12:17:13-0000, artist artist-artix@users.sourceforge.net wrote:
Anyway, why don't we use
grep -F
instead. (Like the attached patch).I see we're using 'grep -P', but it's guarded inside Linux OS.
-- Danh