Skipping the bootloader installation when creating rootfs or installation media
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
flash-kernel (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
initramfs-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: initramfs-tools
Hi
update-initramfs will unconditionally:
a) generate an initrd.gz
b) do bootloader specific logic to use the new boot files on the current system
I would like update-initramfs to support some tunable to disable the b) step, here are the use cases for this:
a) I'm on an ARM machine, I want to create a rootfs natively, including an installed kernel (with modules) and a prebuilt initrd, but I don't want flash-kernel to write the kernel from the chroot into the NAND flash of the build system
b) I'm on a x86 machine, I want to create a rootfs using qemu / qemu-debootstrap, including an installed kernel 9with modules) and a prebuilt initrd, but flash-kernel --supported would be confused by my x86 cpuinfo and would fail out, breaking the initramfs generation
c) I'm on a x86 system, and I'm writing a boot media (e.g. SD card) starting from a generic rootfs I downloaded, but installing the target kernel onto the SD card; same issue as b) occurs
Linaro is currently doing a) because we use live-helper to generate images with the kernel and initrd in the downloadable tarball.
Debian/Ubuntu currently don't install a kernel or flash-kernel at image creation time, but rather at the time the system gets installed (d-i / ubiquity installs flash-kernel in /target and the target kernel as well, and the kernel gets installed and the system is made bootable using these).
I'm personally doing b) and recommending more people to do so as a quick way to create their rootfs locally, without access to ARM hardware; I'd also like Linaro's a) method with live-helper to work with qemu-arm as well in the future.
Eventually, Linaro will be moving to c), where we build a generic rootfs with live-helper, and combine it with hardware specific packages like the kernel and flash-kernel on the system where the boot media is created, which would be an end-user's x86 box writing a SD card or something like that.
So the proposed change is to either add some tunable like an env var or a do_bootloader = no option to initramfs-tools to skip run_bootloader() entirely, but I'm told this should be done by hooks nowadays. This bug is to discuss how this is best handled.
Cheers,
BTW a) might also fail because the host image buildd isn't supported by flash-kernel.