1f092ca
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
1f092ca
From: Javier Martinez Canillas <javierm@redhat.com>
1f092ca
Date: Wed, 21 Nov 2018 15:37:32 +0100
1f092ca
Subject: [PATCH] Remove quotes when reading ID value from /etc/os-release
1f092ca
1f092ca
The field is used to obtain the path to the GRUB directory in the ESP for
1f092ca
UEFI installs. But in some OS the ID value is quoted, which leads to some
1f092ca
of the scripts to fail:
1f092ca
1f092ca
  $ grub2-setpassword
1f092ca
  /boot/efi/EFI/"redhat"/ does not exist.
1f092ca
  Usage: /usr/sbin/grub2-setpassword [OPTION]
1f092ca
1f092ca
Related: rhbz#1650706
1f092ca
1f092ca
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
1f092ca
---
1f092ca
 util/grub-set-password.in     | 2 +-
1f092ca
 util/grub-switch-to-blscfg.in | 2 +-
1f092ca
 2 files changed, 2 insertions(+), 2 deletions(-)
1f092ca
1f092ca
diff --git a/util/grub-set-password.in b/util/grub-set-password.in
1f092ca
index 5ebf50576d6..c0b5ebbfdc5 100644
1f092ca
--- a/util/grub-set-password.in
1f092ca
+++ b/util/grub-set-password.in
1f092ca
@@ -1,6 +1,6 @@
1f092ca
 #!/bin/sh -e
1f092ca
 
1f092ca
-EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')
1f092ca
+EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
1f092ca
 if [ -d /sys/firmware/efi/efivars/ ]; then
1f092ca
     grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
1f092ca
 else
1f092ca
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
1f092ca
index 60cd6ca63cc..d353370cc51 100644
1f092ca
--- a/util/grub-switch-to-blscfg.in
1f092ca
+++ b/util/grub-switch-to-blscfg.in
1f092ca
@@ -40,7 +40,7 @@ etcdefaultgrub=/etc/default/grub
1f092ca
 
1f092ca
 eval "$("${grub_get_kernel_settings}")" || true
1f092ca
 
1f092ca
-EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')
1f092ca
+EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
1f092ca
 if [ -d /sys/firmware/efi/efivars/ ]; then
1f092ca
     startlink=/etc/grub2-efi.cfg
1f092ca
     grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`