Menu

rEFInd 0.14.0 : refind-install not calling grep correctly

artist
2023-03-06
2023-03-07
  • artist

    artist - 2023-03-06

    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.

    artist

     

    Last edit: artist 2023-03-06
  • Roderick W. Smith

    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.

     
  • artist

    artist - 2023-03-07

    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" ;-)

     
    • sgn

      sgn - 2023-03-07

      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")

         if [[ "$ExistingEntry" ]] ; then
            ExistingEntryBootNum=$(echo "$ExistingEntry" | cut -c 5-8)
      

      --
      2.40.0.rc1.2.gd15644fe02

       
    • sgn

      sgn - 2023-03-07

      On 2023-03-07 12:17:13-0000, artist artist-artix@users.sourceforge.net wrote:

      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" ;-)

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.