Making own uImage

Discussion about U-Boot and the kernel.

Making own uImage

Postby ineiti » Thu Jan 02, 2014 11:47 am

Hello everybody,

happy new year - I'm trying to make my own uImage (to insert some custom hooks) on a Smileplug. However, I don't understand how I'm supposed to fit it together. By installing linux-mvebu-smileplug and linux-mvebu, I get the uImage and zImage file. By reading PKGSOURCE I think that

$this->bbcode_second_pass_code('', 'mkimage( zImage + dtb ) => uImage')

is that correct? Where does mkinitcpio come in? Does it create a zImage? Then why are these different?

$this->bbcode_second_pass_code('', '# file /boot/zImage.created_from_mkinitcpio
/boot/zImage.created_from_mkinitcpio: ASCII cpio archive (SVR4 with no CRC)
# file /boot/zImage
/boot/zImage: floppy with old FAT filesystem, Media descriptor 0xfb
')

Help! I'm lost...

Linus
ineiti
 
Posts: 39
Joined: Fri Aug 23, 2013 9:03 pm

Re: Making own uImage

Postby pepedog » Thu Jan 02, 2014 12:24 pm

pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Making own uImage

Postby ineiti » Thu Jan 02, 2014 2:01 pm

Yes, I looked at that. I did find the line

$this->bbcode_second_pass_code('', 'make ${MAKEFLAGS} zImage modules dtbs
')

which makes me think (hope) that some special mkinitcpio-thingie is happening in the Linux-kernels. But I haven't compiled one in years (I think I even left out the 2.6-series ;), and downloading 70MB is slow over 64kbps... So instead of hacking around, I was hoping for a quick answer...

The other lines I found are

$this->bbcode_second_pass_code('', '  cat arch/$KARCH/boot/zImage arch/$KARCH/boot/dts/armada-370-smileplug.dtb > myimage
  mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "${pkgname}" -d myimage "${pkgdir}/boot/uImage"
')

Which I interpreted as

$this->bbcode_second_pass_code('', 'mkimage( zImage + dtb )')

But I'm not sure how the kernel-Makefile creates the zImage! In fact I just searched through the linux-source (lxr-sites) and didn't find any reference to mkinitcpio. Aww crap, next time I buy Windows-compatible stuff and then when it doesn't work just complain that if this would be open-source, I could hack it myself :(
ineiti
 
Posts: 39
Joined: Fri Aug 23, 2013 9:03 pm

Re: Making own uImage

Postby pepedog » Thu Jan 02, 2014 4:49 pm

I think you are confusing things, mkinitcpio makes a ram device, generally we don't use them
Most arm just make uImage does the job, but this device needs device tree appended, it's a new way to define what devices and settings are needed, mkimg is just a wrapping tool
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Making own uImage

Postby moonman » Fri Jan 03, 2014 12:38 am

what exactly are you trying to accomplish?

initrd = initial ramdiak with some bits from rootfs to load the drivers/check fs before the actual rootfs is mounted, like pepedog said we don't use it before kernels already have all the necessary stuff built it, but you can use it if you need to.
uImage = actual kernel image for u-boot
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Making own uImage

Postby ineiti » Fri Jan 03, 2014 8:41 am

Yes, I'm sure I'm confusing things ;) But I'd like to clear things up. So, you say

    The zImage is just the kernel
    The uImage is the kernel and the DT
    mkinitcpio is not used at all - no ramdisk

So all my efforts with mkinitcpio were in fact in vain :( Thanks for clearing things up! So you could remove the "mkinitcpio"-dependency in the kernels?
ineiti
 
Posts: 39
Joined: Fri Aug 23, 2013 9:03 pm

Re: Making own uImage

Postby WarheadsSE » Fri Jan 03, 2014 2:41 pm

Well, then if people wanted to use an initrd they made since we don't supply one, they'd be stuck a bit.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 3 guests