flash-kernel doesn't handle uboot in mx51evk

Bug #723082 reported by Amit Kucheria
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Fix Released
Undecided
Ying-Chun Liu

Bug Description

Binary package hint: flash-kernel

Though we've switched to uboot in the mx51 boards, flash-kernel is still written for redboot. Because of this, upgrading to a new kernel doesn't work

Tags: patch armel
Oliver Grawert (ogra)
tags: added: armel
Revision history for this message
Ying-Chun Liu (paulliu) wrote :

The patch should fix the problem.
But please allow me to test it more before upload. Thanks..:)
Any suggestions also please let me know.

Changed in flash-kernel (Ubuntu):
assignee: nobody → Ying-Chun Liu (paulliu)
status: New → In Progress
tags: added: patch
Revision history for this message
Ying-Chun Liu (paulliu) wrote :

This is the proposed patch for change IMX51 to use u-boot and add IMX53 Loco board support.

Revision history for this message
Ying-Chun Liu (paulliu) wrote :

Rebase the patch on flash-kernel-2.28ubuntu15

Revision history for this message
Loïc Minier (lool) wrote :

From a quick look, there seems to be trivial indentation mismatches:
+ mount $UBOOT_PART $TMPMOUNT
+ tmp=$(tempfile)
in general flash-kernel uses tabs upstream, and pretty much never spaces.

Writing to $tmp.uboot is unsafe as this filename is predictable; would be nicer to always generate a new tempfile (one for kernel, one for initrd), or use a tempdir and stores them below, or reuse the tempfile but only delete it once you're finished with it.

Otherwise, this looks good to me.

I guess we don't want to support RedBoot anymore, nor upgrades from RedBoot.

Is "imx51" the only kernel extension we want to support? What about linux-linaro-mx51?

Revision history for this message
Ying-Chun Liu (paulliu) wrote :

Thanks. I'll look into linux-linaro-mx51 support. I think we need to upgrade to mx51 in natty. I'll rewrite the patch. Thanks.

Revision history for this message
Ying-Chun Liu (paulliu) wrote :

New patch:
 * Re-base on flash-kernel-2.28ubuntu16
 * Use tab for indent.
 * Use safe method to handle temp files
 * Support imx51 and mx51 subarch for IMX51 board.

Revision history for this message
Loïc Minier (lool) wrote :

Looks much better; some comments:
* the check_subarch tests are a bit weird:
+>------>-------case $subarch in.
+>------>------->-------"imx51")
+>------>------->------->-------check_subarch "imx51"
+>------>------->-------;;
+>------>------->-------*)
+>------>------->------->-------check_subarch "mx51"
+>------>------->-------;;
+>------>-------esac
since check_subarch checks subarch against that value, the first one is basically if imx51 == imx51, and the second one will randomly fail.

There is simply no code showing how to allow multiple kernels for a single board, so either don't call check_subarch, or implement your own test + error message. You could abuse this a bit with:
case $subarch in
imx51|mx51)
  :
;;
*)
  # not actually the real expected kfile subarch, but will raise a sensible error
  check_subarch "mx51 or imx51"
;;

+>------cp "$tmp" $TMPMOUNT/uInitrd
+>------rm -f "$tmp"

Maybe you could just mv? Doesn't matter much though.

+>------rm -rf $TMPMOUNT
This should be rmdir; ifyou can do with just a rmdir, you're risking less data than if you use rm -rf.

Revision history for this message
Ying-Chun Liu (paulliu) wrote :

OK. Update again.
 * Change the subarch check code as lool's comment #7
 * Change "rm -rf" to rmdir.

Revision history for this message
Loïc Minier (lool) wrote :

Uploaded with some tweaks:
* nicer error message
* support imx5 and DON'T support imx51

Revision history for this message
Ying-Chun Liu (paulliu) wrote :

Hi Amit,
I've confirmed that this bug is fixed. Both on imx51 and imx53 boards.
I'm about to close this bug soon.
Any further comments?

Revision history for this message
Ying-Chun Liu (paulliu) wrote :

Source: flash-kernel
Source-Version: 2.28ubuntu17

We believe that the bug you reported is fixed in the latest version of
flash-kernel, which is due to be installed in the natty/main archive:

Changed in flash-kernel (Ubuntu):
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.