Detect whether internal emmc is mmcblk1 or mmcblk1 at boot and

not when mass-storage-enable.sh is called
这个提交包含在:
Albert S. 2013-06-30 12:12:04 +02:00
父节点 6aad08c6ac
当前提交 f68d4015a4
共有 2 个文件被更改,包括 15 次插入8 次删除

查看文件

@ -1,5 +1,6 @@
#!/bin/sh
EMULATOR=0
VERSION="1.1"
mount -t sysfs none /sys
mount -n -t proc none /proc
echo 200 > /sys/class/backlight/acx565akm/brightness
@ -27,7 +28,7 @@ clear
echo "Disclaimer: This system comes without any warranty. Use it at your own risk."
sleep 3
clear
echo "Welcome to N900 Rescue Initrd 1.0"
echo "Welcome to N900 Rescue Initrd $VERSION"
echo
/sbin/loadkmap < /rescueOS/nokia-n900.kmap
@ -46,7 +47,7 @@ touch /run/resolv.conf
echo "The root password is: rootme"
#Being helpful for beginners, and annoying for "power users"
echo "Start an FTP server with anonymous up and downloads everywhere? y/n"
read result;
if [ "$result" = "y" ] ; then
@ -67,6 +68,15 @@ if [ "$result" = "y" ] ; then
/rescueOS/usbnetworking-enable.sh
fi
#node mess
if [ -e /sys/block/mmcblk0 ] && [ -e /sys/block/mmcblk1 ] ; then
echo -n "1" > /run/internal_nodenr
else
echo -n "0" > /run/internal_nodenr
fi
if [ "$EMULATOR" = "1" ] ; then
udhcpc eth0
fi

查看文件

@ -1,10 +1,7 @@
#!/bin/bash
rmmod g_nokia
#stuff changes when sd card is inserted
if [ -e /sys/block/mmcblk0 ] && [ -e /sys/block/mmcblk1 ] ; then
modprobe g_file_storage file=/dev/mmcblk1p2,/dev/mmcblk1p1 stall=0 removable=1
else
modprobe g_file_storage file=/dev/mmcblk0p2,/dev/mmcblk0p1 stall=0 removable=1
fi
nodenr=$(cat /run/internal_nodenr)
modprobe g_file_storage file=/dev/mmcblk"$nodenr"p2,/dev/mmcblk"$nodenr"p1 stall=0 removable=1