nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0117-Fix-the-efidir-in-grub-setpassword.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Peter Jones <pjones@redhat.com>
d9d99f
Date: Thu, 15 Mar 2018 14:12:54 -0400
d9d99f
Subject: [PATCH] Fix the efidir in grub-setpassword
d9d99f
d9d99f
Signed-off-by: Peter Jones <pjones@redhat.com>
d9d99f
---
d9d99f
 util/grub-setpassword.in | 3 ++-
d9d99f
 1 file changed, 2 insertions(+), 1 deletion(-)
d9d99f
d9d99f
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
d9d99f
index d7924af5192..cf70257eed6 100644
d9d99f
--- a/util/grub-setpassword.in
d9d99f
+++ b/util/grub-setpassword.in
d9d99f
@@ -1,7 +1,8 @@
d9d99f
 #!/bin/sh -e
d9d99f
 
d9d99f
+EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')
d9d99f
 if [ -d /sys/firmware/efi/efivars/ ]; then
d9d99f
-    grubdir=`echo "/@bootdirname@/efi/EFI/redhat/" | sed 's,//*,/,g'`
d9d99f
+    grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
d9d99f
 else
d9d99f
     grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
d9d99f
 fi