nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0212-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch

5593c8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5593c8
From: Javier Martinez Canillas <javierm@redhat.com>
5593c8
Date: Mon, 5 Jul 2021 18:24:22 +0200
5593c8
Subject: [PATCH] grub-set-password: Always use /boot/grub2/user.cfg as
5593c8
 password default
5593c8
5593c8
The GRUB configuration file is always placed in /boot/grub2/ now, even for
5593c8
EFI. But the tool is still creating the user.cfg in the ESP and not there.
5593c8
5593c8
Resolves: rhbz#1955294
5593c8
5593c8
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
5593c8
---
5593c8
 util/grub-set-password.in | 9 +--------
5593c8
 1 file changed, 1 insertion(+), 8 deletions(-)
5593c8
5593c8
diff --git a/util/grub-set-password.in b/util/grub-set-password.in
d3c3ab
index c0b5ebbfdc5..d8005e5a142 100644
5593c8
--- a/util/grub-set-password.in
5593c8
+++ b/util/grub-set-password.in
5593c8
@@ -1,11 +1,6 @@
5593c8
 #!/bin/sh -e
5593c8
 
5593c8
-EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
5593c8
-if [ -d /sys/firmware/efi/efivars/ ]; then
5593c8
-    grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
5593c8
-else
5593c8
-    grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
5593c8
-fi
5593c8
+grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
5593c8
 
5593c8
 PACKAGE_VERSION="@PACKAGE_VERSION@"
5593c8
 PACKAGE_NAME="@PACKAGE_NAME@"
5593c8
@@ -116,8 +111,6 @@ if [ -z "${MYPASS}" ]; then
5593c8
       exit 1
5593c8
 fi
5593c8
 
5593c8
-# on the ESP, these will fail to set the permissions, but it's okay because
5593c8
-# the directory is protected.
5593c8
 install -m 0600 /dev/null "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
5593c8
 chmod 0600 "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
5593c8
 echo "GRUB2_PASSWORD=${MYPASS}" > "${OUTPUT_PATH}/user.cfg"