linaro-media-create sets wrong boot command if --image_file used

Bug #638966 reported by Peter Maydell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Image Tools
Fix Released
Undecided
Matt Waddel

Bug Description

If you build an image with linaro-media-create and ask it to write to file with the --image_file option, the resulting SD card image is setup with a boot.cmd which does not try to load the uInitrd. The effect is that when you dd the image to an SD card[*] then a Beagle XM board will boot the kernel but the kernel will fail to find its root filesystem.

This appears to be deliberate in that there's an explicit conditional in prepare_sources() which writes different contents to binary/boot.cmd if IMAGE_FILE is set, but there's no rationale explaining why this is done.

I think that the script should write binary-identical data to either the file (if --image_file) or the sd card device (if --mmc); if there's a use case where you might want a different boot command then this ought to be controlled by an independent option.

[*] I can't just get the script to write to the card because the script doesn't produce working images if run under karmic and doesn't work with --mmc if run in a chroot.

Related branches

Revision history for this message
Alexander Sack (asac) wrote :

i think this is matt's domain; assigning to him

Changed in linaro-image-tools:
assignee: nobody → Matt Waddel (mwaddel)
status: New → Confirmed
Revision history for this message
Torez Smith (lnxtorez) wrote :

Matt, I noticed is also does not work under karmic while inside lucid-chroot, especially if --hwpack

So it seems the script works best if your host system is lucid or better.

Revision history for this message
Steve Langasek (vorlon) wrote :

Matt,

You mention in bug #627607 that you would like this bug fixed, and I see that Alexander has assigned it to you. Do you need any help here?

Revision history for this message
Peter Maydell (pmaydell) wrote :

One hypothesis about why the script writes different things with and without --img_file= is that it was trying to work around some qemu issue which meant it couldn't cope with the initrd.

I can confirm that (if bug 658511 is fixed) qemu can now successfully boot the sort of image which you get if you remove the special-casing of the boot command for if [ $IMAGE_FILE ]. So if that was ever the reason for this behaviour, we don't need it any more.

Revision history for this message
Matt Waddel (mwaddel) wrote :

I think this bug has morphed into 3 separate things:

1) the --image_file created for use on a qemu system won't run on real hardware
2) the linaro-media-create script has problems on distributions prior to lucid
3) the images created for qemu have alignment issues

So I think issues related to item 1) should be covered with this bug. Issues
with item 2) should move to lp:627607 and 3) should move to lp:658511.

Revision history for this message
Peter Maydell (pmaydell) wrote :

1) the --image_file created for use on a qemu system won't run on real hardware

How about "the --image_file won't run on qemu either" ? At the moment the kind of image produced by the --image_file option doesn't boot on qemu (it hangs trying to mount the rootfs), whereas if you fiddle the script to just generate the same image we would write to an mmc card this boots fine.

Matt Waddel (mwaddel)
Changed in linaro-image-tools:
status: Confirmed → In Progress
Matt Waddel (mwaddel)
Changed in linaro-image-tools:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.