[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#683329: flash-kernel: Toshiba AC100 support broken [fix included]



Control: found -1 3.0~rc.2
Control: found -1 3.3+deb7u2
Control: found -1 3.11
Control: tag -1 + patch
Control: severity -1 important

Hi,

Thomas Maass wrote:
> flash-kernel no longer flashs the Toshiba AC100 (Tegra2).
> It shows only Installing version... but no Flashing...
> The last version I remember to work was 3.0rc1.

Actually it was 3.0~rc.1. And the first one which no more worked was
3.0~rc.2.

Ran into that too when switching my AC100 from Ubuntu Precise to
Debian Wheezy -- and it's still present in Debian Jessie/Sid.

Vincent Zweije wrote:
> Trying to flash a new kernel failed - flash-kernel exits early because
> some shell command returned an error code. I have tracked this down to
> faulty boot device detection.
> 
> This little loop from /usr/share/flash-kernel/functions around line 468
> does the detection:
> 
> 		for p in "$android_boot_device"*[0-9]; do
> 			abootimg="$(LC_ALL=C abootimg -i "$p" 2>/dev/null)"
> 			image_size="$(abootimg_get_image_size "$abootimg")"
> 			if [ -n "$image_size" ] &&
> 				[ "$image_size" -gt "$largest_size" ]; then
> 				part="$p"
> 			fi
> 		done
> 
> The assignment to abootimg contains a call to abootimg -i "$p". This
> call fails when the glob pattern on the line above returns a block device
> that is not an android boot image. Since the script is executed with -e,
> this aborts the script.
>
> Adding a "|| :" after the command fixes the problem thus:
> 
> 		for p in "$android_boot_device"*[0-9]; do
> 			abootimg="$(LC_ALL=C abootimg -i "$p" 2>/dev/null || : )"
> 			image_size="$(abootimg_get_image_size "$abootimg")"
> 			if [ -n "$image_size" ] &&
> 				[ "$image_size" -gt "$largest_size" ]; then
> 				part="$p"
> 			fi
> 		done

I came to the same conclusion and patch:

--- functions.orig      2013-10-25 13:58:31.379524139 +0200
+++ functions   2013-10-25 13:40:48.984844024 +0200
@@ -475,7 +475,7 @@
                part=""
                largest_size="-1"
                for p in "$android_boot_device"*[0-9]; do
-                       abootimg="$(LC_ALL=C abootimg -i "$p" 2>/dev/null)"
+                       abootimg="$(LC_ALL=C abootimg -i "$p" 2>/dev/null || true)"
                        image_size="$(abootimg_get_image_size "$abootimg")"
                        if [ -n "$image_size" ] &&
                                [ "$image_size" -gt "$largest_size" ]; then

Tagging the bug report accordingly and raising the severity to
important as this definitely affects all AC100 users.

The probably easiest work-around (i.e. one which doesn't involve
patching) is to use Julian's packages from
http://people.debian.org/~jak/ac100/ which are apt-get-able.

JFTR: Here's a condensed summary of what happens:

# for i in /dev/mmcblk0p*; do echo $i;  abootimg -i $i | fgrep 'image size';  abootimg -i $i >/dev/null 2>&1 ; echo $?; done
/dev/mmcblk0p1
* image size = 5242880 bytes (5.00 MB)
0
/dev/mmcblk0p2
* image size = 8388608 bytes (8.00 MB)
0
/dev/mmcblk0p3
/dev/mmcblk0p3: no Android Magic Value
/dev/mmcblk0p3: not a valid Android Boot Image.

1 ← This is where flash-kernel aborts due to "set -e".
/dev/mmcblk0p4
/dev/mmcblk0p4: no Android Magic Value
/dev/mmcblk0p4: not a valid Android Boot Image.

1
/dev/mmcblk0p5
/dev/mmcblk0p5: no Android Magic Value
/dev/mmcblk0p5: not a valid Android Boot Image.

1
/dev/mmcblk0p6
/dev/mmcblk0p6: no Android Magic Value
/dev/mmcblk0p6: not a valid Android Boot Image.

1
/dev/mmcblk0p7
/dev/mmcblk0p7: no Android Magic Value
/dev/mmcblk0p7: not a valid Android Boot Image.

1
#

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5


Reply to: