[arch-projects] [mkinitcpio] post-image-creation hook
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` # file /boot/uImage /boot/uImage: u-boot legacy uImage, Linux-3.4.4-1-ARCH, Linux/ARM, OS Kernel Image (Not compressed), 4557120 bytes, Mon Jul 16 21:32:19 2012, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0xD586CD31, Data CRC: 0xE965D864 ... i'm not sure the `Linux-3.4.4-ARCH` tag is generated though, i think its just assigned during creation. i extracted the zImage (not a bzImage) from the uImage, but the `file` output is near worthless (i think the ARM guys are stripping it or something). - 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 ... solution? -- C Anthony
On Thu, Jul 19, 2012 at 1:41 AM, C Anthony Risinger <anthony@xtfx.me> wrote: [...]
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 ...
... or i can abuse the COMPRESSION filter, which is actually kind of elegant, but still a hack. it might be pacman hooks that i really want, not sure, just want more methods of linking into the process. -- C Anthony
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.
# file /boot/uImage /boot/uImage: u-boot legacy uImage, Linux-3.4.4-1-ARCH, Linux/ARM, OS Kernel Image (Not compressed), 4557120 bytes, Mon Jul 16 21:32:19 2012, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0xD586CD31, Data CRC: 0xE965D864
... i'm not sure the `Linux-3.4.4-ARCH` tag is generated though, i think its just assigned during creation. i extracted the zImage (not a bzImage) from the uImage, but the `file` output is near worthless (i think the ARM guys are stripping it or something).
- 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.
solution?
--
C Anthony
On Fri, Jul 20, 2012 at 7:40 AM, Dave Reisner <d@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
participants (2)
-
C Anthony Risinger
-
Dave Reisner