Merge lp:~superm1/usb-creator/grub-support into lp:usb-creator
| Status: | Merged |
|---|---|
| Merged at revision: | 323 |
| Proposed branch: | lp:~superm1/usb-creator/grub-support |
| Merge into: | lp:usb-creator |
| Diff against target: |
158 lines (+49/-19) 3 files modified
bin/usb-creator-helper (+28/-10) debian/changelog (+2/-0) usbcreator/install.py (+19/-9) |
| To merge this branch: | bzr merge lp:~superm1/usb-creator/grub-support |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Colin Watson | 2010-09-02 | Pending | |
| usb-creator hackers | 2010-09-02 | Pending | |
|
Review via email:
|
|||
Description of the Change
This adds early support for installing using grub rather than syslinux (when applicable) to avoid getting into the same situation as had happened with 10.10 changing syntax of the syslinux.cfg.
It makes an assumption that when grub is installed to CDs it will be installed in boot/grub/i386-pc. This assumption was based upon the way that EFI was implemented on AMD64 CDs for 10.10 that modules were in /boot/grub/
| Colin Watson (cjwatson) wrote : | # |
- 319. By Colin Watson on 2010-09-03
-
GTK frontend: don't grey out "Make Startup Disk" when the source is a
physical CD.
| Mario Limonciello (superm1) wrote : | # |
This should hopefully address all of the concerns that Colin raised (but Launchpad decided to eat).
- 320. By Mario Limonciello on 2010-09-04
-
Grow support for installing GRUB to USB sticks if it's detected in the image
rather than isolinux.
| Mario Limonciello (superm1) wrote : | # |
I did a couple of tests with handcrafted boot.img and core.img files, and this appears to work properly for them using dd now.
| Mario Limonciello (superm1) wrote : | # |
After more testing i've merged this in today.
The boot.img was used as it existed on the system.
The handcrafted core.img was generated like this:
#grub-mkimage -c grub.cfg -o core.img biosdisk part_msdos fat search_fs_file iso9660
grub.cfg:
search.file /boot/grub/
set prefix=


On Thu, Sep 02, 2010 at 11:49:55PM -0000, Mario Limonciello wrote: x86_64- efi. If that's a bad assumption, this can be
> It makes an assumption that when grub is installed to CDs it will be
> installed in boot/grub/i386-pc. This assumption was based upon the
> way that EFI was implemented on AMD64 CDs for 10.10 that modules were
> in /boot/grub/
> modified.
I think this assumption is OK.
> - num = deviceobj. Get(device, 'partition-number', PROPS_IFACE) '/sbin/ parted' , parent, 'set', str(num), 'boot', 'on']) ssException:
> - dbus_interface=
> - try:
> - popen([
> - except USBCreatorProce
> - # Don't worry about not being able to re-read the partition table.
> - # TODO: As this will still be a problem for KVM users, this should
> - # be fixed by unmounting all the partitions before we get to this
> - # point, then remounting the target partition after.
> - pass
We need the parted call for both syslinux and GRUB. Some BIOSes refuse
to boot from a device that doesn't have an active partition.
> + if bootloader == 'grub': 'grub-mkimage' , '-p', '/boot/ grub/i386- pc', '-o', core,
> + core = tempfile.mktemp()
> + popen([
> + 'biosdisk', 'part_msdos', 'fat', 'ntfs'])
This creates a GRUB image based on the version of grub-pc that you have
installed, on the assumption that it will continue to work with the old
configuration file on the CD image. This is not necessarily a sound
assumption. It also hardcodes module names; the set chosen isn't likely
to change all that much, but I feel it's worth mentioning.
If you use the installed version of grub-pc, then you must also copy
over modules from the installed system. The ABI between core.img and
modules changes frequently.
> + popen([ '/usr/sbin/ grub-setup' , '-d', '/', '-b', '/usr/lib/ grub/i386- pc/boot. img',
> + '-c', core, parent])
Hardcoded path to grub-setup. Also surely this should be '-d grub/i386- pc' rather than using both -d and -b? '-d /' makes
/usr/lib/
no sense.
In general, I have to say that I'm kind of uneasy with this approach; I
think it will break just as much as syslinux has been breaking, if not
more. I have an alternative suggestion. When we switch to GRUB, we
should arrange that the very same core.img on the CD contains the
necessary modules to boot on USB sticks as well. We can then simply dd
the existing core.img into the space after the MBR, and not have to
worry about these interface issues.