[arch-projects] [mkinitcpio] post-image-creation hook

C Anthony Risinger anthony at xtfx.me
Fri Jul 20 13:16:39 EDT 2012

On Fri, Jul 20, 2012 at 7:40 AM, Dave Reisner <d at falconindy.com> wrote:
> On Thu, Jul 19, 2012 at 01:41:16AM -0500, C Anthony Risinger wrote:
>> i'm working on my pandaboard (arm7hf architecture) and making the
>> necessary tweaks to make mkinitcpio compatible OOTB (archlinuxarm.org
>> upstream).
>> the changes are minimal:
>>  - modify `resolve_kernver` to support looking at `uImage files`
> If resolve_kernver is to be extended, I'd prefer a more generic method
> of accessing the kernel version than using file. The current method is a
> hack, as I really don't believe the human readable output is meant to be
> parsed in this way.

i agree, though i'm unsure how that can be done ... if the image is
fully decompressed you can see the version number with a simple
`strings` scan, but decompressing it as a little tricky -- the
extract_image tool in kernel sources scans for magic numbers and
performs other sorcery.

do you have/know any suggestion?


>> - add support for a post-image-creation event
>> need to generate a u-boot compatible uImage from the raw initramfs.  i
>> can do a really nasty hack and call mkinitcpio from within a preset
>> file (ie. nested mkinitcpio ...), run mkimage, then exit ... but
>> that's absolutely disgusting ...
> I've no idea what u-boot is or what it does.

it's just a small boot loader popular in embedded devices -- it has
specific configurations for numerous boards.  a uImage/uInitrd is
little more than a normal kernel/initramfs/<whatever> with a small
header of metadata (entrypoint, load-address, etc).

it's nothing special, but since it wraps the image the `file` command
detects it differently (but correctly, as shown above).


C Anthony

More information about the arch-projects mailing list