Package: flash-kernel
Severity: wishlist
This bug is for adding support for the Toshiba AC100, a
Tegra 2 based notebook, to flash-kernel. The AC100 boots
from an Android boot partition located on its internal
eMMC storage.
I am including the code currently used in the
“Toshiba Tegra AC100 Hardware enablement” PPA
for Ubuntu, written by Oliver Grawert.
We could in generalise this a bit by replacing
ac100 with android, the code probably works
for multiple other Android devices as well.
A Recommends/Suggests for abootimg would need
to be added as well.
-- Current code:
"Toshiba AC100 / Dynabook AZ")
AC_IMG=""
AC_SIZE=""
AC_MMC="/dev/mmcblk0"
TMPIMAGE=$(tempfile)
CONFIG=""
find_ac100_bootpart()
{
for dev in $(ls ${AC_MMC}?? 2>/dev/null); do
if abootimg -i $dev >/dev/null 2>&1; then
size=$(abootimg -i $dev |grep "image size"|cut -d ' ' -f5)
if [ $size -gt 5242880 ]; then
AC_IMG=$dev
AC_SIZE=$size
return 0
fi
fi
done
return 1
}
build_ac100_bootimage()
{
if [ -e /boot/bootimg.cfg ]; then
abootimg --create $TMPIMAGE -f /boot/bootimg.cfg -k $kfile \
-r $ifile >/dev/null 2>&1 || return 1
imagesize=$(wc -c "$TMPIMAGE" | awk '{print $1}')
check_size "Bootimage" $imagesize $AC_SIZE
else
printf "Could not find /boot/bootimg.cfg."
return 1
fi
}
write_ac100_bootimage()
{
printf "Writing boot image to $AC_IMG ... "
dd if=$TMPIMAGE of=$AC_IMG >/dev/null 2>&1 || return 1
echo "done." >&2
}
if ! find_ac100_bootpart; then
rm -rf $TMPIMAGE
error "Could not find boot image partition on $AC_MMC."
fi
if ! build_ac100_bootimage; then
rm -rf $TMPIMAGE
error "Could not create temporary boot image."
fi
if ! write_ac100_bootimage; then
rm -rf $TMPIMAGE
error "Can not flash to $AC_IMG"
fi
rm -rf $TMPIMAGE
;;
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (950, 'unstable'), (250, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-rc2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Attachment:
pgpmHPfdJK5zn.pgp
Description: PGP signature