Page 1 of 2

xorriso cannot find path 'efi.img' in loaded ISO

Posted: Thu Oct 02, 2014 6:40 pm
by cormacobrien
I'm following the Bare Bones tutorial and everything seems to have worked so far, but xorriso (called from grub-mkrescue if I understand correctly) errors out while building the image.

Code: Select all

cormac on cormac-w520 at ~/os >>> grub-mkrescue -o os.iso isodir

xorriso 1.3.8 : RockRidge filesystem manipulator, libburnia project.
Drive current: -outdev 'stdio:os.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  120g free
Added to ISO image: directory '/'='/tmp/grub.TUmiiT'
xorriso : UPDATE : 872 files added in 1 seconds
Added to ISO image: directory '/'='/home/cormac/os/isodir'
xorriso : FAILURE : Cannot find path '/efi.img' in loaded ISO image
xorriso : UPDATE : 876 files added in 1 seconds
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
No file is output. I've been searching for about an hour, but I've only found a couple posts on various forums about this and none of them seem to have a solution. This feels like a rather trivial problem, but just starting out at this I'm not really sure where to go.

Host system is Arch Linux x86-64. Cross-compiler is running gcc-4.9.1 and binutils-2.24. grub-mkrescue --version puts out v2.02, xorriso is v1.3.8.

Let me know if there's any other pertinent information I should include.

Re: [NEWBIE] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 03, 2014 6:39 pm
by cormacobrien
In hopes of making some magic happen, I switched my system from legacy mode and Syslinux, and am now running on UEFI and GRUB2. I went through the entire process again on this clean install and have arrived at literally the exact same result.

Some more research reveals (I think?) that there should be a /boot/grub/efi.img installed on the host system, but I don't have that file and I feel like trying to download one and stick it on my EFI partition is probably not the best idea. Anyone know what's up?

Also, if there's any way to make xorriso/mkisofs/etc. create an ISO meant to boot from MBR (assuming that works for multiboot) I'd gladly take that as a (temporary) alternative.

Re: [NEWBIE] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 03, 2014 8:37 pm
by cormacobrien
It would appear I can solve the problem by extracting the efi.img from a SuperGrubDisk ISO and moving that to the new ISO's root directory before attempting grub-mkrescue.

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Thu Oct 09, 2014 8:24 pm
by naegelejd
Hi! How did you go about extracting efi.img?

I'd very much like to use grub-mkrescue on my x86 Arch Linux VM, but I'm having the same troubles with grub-mkrescue telling xorriso to expect efi.img.

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Thu Oct 09, 2014 8:40 pm
by cormacobrien
naegelejd wrote:Hi! How did you go about extracting efi.img?

I'd very much like to use grub-mkrescue on my x86 Arch Linux VM, but I'm having the same troubles with grub-mkrescue telling xorriso to expect efi.img.
Assuming you've got a copy of SuperGrubDisk, in the current working directory:

Code: Select all

sudo mount super_grub2_disk_hybrid_2.00s2.iso /mnt
cp /mnt/efi.img .
sudo umount /mnt
chmod +w efi.img
Put the file in the root of isodir/ or sysroot/ or whatever your ISO directory is.

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 10, 2014 4:31 am
by max
Are you sure that this topic is "[SOLVED]"??

How did you build GRUB?
What target platform should your OS run on? I don't really believe that you planned to use (U)EFI... so your target most likely is i386-multiboot. You need to pass that format to "grub-mkrescue".

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 10, 2014 4:32 am
by sortie
If your grub-mkrescue doesn't work, that's a bug in your GRUB installation, I think. Could we ask GRUB developers? I tried looking into this once, but any sanity was drowned in mysterious GRUB shell scripts.

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 10, 2014 7:40 am
by Combuster
Psst. There's a grub 1 out there. :wink:

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 10, 2014 7:43 am
by max
That release "2.00" really seems to be a little weird. You should pull the latest revision from their Git repository, compile it yourself; then you know how it works & why it works.

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 10, 2014 12:44 pm
by naegelejd
You're correct... there's something wrong with grub-mkrescue in the Arch Linux repository.
I compiled grub 2.02~beta2 from the grub Git repo and grub-mkrescue no longer tells xorriso to expect "/boot/efi.img".
I am, however, now having trouble loading my kernel. Grub says "error: entry point isn't in a segment"... but my kernel loading code and linker script haven't changed from the "Higher-Half" tutorial.

Re: xorriso cannot find path 'efi.img' in loaded ISO

Posted: Fri Oct 10, 2014 12:47 pm
by cormacobrien
I have removed the [SOLVED] tag so it's clear this is still an issue. Seems like I should file a bug report for the Arch package.

Re: [SOLVED] xorriso cannot find path 'efi.img' in loaded IS

Posted: Fri Oct 10, 2014 1:40 pm
by Owen
Combuster wrote:Psst. There's a grub 1 out there. :wink:
GRUB 1 definitely doesn't have an efi.img (or any EFI support at all)

Re: xorriso cannot find path 'efi.img' in loaded ISO

Posted: Fri Oct 10, 2014 2:35 pm
by Combuster
Well apparently, this particular person's GRUB 2 also lacks EFI so nothing constructive is lost here.... :mrgreen:

Joking aside, GRUB 1 boots multiboot kernels from a CD just fine, and it's about as simple, and certainly better documented and diagnosable. Being older and less advanced certainly has its perks.

Re: xorriso cannot find path 'efi.img' in loaded ISO

Posted: Fri Oct 10, 2014 4:50 pm
by cormacobrien
Should I document this as a temporary workaround in the wiki for people running GRUB2?

Re: xorriso cannot find path 'efi.img' in loaded ISO

Posted: Sat Oct 11, 2014 4:17 am
by sortie
This appears to be a bad work-around. I'd rather this didn't get into the wiki, but it was instead investigated why GRUB tries to add EFI support when no EFI support is available.

Does a simple:

Code: Select all

grub-mkrescue -o rescue.iso
fail? That is, a rescue iso without any of your files. If so, this is definitely a bug in your distro, or GRUB.