From b8a09fe928d205d29c3ff28d1e1af7f3c50c7da0 Mon Sep 17 00:00:00 2001 From: Bryan Stine Date: Mon, 1 Mar 2010 18:14:24 -0500 Subject: [PATCH] Update init script to find the Android path on SD as rootfs init does. --- init | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/init b/init index 594ea3d..c113bdb 100755 --- a/init +++ b/init @@ -31,17 +31,22 @@ dosfsck -y /dev/block/$partition mount -t vfat -o fmask=0000,dmask=0000,rw,flush,noatime,nodiratime /dev/block/$partition /sdcard [ $? -eq 0 ] || fail "Failed to mount the SD card. Cannot continue." -if [ -f /sdcard/android/rootfs.img ] ; then - root="/sdcard/android/rootfs.img" - SQUASHFS=0 -elif [ -f /sdcard/android/rootfs.sqsh ]; then - root="/sdcard/android/rootfs.sqsh" - SQUASHFS=1 -elif [ -f /sdcard/rootfs.img ]; then - root="/sdcard/rootfs.img" +CARD_PATH=`/bin/grep -o "rel_path=.*" /proc/cmdline | /bin/sed -e "s/.*rel_path=//g" -e "s/ .*//g"` + +if [ "$CARD_PATH" = "" ];then + CARD_PATH="andboot" +fi + +if [ -d /sdcard/$CARD_PATH ] ; then + card=/sdcard/$CARD_PATH +else + card=/sdcard + +if [ -f $card/rootfs.img ] ; then + root="$card/rootfs.img" SQUASHFS=0 -elif [ -f /sdcard/rootfs.sqsh ]; then - root="/sdcard/rootfs.sqsh" +elif [ -f $card/rootfs.sqsh ]; then + root="$card/rootfs.sqsh" SQUASHFS=1 else fail "Failed to find rootfs on SD Card. You need to unzip a rootfs zip file to the root of your SD card." -- 2.1.4