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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
cormacobrien
Posts: 13
Joined: Thu Oct 02, 2014 6:24 pm
Location: Chicago

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

Post 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.
Last edited by cormacobrien on Fri Oct 10, 2014 12:46 pm, edited 2 times in total.
Find me on Github and Bitbucket.
User avatar
cormacobrien
Posts: 13
Joined: Thu Oct 02, 2014 6:24 pm
Location: Chicago

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

Post 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.
Find me on Github and Bitbucket.
User avatar
cormacobrien
Posts: 13
Joined: Thu Oct 02, 2014 6:24 pm
Location: Chicago

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

Post 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.
Find me on Github and Bitbucket.
naegelejd
Posts: 12
Joined: Thu Oct 09, 2014 5:09 pm

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

Post 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.
User avatar
cormacobrien
Posts: 13
Joined: Thu Oct 02, 2014 6:24 pm
Location: Chicago

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

Post 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.
Find me on Github and Bitbucket.
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

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

Post 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".
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

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

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

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

Post by Combuster »

Psst. There's a grub 1 out there. :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

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

Post 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.
naegelejd
Posts: 12
Joined: Thu Oct 09, 2014 5:09 pm

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

Post 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.
User avatar
cormacobrien
Posts: 13
Joined: Thu Oct 02, 2014 6:24 pm
Location: Chicago

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

Post 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.
Find me on Github and Bitbucket.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

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

Post 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)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

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

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
cormacobrien
Posts: 13
Joined: Thu Oct 02, 2014 6:24 pm
Location: Chicago

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

Post by cormacobrien »

Should I document this as a temporary workaround in the wiki for people running GRUB2?
Find me on Github and Bitbucket.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

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

Post 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.
Post Reply