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

Re: regenerating /boot/efi/debian/

     I was able to burn a usable USB installer key from the
debian-8.6.0-amd64-i386-netinst.iso by using the Fedora Media Writer
software on OS X or with just...

sudo dd if=debian-8.6.0-amd64-i386-netinst.iso of=/dev/disk5 bs=1m

where the memory key resides on disk5.. The resulting memory key
produced two EFI boot entries in the Startup Manager on a Mac (aka the
option-key boot selector). Selecting the first of these two EFI boot
devices on a MacBook Pro 2,1 booted the unit straight up into the
Debian Jessie installer from where a standard 64-graphical install
produced a bootable x86_64 kernel installation of Debian Jessie.
   However this installation is invisible to the Mac Startup manager
because it lacks the required HFS+ boot partition containing...

1) a /boot/efi/mach_kernel dummy file
2) a /boot/efi/System/Library/CoreServces/SystemVersions.plist file
which can be gotten from the mantel-boot package
3) a /boot/efi/System/Library/CoeServies/boot.efi file as generated
and installed by the update-ef-booter script

The general steps then here were thus...

1) Install Debian Jessie
2) under Debian Jessie, use gdisk to delete the current vfat /boot/efi
partition and recreate it with the AF00 code for HFS+ followed by
formatting it with mkfs.hfsplus.
3) edit the /etc/stab entry to change the /boot/efi from being vfat to
hfsplus with 'defaults' as the options used
4) remount the /boot/efi with this fstab and then with the
update-eft-booter GM script installed in /usr/local/bin along side the
compiled disable_journal program, simply execute update-eft-booter.

This script again will generate the appropriate arch of boot.efi
depending on the observed EFI firmware arch as seen from
/sys/firmware/efi/fw_platform_size. using either...

grub-mkstandone -o /tmp/boot.efi -d usr/lib/grub/x86_64-efi -O
x86_64-efi --compress=zz boot/grub/grub.cfg

for EFI-64 and

grub-mkstandalone -o /tmp/boot.efi -d usr/lib/grub/i386-efi -O
i386-efi --compress=xz boot/grub/grub.cfg

for EFI-32 firmware like on a MacBook Pro 2,1. The rest of the
update-eft-booter script merely mounts the previously prepared HFS+
partition with journaling disabled and then copies a bogus mach_kernel
file to /boot/efi and the SystemVersions.plist from the mantel-boot
package and the /tmp/boot.efi into
/boot/efi/System/Library/CoreServices followed by using hfs-bless to
bless the installed boot.efi so the Startup Manager will recognize it.
An icon for the distribution can be installed as .VolumeIcon.icns in
/boot/efi and will be shown in the boot selector.
    Again the rational for all of this is...

1) to avoid using rEFind or rEFit which are both fragile to being
blown away if the user ever uses the StartUp disk preference panel to
reset a startup disk.
2) to allow the user to keep the boot.efi current with the installed
kernel (such as when transitioning from Debian Jessie which is on a
3.16 kernel to Ubuntu 16.10 which is on a 4.8 kernel.

On Sun, Dec 18, 2016 at 1:45 PM, adrian15 <adrian15sgd@gmail.com> wrote:
> El 13/12/16 a las 09:50, Jack Howarth escribió:
>>       During my struggles to get a bootable linux installed on a
>> MacBook Pro 2,1 which has EFI-32 firmware, I discover that the
>> debian-8.6.0-amd64-i386-netinst.iso multi-arch installer was the only
>> Linux distribution capable of achieving this.
> Hi Jack,
>   I would like to understand better why you insist on your update-efi-booter
> script. ( As I'm asking about Debian specifically I will CC debian-efi
> mailing list here. On other Super Grub2 Disk related stuff I tend to remove
> debian-efi mailing list from CC so that I don't pollute it with offtopic. )
>   Can you please describe:
> * How you managed to boot debian-8.6.0-amd64-i386-netinst.iso on your Mac
> Book Pro ( MBP 2,1 ) ? Did you do a DD equivalent and put the ISO into a
> USB? Did you do anything else?
> * I guess once Debian installation disk had boot you just did a normal
> installation. Any specific steps on the installation related to boot/grub
> that you did?
> * Once you installed it thanks to Debian installer did it boot right away?
> Or did you have to do additional steps for it to boot? Which ones were those
> ones?
> adrian15
> --
> Support free software. Donate to Super Grub Disk. Apoya el software libre.
> Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/

Reply to: