Skip to content

After the image is built

 2 min A PandaBoard needed one more image-wrapping step after mkinitcpio, and the available extension points ran at the wrong stage.
Published

Jul 19, 2012

I was adapting an Arch Linux ARM setup on a PandaBoard. The initramfs was not the last artifact the bootloader needed. After generating it, I still needed to wrap it for U-Boot.

The desired sequence was simple:

assemble initramfs → wrap completed image → bootloader reads wrapped image

My message to arch-projects asked where to attach that final step. I considered invoking mkinitcpio recursively from a preset, then running mkimage and exiting. In a follow-up I considered using the compression filter as a general output filter. Both reused an existing extension point for a stage it did not directly name.

There was a second boundary at the input. The U-Boot kernel image carried a wrapper whose human-readable description included a Linux version string. I asked about extending kernel-version detection to recognize it. Dave Reisner pushed back on parsing file output: its human-readable description was not a good machine interface, and the image label was not necessarily an authoritative version recovered from the kernel.

The post-image hook remained a proposal. This ARM image format also differed from the later x86 bzImage version probe, which read a documented offset in the boot header.

Both questions came from the same mismatch in the build pipeline. A completed initramfs still needed packaging, and a recognizable wrapper still did not necessarily expose the identity of its contents. The useful extension point would name the stage directly, instead of making a preset or compression setting impersonate it.