Replacing guestfish's bootloader by our own



Hi there,

Over the past few weeks I've run into problems to get a working ostree builder to run on my machine.
The most problematic thing ended up being the bootloader used by ostbuild when building a qemu image.
Currently guestfish is used to create partitions on the qemu image generated for smoketests. Guestfish is also used to install a working bootloader onto the image. It turns out that the bootloader version installed by guestfish depends on what's in your distro. So on Fedora it's usually grub1, but on my Debian it turns out to be grub2. Which means the config file generated by ostbuild can't work on all systems.
Ideally I think it would be nice to use whatever bootloader we choose and not rely on the system dictate what ends up in the image. So I came up with the idea of booting the generated qemu image with qemu itself but to bypass the bootloader with the -kernel/-initrd/-append options of qemu. And directly boot into a custom systemd target to install our own bootloader. Once we've booted the image a first time with this, it magically becomes bootable without specific qemu options.

Currently I selected syslinux as bootloader because it's available in Yocto and it also has a very simple config file.

So here are the modifications I came up with :

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

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

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

Hope that gets people's interest :)

Cheers,
-
Lionel


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