help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot boot from dual bios/uefi boot CD


From: Andrei Borzenkov
Subject: Re: Cannot boot from dual bios/uefi boot CD
Date: Fri, 27 Feb 2015 22:19:53 +0300

Caveats - I always use close-to-latest GIT snapshot.

В Fri, 27 Feb 2015 12:08:36 +0400
John Frankish <address@hidden> пишет:

> > > I ran the following:
> > > 
> > > $ sudo x86_64-grub-mkrescue --modules="iso9660 fshelp loadbios 
> > > part_msdos part_gpt normal terminal crypto extcmd boot gettext linux 
> > > video relocator mmap font bufio efi_gop video_fb efi_uga gfxterm 
> > > bitmap_scale bitmap gfxmenu trig" -o myiso.iso iso
> > > 
> > > The iso as-is boots, but still contains copies all of the modules in 
> > > i386pc and x86_64-efi.
> > >
> > > I don't see the logic in embedding modules if the same modules will be 
> > > copied to the iso anyway?
> > > 
> > > If I delete the x86_64-efi folder from the iso, it doesn't boot and 
> > > complains about all of the missing modules for ever.
> >
> > And which modules are missing? This works for me
> >
> > address@hidden:~/build/grub> pkgdatadir=$PWD ./grub-mkrescue -d grub-core 
> > -o /tmp/foo.iso --modules="linux part_msdos minicmd ls" 
> > --install-modules="" /linux=/boot/vmlinuz-3.16.7-7-desktop 
> > /initrd=/boot/initrd-3.16.7-7-desktop 
> >
> > linux /linux
> > initrd /initrd
> > boot
> >
> > minicmd is for lsmod and ls is for ls. part_msdos is not really needed.
> > It still works using minimal --modules=linux
> 
> Thanks for the continued help with this.
> 
> I was using grub-2.00, which doesn't have "-d" or "--install-modules="
> 
> If I use grub-2.02~beta2, then the same command works for me, except that I'm 
> booting to the console prompt so in uefi boot I get a blank display after 
> "error: no suitable video more found. Booting in blind mode".
> 

Yes, on BIOS linux depends on and automatically pulls in vbe. The
following works for me on EFI (for booting from ISO image of course)

address@hidden:~/build/grub> pkgdatadir=$PWD ./grub-mkrescue -d grub-core -o 
/tmp/foo.iso --modules="linux minicmd ls efi_gop" --install-modules="" 
/linux=/boot/vmlinuz-3.16.7-7-desktop /initrd=/boot/initrd-3.16.7-7-desktop

> BTW, if I use --modules="linux" or --modules="linux part_dos iso9660", then 
> uefi boot fails with the error: file `/boot/grub/x86_64-efi/part_acorn.mod` 
> not found. Entering rescue mode.

See above. It works for me using EFI build. And the following allows me
to boot from HDD:

address@hidden:~/build/grub> pkgdatadir=$PWD ./grub-mkrescue -d grub-core -o 
/tmp/foo.iso --modules="linux minicmd ls efi_gop ext2" --install-modules=""

Adjust for your filesystem. You may need to add part_msdos and part_gpt
(current GIT head does it automatically on EFI).

> 
> If I use the following to get a display in uefi boot:
> 
> $ sudo grub-mkrescue --modules="iso9660 fshelp loadbios part_msdos part_gpt 
> normal terminal crypto extcmd boot gettext 
> linux video relocator mmap font bufio efi_gop video_fb efi_uga gfxterm 
> bitmap_scale bitmap gfxmenu trig" --install-modules="" -o myiso.iso iso
> 
> I get:
> grub-mkrescue: error: cannot open `/usr/local/lib/grub/i386-pc/loadbios.mod': 
> No such file or directory.

This means your grub-mkrescue sees only i386-pc platform. loadbios.mod
exists in EFI build only.

> 
> ..and if I use:
> 
> sudo grub-mkrescue --directory=/usr/local/lib/grub/x86_64-efi 
> --modules="iso9660 fshelp loadbios part_msdos part_gpt normal terminal crypto 
> extcmd boot gettext linux video relocator mmap font bufio efi_gop video_fb 
> efi_uga gfxterm bitmap_scale bitmap gfxmenu trig" --install-modules="" -o 
> myiso.iso iso
> 
> then the cd fails to boot in legacy-bios mode with "selected boot device 
> failed, press any key to boot system"
> 

Of course. You created CD that contains only EFI platform, how can it
boot in BIOS mode?

> ..so it appears that I'm stuck?
> 

If your intention is to build dual-platform support, you probably
misunderstood what I said earlier. You need to build and install grub
twice for two different platforms USING THE SAME PREFIX AND PROGRAM
NAME. It appears you built it twice but placed in two different
locations, so you can now only use one of them at a time.

You should have something like

address@hidden:~/src/grub> LC_ALL=C ll /usr/lib/grub2
total 40
drwxr-xr-x 2 root root 20480 Nov  8 07:54 i386-pc
drwxr-xr-x 2 root root 20480 Nov  8 08:05 x86_64-efi

Now replace /usr/lib with /usr/local/lib, i.e. you have to build
and install twice using

./configure --prefix=/usr/local --with-platform=pc
./configure --prefix=/usr/local --with-platform=efi

> Note also that, the mkrescue command appears to copy files all  over the 
> place:
> 
> $ ls /mnt/sr0/boot/grub/x86_64-efi [why is this required if the modules are 
> embedded?]
> command.lst   crypto.lst    fs.lst        moddep.lst    modinfo.sh    
> partmap.lst   parttool.lst  terminal.lst  video.lst
> 
> $ ls /mnt/sr0/System/Library/CoreServices
> SystemVersion.plist  boot.efi [is boot.efi duplicating efi.img?]
> 
> $ ls /mnt/sr0
> System/       boot/         boot.catalog  efi.img       mach_kernel
> 
> ..and copies Unicode.pf2 to the cd when it cannot be used and creates empty 
> directories for locale and rom.
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]