[tipp] Support for UEFI booting (x86_64 Intel Mac and alike)

Post there if you plan to contribute to this SystemCd
damo22
Posts: 1
Joined: 24 Feb 2012, 00:02

[tipp] Support for UEFI booting (x86_64 Intel Mac and alike)

Postby damo22 » 24 Feb 2012, 00:42

I have been looking for a solution to create a linux rescue cd for both Mac and PC and finally made it work using Systemrescuecd.

This method is experimental and still has some issues but so far I have been able to successfully boot the Systemrescuecd 2.5.0 on an
iMac and Macbook pro 5,1 without changing the kernel, just the bootloader on the cd.

The rough method is as follows but if you want all the extra files please contact me:

You need the files contained in the /isolinux/grub directory from the ubuntu-desktop-11.10-amd64+mac.iso

efi.img:
This contains a small FAT partition with a precompiled EFI executable for bootstrapping grub2 from an alternative el torito boot region and defaults
to a certain prefix path on the cd to search for grub2 modules (so far wont work on a usb stick due to the prefix being wrong but you can recompile
grub2 and create an efi image of your own to fix this).

Mount the SystemRescuecd 2.5.0 somewhere and clone it into [SYSRCD]
Copy the files from /isolinux/grub from ubuntu-desktop-11.10-amd64+mac.iso into [SYSRCD]/boot/grub

And rewrite a few files on the Systemrescuecd:
Delete [SYSRCD]/boot/grub/grub.cfg and create your own that looks something like this:

Code: Select all

set timeout 5
set default 0

if loadfont /boot/grub/font.pf2 ; then
   set gfxmode=auto
   insmod efi_gop
   insmod efi_uga
   insmod gfxterm
   terminal_output gfxterm
fi

menuentry "SystemRescueCD x86_64 Intel Mac" {
   set gfxpayload=keep
   linux   /isolinux/altkern64 nomodeset efi
   initrd    /isolinux/initram.igz
}


Volume name of rescue cd = [VOLID]
Create an info file for grub2 to autodetect the cd root:

Code: Select all

mkdir [SYSRCD]/.disk
echo -n "[VOLID]" [SYSRCD]/.disk/info


Then to burn the iso you need xorriso and mkisofs:

Code: Select all

cd [SYSRCD]
xorriso -as mkisofs -rock -omit-version-number -disable-deep-relocation -joliet -allow-leading-dots -volid "[VOLID]" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -o ../SystemRescueCD-2.5.0-efi64+biosi586.iso .

sf_alpha
Posts: 5
Joined: 24 Jul 2009, 06:55

Re: [tipp] Support for UEFI booting (x86_64 Intel Mac and al

Postby sf_alpha » 16 Aug 2012, 00:49

Booting is not enough because CD still lacks some support tools

For my suggestions, for SystemRescueCD to fully support UEFI we should add

- working EFIBootMgr
efibootmgr of 2.8.1 has bugs, will test 3.0.0 beta to see if it still there

- grub2 for UEFI platforms
in Gentoo, hard work being done to allow grub2 builds for multiple target so
CD can include support for both i386-pc and x86_64-efi
(I think 32bit EFI not neccessary because no one using it)

also, grub2 is only boot loader that allow advance boot menu so it should be default loader in
/EFI/BOOT/BOOTX64.EFI

Code: Select all

set timeout 5
set default 0

if loadfont $(prefix)/grub/font.pf2 ; then
   set gfxmode=auto
   insmod efi_gop
   insmod efi_uga
   insmod gfxterm
   terminal_output gfxterm
fi

menuentry SystemRescueCd: 64bit kernel with default boot options" {
   set gfxpayload=keep
   search --file --set=root /sysrcd.dat
   linux /syslinux/rescue32 scandelay=1
   initrd /syslinux/initram.igz
}

submenu "Standard 64bit kernel (rescue64) with more choice..." {
   ...
}

submenu "Alternate 64bit kernel (rescue64) with more choice..." {
   ...
}

submenu "UEFI Shell" {

menuentry "UEFI 1.0 Shell" {
   chainloader /efi/boot/shellx64.efi
}

menuentry "UEFI 2.0 Shell (only for UEFI 2.3+ BIOS)" {
   chainloader /efi/boot/shell2x64.efi
}

}


- EFI Shell
There are 2 EFI shell version, choose by GRUB2 boot menu
https://wiki.archlinux.org/index.php/Un ... load_links

- rEFInd boot loader

- DUET UEFI as bootdisk (This should not list under EFI grub menu, only for Legacy BIOS PC)

admin
Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: [tipp] Support for UEFI booting (x86_64 Intel Mac and al

Postby admin » 23 Aug 2012, 19:40

This has been implemented in SystemRescueCd-3.0.0-beta, tests are welcome
The grub.cfg file is currently pretty basic more work has to be done to provide more boot options
If you want to contribute you can suggest contents for grub.cfg
We want to avoid fancy graphics / fonts that could make it bigger or fail

ridikulusrat
Posts: 3
Joined: 15 Jun 2012, 13:38

Re: [tipp] Support for UEFI booting (x86_64 Intel Mac and al

Postby ridikulusrat » 25 Aug 2012, 07:05

admin wrote:This has been implemented in SystemRescueCd-3.0.0-beta, tests are welcome
The grub.cfg file is currently pretty basic more work has to be done to provide more boot options
If you want to contribute you can suggest contents for grub.cfg
We want to avoid fancy graphics / fonts that could make it bigger or fail


I implemented UEFI support using GRUB2 (when it was 1.99) in Archlinux Archboot iso. See https://projects.archlinux.org/archboot ... ne.sh#n204 and the core after that on how it is done. It has been widely tested for about 6 months now (both CD and FAT32 USB boot). The only thing not tested in Archboot is "many menuentries" (like in case of SYSRESCCD) and submenu support since Archboot grub2 menu has only 6 entries in any case.

The official ISO of Archlinux (Archiso) implements UEFI support using EFISTUB (not GRUB2) https://projects.archlinux.org/archiso. ... ild.sh#n70 . EFISTUB only supports booting kernels which match with UEFI Arch, unlike GRUB2 which supports i686 kernel in x86_64 UEFI and vice-versa.


Return to “Contributions”

Who is online

Users browsing this forum: No registered users and 3 guests