Собираю рамдиск для запуска android. Перед запуском самого андроида необходимо смонтировать два образа с sd карточки. MAKEDEVS - скрипт, который создает нужные устройства в /dev. В чем проблема? Весь скрипт отрабатывает нормально, но - init от андроида не выполняется, хоть ты тресни. в логе вижу вот такую картину(добавлено немного дебага):
sdcard mounted
data loop setup
data mounted
system loop setup
system mounted
Failed to mount the SD card. Cannot continue.
Failed to mount the SD card. Cannot continue.
Failed to mount the SD card. Cannot continue.
Failed to mount the SD card. Cannot continue.
Failed to mount the SD card. Cannot continue.
Вот код скрипта:
#!/bin/sh
mkdir -m 0755 /proc
mount -t proc proc /proc
mkdir -m 0755 /sys
mount -t sysfs sys /sys
#Configure Devices
MAKEDEVS
fail() {
echo "Failed"
echo "$1"
exec /bin/sh
}
while [ ! -d /sys/block/mmcblk0 ] ; do
echo "Waiting for SD Card"
sleep 1
done
sleep 2
partition="mmcblk0p1"
mkdir -m 0777 /sdcard
echo "Running an fsck on the SD card"
dosfsck -y /dev/block/$partition
mount -t vfat -o fmask=0000,dmask=0000,utf8,rw,flush,noatime,nodiratime /dev/block/$partition /sdcard
[ $? -eq 0 ] || fail "Failed to mount the SD card. Cannot continue."
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="Android"
fi
card=/sdcard/$CARD_PATH
mkdir -m 0755 /data
losetup /dev/block/loop0 $card/data.img
[ $? -eq 0 ] || fail "Failed to mount data on SD Card."
e2fsck -y /dev/block/loop0
mount -t ext2 -o noatime,nodiratime,sync /dev/block/loop0 /data
[ $? -eq 0 ] || fail "Failed to mount data"
mkdir -m 0755 /system
losetup /dev/block/loop1 $card/system.ext2
[ $? -eq 0 ] || fail "Failed to mount system on SD Card."
e2fsck -y /dev/block/loop1
mount -t ext2 -o noatime,nodiratime /dev/block/loop1 /system
[ $? -eq 0 ] || fail "Failed to mount system"
echo "Switching to android init..."
exec /init.android