Blame SOURCES/0247-Remove-quotes-when-reading-ID-value-from-etc-os-rele.patch

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