Re: Replacing guestfish's bootloader by our own



On Wed, 2013-04-03 at 22:52 +0100, Lionel Landwerlin wrote:
Once we've booted the image a first time with this, it magically
becomes bootable without specific qemu options.

Awesome!  Yes, this should be a lot more reliable, and syslinux is a
good default.  hpa is an active, sane upstream too.

On the Yocto front we just add syslinux to the image generation :
https://github.com/djdeath/poky/commit/a2594baa442fce4813ec63cadf7b99ed6ca2666d

I built this locally, and I'm a little bit grumpy that we're now pulling
in Perl into the -runtime tree:
http://people.gnome.org/~walters/syslinux.txt

There's just a metric crapton of stuff installed by mtools...but AFAIK
we don't actually *need* it for extlinux, only for the "msdos-syslinux".

I suppose the truly correct solution would be to change the syslinux
recipe from OpenEmbedded to generate subpackages like syslinux-extlinux.
That's what it looks like the Fedora syslinux package does:
http://pkgs.fedoraproject.org/cgit/syslinux.git

This isn't a blocker for merging, but I'd like to trend towards reducing
the size of -runtime even more if we can, since 1.6G uncompressed still
feels too large.

In the ostree package, we just add a small script and a systemd target
to install our bootloader :
https://github.com/djdeath/ostree/commit/94252bdad058b3aa3a900497ea70ad9db3330546

This bit shouldn't go in ostree - it's intended to be a generic tool
(kind of like rpm) that can be reused by multiple independent operating
systems.  For example, I plan to get around (at some point) to patching
rpm/yum and dpkg/apt to support sliding ostree *underneath* them, where
rather having them replace files on /, they work
on /ostree/deploy/fedora18 for example.  So you can have the whole
atomic upgrades, snapshots etc. while still using apt-get or yum.

Anyways the best git module for this bootloader code is:
https://git.gnome.org/browse/gnome-ostree-integration

A few comments on the code itself:

* Wouldn't dd be better than cat?  It will try harder to do the write
  in one block I believe.  Look at the Yocto code which
  does:

  dd if=${STAGING_LIBDIR}/syslinux/mbr.bin of=$IMAGE conv=notrunc

* Setting the partition active is probably something we should have
  done earlier at libguestfs time, though it doesn't hurt to do it
  here.  Looks like that's just a matter of "part-set-bootable".

And finally the biggest change happens in ostbuild (checkout the last
6 commits) : https://github.com/djdeath/gnome-ostree/commits/master

This code looks quite reasonable to me (except the commits to the
manifest should change gnome-ostree-integration per above, not ostree).

Thanks a ton for working on this!




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