[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2016-12-16 Thread Jack Howarth
Tested on a fresh install of Ubuntu 16.10 x86_64 by...

gcc -o disable_journal disable_journal.c
chmod ugo+x update-efi-booter 
install disable_journal update-efi-booter /usr/local/bin

identify the device that the /boot/efi partition is mounted on, umount
it and then use gdisk to delete that partition and create a new one with
the code AF00 for HFS+. Write the changes out in gdisk and then execute
mkfs.hfsplus on the device to format it. Now change the boot/efi entry
in fstab to have 'hfsplus defaults', remount the boot/efi partition and
just execute the 'update-efi-booter' script.

Afterwards the /boot/efi subdirectory will contain...
# cd /boot/efi/  
# ls -lR .
.:
total 4
-rw-r--r-- 1 root root 34 Dec 16 23:04 mach_kernel
drwxr-xr-x 1 root root  3 Dec 16 23:04 System

./System:
total 0
drwxr-xr-x 1 root root 3 Dec 16 23:04 Library

./System/Library:
total 0
drwxr-xr-x 1 root root 4 Dec 16 23:04 CoreServices

./System/Library/CoreServices:
total 1968
-rw-r--r-- 1 root root 2009088 Dec 16 23:04 boot.efi
-rw-r--r-- 1 root root 380 Dec 16 23:04 SystemVersion.plist

and where the boot.efi is now blessed on a HFS+ filesystem. This allows
the option key boot selector on Macs to display the Ubuntu operating
system with a customized icon. Thus rEFind is no longer needed to be
able to switch between other installed OS releases.

** Attachment added: "Final copy of the update-efi-booter with all known bugs 
fixed"
   
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1369187/+attachment/4792576/+files/update-efi-booter_GM

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2016-12-15 Thread Jack Howarth
I would also strongly suggest that we add code similar to that posted on
pastebin for journal_disable.c at http://pastebin.com/7rvxR38d to the
mactel-boot package as well as this script so we can add the additional
lines...

# make sure HFS+ Journaling is disabled
disable_journal `cat /proc/mounts | grep '/boot/efi' | cut -f1 -d' '`

to the front of the update-efi-booter script to make it even more
robust.

** Attachment added: "code for disabling journaling on HFS+"
   
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1369187/+attachment/4792308/+files/disable_journal.c

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2016-12-15 Thread Jack Howarth
I have successfully installed Debian Jessie using the multi-arch netinst
iso

https://cdimage.debian.org/debian-cd/current/multi-arch/iso-
cd/debian-8.6.0-amd64-i386-netinst.iso

which leverages the new mixed mode support described in
https://wiki.debian.org/UEFI

Support for mixed-mode systems: 64-bit system with 32-bit UEFI
Some systems have been released containing 64-bit Intel Atom CPUs (such as the 
Bay Trail), but unfortunately use 32-bit UEFI firmware with no BIOS 
compatibility mode. Using the 32-bit UEFI x86 support, an i386 installation 
should be possible on these machines but it won't make the most of the 64-bit 
hardware.

Debian Jessie (8.0) was the first Linux distribution to include full
support for mixed-mode UEFI installation on these machines. The multi-
arch installation media (available in netinst and DVD form) include the
UEFI boot loaders necessary for both i386 and amd64 boot. By selecting
"64-bit install" from the initial boot menu, debian-installer will
install a 64-bit (amd64) version of Debian. The system will
automatically detect that the underlying UEFI firmware is 32-bit and
will install the appropriate version of grub-efi to work with it.

The resulting Debian Jessie install was transitioned to Ubuntu 16.10
by...

1) replacing the /etc directory with a copy from a fresh Ubuntu 16.10 x86_64 
install while retaining copies of the fstab, shadow and passwd files generated 
by the Debian Jessie installation.
2) Using 

apt-get -f update
apt-get clean
for pkg in `dpkg --get-selections | awk '{print $1}' | egrep -v 
'(dpkg|apt|mysql|mythtv)'` ; do apt-get -y  -o 
Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" 
--force-yes install --reinstall $pkg ; done


At this point, the only problem remaining was that the boot selector doesn't 
detect the Ubuntu installation. I solved this by reformatting the /boot/efi 
partition as HFS+ with journaling disabled so that Linux could access it for 
writing. I then used the following script to generate the appropriate boot.ef 
in /tmp, depending on whether the machine has EFI-32 or EFI-64 firmware, and 
then installed in /boot/efi/System/Library/CoreServices along side the 
SystemVersions.plist installed from the current mactel-boot package files and a 
/boot/efi/mach_kernel file. Lastly the script blesses the newly installed 
boot.efi.

#!/bin/bash -ex
# update-efi-booter script
pushd /
grub-mkconfig -o /boot/grub/grub.cfg
efi_arch="x86_64"
coreservices_dir="/boot/efi/System/Library/CoreServices/"
boot_efi_dir="/boot/efi/"
mactel_boot_dir="/usr/share/mactel-boot/"
mactel_boot_logo_dir="/usr/share/mactel-boot-logo/"
grep -q "32" /sys/firmware/efi/fw_platform_size && efi_arch="i386"
echo 'Creating boot.efi for '$efi_arch
case "$efi_arch" in
x86_64)
  grub-mkstandalone -o /tmp/boot.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi 
--compress=xz boot/grub/grub.cfg
  ;;
i386)
  grub-mkstandalone -o /tmp/boot.efi -d usr/lib/grub/i386-efi -O i386-efi 
--compress=xz boot/grub/grub.cfg
  ;;
esac
echo 'Installing boot.efi for '$efi_arch 
mount -t hfsplus -o force,remount,rw $boot_efi_dir && sleep 1
test ! -d $coreservices_dir && install -d $coreservices_dir
install -m 644 /tmp/boot.efi $coreservices_dir
test ! -f $boot_efi_dir/.VolumeIcon.icns && -f 
$mactel_boot_logo_dir/ubuntu.icons && install -m 644 
$mactel_boot_logo_dir/ubuntu.icns $boo
t_efi_dir/.VolumeIcon.icns
test ! -f $boot_efi_dir/mach_kernel && echo "This file is required for booting" 
> $boot_efi_dir/mach_kernel
test ! -f $coreservices_dir/SystemVersion.plist && -f 
$mactel_boot_dir/SysytemVersion.plist && install -m 644 
$mactel_boot_dir/SystemVersi
on.plist $coreservices_dir
hfs-bless $coreservices_dir/boot.efi && sleep 1 && mount -t hfsplus -o remount 
$boot_efi_dir


** Attachment added: "script to automate the generation and installation of the 
appropriate architecture boot.efi into a HFS+ formatted /boot/efi partition"
   
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1369187/+attachment/4792306/+files/update-efi-booter

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2015-10-08 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: ubiquity (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2015-09-22 Thread Jason Heeris
I definitely don't mind! Note that the github repo has packaging
branches that might be a good starting point. Feel free to email me if
you have any problems or feedback.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2015-09-22 Thread Bernhard Reiter
In that case, would you mind me giving it a try? I'm masochist enough to
have had a couple of packages added to Debian in the past :-D I would
obviously preserve the copyright and licensing of your packaging. My
ultimate goal would be to contribute to a better OOTB experience for
mactel users, ideally automating your pure EFI boot guide as part of the
installer.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2015-09-22 Thread Jason Heeris
I went through the Debian package submission/mentor process years ago
(for RabbitVCS) and would rather not repeat the experience.

I'm happy to keep my packages' metadata up to date with the latest
Debian standards, and happy to support what I publish (on
Github/PPAs/etc.), and happy to take back changes from Debian
maintainers, but I have no desire to subject myself to Debian's package
submission purgatory again.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2015-09-21 Thread Bernhard Reiter
Jason,

have you considered submitting your package for inclusion in Debian?
(See http://mentors.debian.net/, and links in the 'Getting your package
into Debian' section there.) I'd very much appreciate if you did! :-)

--Bernhard

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2015-09-21 Thread Bernhard Reiter
** Also affects: ubiquity (Ubuntu)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1369187] Re: Installation on Macs could use EFI booting instead of legacy BIOS

2015-02-20 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: debian-installer (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1369187

Title:
  Installation on Macs could use EFI booting instead of legacy BIOS

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1369187/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs