Bug 1114808 - On Macs, grub2-install: error: Can't create file: No such file or directory
Summary: On Macs, grub2-install: error: Can't create file: No such file or directory
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 22
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1115172 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-01 04:17 UTC by Chris Murphy
Modified: 2016-07-19 11:53 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 11:53:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
grub2-install debug (609.30 KB, text/plain)
2014-07-01 04:17 UTC, Chris Murphy
no flags Details

Description Chris Murphy 2014-07-01 04:17:50 UTC
Created attachment 913630 [details]
grub2-install debug

Description of problem: When running grub2-install on a Mac, it ends in an error.


Version-Release number of selected component (if applicable):
grub2-efi-2.02-0.4.fc21.x86_64


How reproducible:
Always

Steps to Reproduce:
1. yum install grub2-efi-modules
2. grub2-install

Actual results:
grub2-install: error: Can't create file: No such file or directory.




Expected results:
Probably should work.

Additional info:
Works on non-Mac UEFI systems.

From debug output:
grub2-install: info: copying `/boot/grub2/x86_64-efi/core.efi' -> `/boot/efi/EFI/grub/System/Library/CoreServices/boot.efi'.
grub2-install: error: Can't create file: No such file or directory.

However, a /boot/efi/EFI/grub/System/Library/CoreServices/boot.efi file is successfully created. So I'm not sure what it's complaining about.

Comment 1 Chris Murphy 2014-07-01 04:19:18 UTC
Maybe it's calling efibootmgr to set an NVRAM entry and is running into bug 1114775?

Comment 2 Brian Lane 2014-07-01 15:31:39 UTC
If that's the case it should be logged by the kernel.

Do the files have the same checksum?

Comment 3 Chris Murphy 2014-07-01 18:50:35 UTC
No kernel messages logged. But even in bug 1114775 the kernel isn't logging anything, so I'm lost on that one.

/boot/grub2/x86_64-efi/core.efi and /boot/efi/EFI/grub/System/Library/CoreServices/boot.efi both have the same hash. A separate bug is that grub2-install is copying core.efi in the wrong location.

Is:
/boot/efi/EFI/grub/System/Library/CoreServices/boot.efi
Should be:
/boot/efi/System/Library/CoreServices/boot.efi

When I move it manually, it works.

Comment 4 Chris Murphy 2014-07-01 18:59:28 UTC
Opened bug 1115172 for the wrong location problem. As for this bug, the debug info doesn't have enough information, what file can't it create? Maybe a strace will reveal more information.

Comment 5 Chris Murphy 2014-07-01 19:52:10 UTC
open("/boot/efi/EFI/fedora/System/Library/CoreServices/boot.efi", O_WRONLY|O_CREAT|O_TRUNC, 0644) = 9
read(7, "MZ\220\0\3\0\0\0\4\0\0\0\377\377\0\0\270\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 1048576) = 158208
read(7, "", 890368)                     = 0
write(9, "MZ\220\0\3\0\0\0\4\0\0\0\377\377\0\0\270\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 158208) = 158208
read(7, "", 1048576)                    = 0
fsync(9)                                = 0
close(7)                                = 0
close(9)                                = 0
open("/boot/efi/EFI/fedora/mach_kernel", O_RDWR) = -1 ENOENT (No such file or directory)
write(2, "grub2-install: error:", 21grub2-install: error:)   = 21
write(2, " ", 1 )                        = 1
write(2, "Can't create file: No such file "..., 44Can't create file: No such file or directory) = 44


Aha. So bug 1115172 is a dup. The problem is the path is wrong in both cases. So it causes boot.efi to be put in the wrong location, as well as look for mach_kernel in the wrong location. The EFI/fedora part of the directory shouldn't be there, as the file it's looking for is at /boot/efi/mach_kernel.

(Whatever variable is involved in this path probably also explains why it's resolving to EFI/grub in the live environment, but EFI/fedora in the installed environment.)

Comment 6 Chris Murphy 2014-07-01 19:52:51 UTC
*** Bug 1115172 has been marked as a duplicate of this bug. ***

Comment 7 Jaroslav Reznik 2015-03-03 16:05:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 8 Fred van Zwieten 2015-04-27 20:37:43 UTC
I can confirm this is still an issue in Fedora 22 beta. I was bitten by it.

Solution for me was to copy /boot/efi/EFI/grub/System/Library/CoreServices/boot.efi to /boot/efi/System/Library/CoreServices/boot.efi

I am on a MBP 13" model late 2013.

Comment 9 schlaffi 2016-06-23 20:43:49 UTC
The bug is still here. My grub2 is running but I cannot run grub2-install.

Comment 10 schlaffi 2016-06-23 20:44:34 UTC
sorry, it is Fedora 23, just upgraded from Fedora 22, where it also did not work.

Comment 11 Fedora End Of Life 2016-07-19 11:53:05 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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.