dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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