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:
*** Bug 1294407 has been marked as a duplicate of this bug. ***
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.
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
see open pull request: https://github.com/vathpela/grub2-fedora/pull/17
(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.
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.
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.
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. 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 '26'. 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 26 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.
It seems to be fixed now.