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