Bug 1292336 - grub2-setpassword references /boot/efi/EFI/redhat/ instead of /boot/efi/EFI/fedora/
grub2-setpassword references /boot/efi/EFI/redhat/ instead of /boot/efi/EFI/f...
Status: NEW
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
26
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: rmarshall
Fedora Extras Quality Assurance
: Reopened
: 1294407 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-17 01:15 EST by Maarten van der Aart
Modified: 2017-12-12 17:15 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-12 06:09:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Maarten van der Aart 2015-12-17 01:15:12 EST
Description of problem:
When using the grub2-setpassword script, it fails (even when a different output directory is requested witch -o). This is because in line 3 the 'grubdir' variable is set to '/boot/efi/EFI/redhat/', which does not exist on fedora systems. Changing it to '/boot/efi/EFI/fedora/' solves the problem.

Version-Release number of selected component (if applicable):
grub2-setpassword (GRUB) 2.02~beta2

from the package grub2-tools:
Name        : grub2-tools
Arch        : x86_64
Epoch       : 1
Version     : 2.02
Release     : 0.25.fc23


How reproducible:
Always

Steps to Reproduce:
[root@clunky ~]# grub2-setpassword 
/boot/efi/EFI/redhat/ does not exist.
Usage: /sbin/grub2-setpassword [OPTION] [SOURCE]
Run GRUB script in a Qemu instance.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  -o, --output_path       choose a custom output path for user.cfg

/sbin/grub2-setpassword prompts the user to set a password on the grub bootloader. The password
is written to a file named user.cfg.

Report bugs at https://bugzilla.redhat.com.

[root@clunky ~]# grub2-setpassword -o="/boot/efi/EFI/fedora/"
Enter password: 
Confirm password: 
/sbin/grub2-setpassword: line 123: /boot/efi/EFI/redhat//user.cfg: No such file or directory

Actual results:
It does not update the grub password.

Expected results:
To update the grub password.

Additional info:
Comment 2 rmarshall 2016-02-22 15:23:55 EST
*** Bug 1294407 has been marked as a duplicate of this bug. ***
Comment 4 Fedora End Of Life 2016-11-24 09:17:39 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Martin Stefany 2017-02-07 18:15:56 EST
This is an easy fix, fix the defaults for Fedora (inc. the slash removal) and fix the logic around line 74:

diff --git a/sbin/grub2-setpassword b/sbin/grub2-setpassword.fix
index 37d71dc..5302a6a 100755
--- a/sbin/grub2-setpassword
+++ b/sbin/grub2-setpassword.fix
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 if [ -d /sys/firmware/efi/efivars/ ]; then
-    grubdir=`echo "/boot/efi/EFI/redhat/" | sed 's,//*,/,g'`
+    grubdir=`echo "/boot/efi/EFI/fedora" | sed 's,//*,/,g'`
 else
     grubdir=`echo "/boot/grub2" | sed 's,//*,/,g'`
 fi
@@ -70,12 +70,12 @@ do
 done
 
 # set user input or default path for user.cfg file
-if [ -z "${OUTPUT_PATH}" ]; then
-    OUTPUT_PATH="${grubdir}"
+if [ -n "${OUTPUT_PATH}" ]; then
+    grubdir="${OUTPUT_PATH}"
 fi
 
-if [ ! -d "${OUTPUT_PATH}" ]; then
-    echo "${OUTPUT_PATH} does not exist."
+if [ ! -d "${grubdir}" ]; then
+    echo "${grubdir} does not exist."
     usage
     exit 2;
 fi
Comment 6 rmarshall 2017-02-09 04:14:47 EST
see open pull request:

https://github.com/vathpela/grub2-fedora/pull/17
Comment 7 Andy Lutomirski 2017-06-11 19:15:17 EDT
(In reply to rmarshall from comment #6)
> see open pull request:
> 
> https://github.com/vathpela/grub2-fedora/pull/17

That link appears to be broken.
Comment 8 Fedora End Of Life 2017-11-16 14:03:35 EST
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 9 Fedora End Of Life 2017-12-12 06:09:07 EST
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.