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

2013-10-25 Thread Axel Beckert
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 21 ; 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 a...@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


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2012-09-03 Thread Vincent Zweije
Package: flash-kernel
Version: 3.2
Followup-For: Bug #683329

Dear Maintainer,

This is probably the same bug, although the original report contains
close to zero information...

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

-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (800, 'precise-updates'), (800, 'precise-security'), (800, 
'precise'), (700, 'testing'), (650, 'unstable'), (600, 'stable')
Architecture: armel (armv7l)

Kernel: Linux 3.0.27-1-ac100 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to C.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages flash-kernel depends on:
ii  devio1.2-1build1
ii  initramfs-tools  0.99ubuntu13
ii  linux-base   3.4ubuntu2

flash-kernel recommends no packages.

Versions of packages flash-kernel suggests:
ii  u-boot-tools  2011.09-2

-- Configuration Files:
/etc/initramfs/post-update.d/flash-kernel changed [not included]
/etc/initramfs/post-update.d/zz-flash-kernel changed [not included]

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org