Bug 691598 - livecd-iso-to-disk doesn't create (U)EFI bootable USB stick
Summary: livecd-iso-to-disk doesn't create (U)EFI bootable USB stick
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-28 23:08 UTC by Chris Murphy
Modified: 2011-05-10 03:27 UTC (History)
6 users (show)

Fixed In Version: livecd-tools-15.7-1.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-10 03:27:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Chris Murphy 2011-03-28 23:08:48 UTC
Description of problem: 
The livecd-iso-to-disk script found on Fedora-15-Alpha-x86_64-Live-Desktop.iso does not produce a bootable USB stick for (U)EFI machines.


Version-Release number of selected component (if applicable): 
F15 alpha


How reproducible: 
100%


Steps to Reproduce:
1. Download Fedora-15-Alpha-x86_64-Live-Desktop.iso to a conventional BIOS based i686 system.
2. Mount ISO and extract the livecd-iso-to-disk file from /LiveOS
3. Executed the following command:
sudo bash /home/chris/Downloads/livecd-iso-to-disk --format --efi --overlay-size-mb 800 /home/chris/Downloads/Fedora-15-Alpha-x86_64-Live-Desktop.iso /dev/sdb

script reports "Target device now set up with a Live image!"

4. Unmount and move the USB stick to (U)EFI machines for booting.


Actual results:
Both the MBR and GPT appear to be malformed.

USB stick will not boot either a Macbook Pro 4,1 (Apple+Intel EFI 1.1) or Macbook Pro 8,2 (UEFI 2.x) machine.

gparted print reports:
Warning: /dev/sdb contains GPT signatures, indicating that it has a GPT table.  However, it does not have a valid fake msdos partition table, as it should.  Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables.  Or perhaps you deleted the GPT table, and are now using an msdos partition table.  Is this a GPT partition table?

Upon saying yes, parted reports the entire 2GB stick is FAT32 with name "EFI System Partition".

Mac OS X utility "diskutil list" reports the device has no GPT, and lists no partitions at all.

gdisk reports:
Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: present

 
 GRUB 0.97 reports:
 filesystem type unknown, partition type 0xb9

Expected results:
Other than the obvious, that this should just work, but isn't:

1. The MBR should be a protective MBR, without GRUB Stage 1. 

2. fdisk -l should report a single partition with Id of ee.

3. gdisk should report MBR: Protective MBR and GPT: present. And only use the GPT instead of asking, as it presently does, whether to use the MBR or GPT.

2. The GPT should have two entries, one for "EFI PART", gdisk code 0xEF00, which contains /EFI/BOOT/BOOTX64.efi and BOOTX64.CONF. Everything else for the liveCD should go in another partition, probably code 0x0700. Stuffing the whole Live CD into EFI PART does not seem like it's a good idea.


Additional info:
Does not work for F13, F14 either. Same problem. The script does not appear to properly partition the USB stick. Therefore the computer has no idea what to do with it.

I defintely want to ensure that --format --efi does not produce an MBR that also contains GRUB Stage 1 in the first 440 bytes. This almost certainly causes Apple hardware to enter BIOS emulation mode instead of using native EFI. This may happen on other hardware as well. If the hardware goes into BIOS emulation, we will have problems with the resulting installation being BIOS biased, rather than EFI biased.

http://docs.fedoraproject.org/en-US/Fedora/14/html/Installation_Guide/ch-Boot-x86.html

"Note that the boot configurations of UEFI and BIOS differ significantly from each other. Therefore, the installed system must boot using the same firmware that was used during installation. You cannot install the operating system on a system that uses BIOS and then boot this installation on a system that uses UEFI."

Therefore --format --efi should produce a strict GPT with a protective MBR. And GRUB only located on the "EFI PART" partition in /EFI/BOOT as BOOTX64.efi.

Every utility on the planet should be able to read the resulting USB stick correctly. I'm able to do this manually and have a functioning GRUB Legacy EFI, or GRUB2 EFI bootable USB stick in this manner. So should this livecd-iso-to-disk script.

Comment 1 Chris Murphy 2011-03-28 23:30:06 UTC
After changing the MBR to a protective MBR with Id EE, and fixing the GPT with gdisk to set the EFI system partition to type 0xEF00, now all utilities see the USB stick as expected. And so do both (U)EFI computers. When I startup either Macbook Pro with the option key, the USB stick appears, I choose it and the GRUB menu appears. And boot of kernel and initrd proceed as expected.

The next problem (another bug) is that midstream the display text appears frozen due to a nouveau issue with this EFI firmware boot instead of BIOS boot, if kernel line nomodeset is not used.

Comment 2 Brian Lane 2011-03-29 00:21:50 UTC
This should be fixed in the next release by commit 46fa124651ebd8654cc1dd1fbfecdc09d4174cc7 which just cats gptmbr to the device.

Comment 3 Fedora Update System 2011-03-29 16:44:34 UTC
livecd-tools-15.6-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/livecd-tools-15.6-1.fc15

Comment 4 Fedora Update System 2011-03-30 02:34:00 UTC
Package livecd-tools-15.6-1.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing livecd-tools-15.6-1.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/livecd-tools-15.6-1.fc15
then log in and leave karma (feedback).

Comment 5 Chris Murphy 2011-04-10 08:37:08 UTC
--format --efi appears to fix this problem.

Comment 6 Chris Murphy 2011-04-10 08:39:00 UTC
Correction what I mean is, the problem describe (in comment 1) with --format --efi now appears to be fixed. The resulting USB stick has a valid partition table, and the USB stick is EFI bootable.

Comment 7 Fedora Update System 2011-05-06 18:15:30 UTC
livecd-tools-15.7-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/livecd-tools-15.7-1.fc15

Comment 8 Fedora Update System 2011-05-10 03:27:12 UTC
livecd-tools-15.7-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.