From 5e15ca7d9cf48305c9aeecdb5e8cffd9d29d940c Mon Sep 17 00:00:00 2001 From: NIN101 Date: Sun, 30 Jun 2013 12:12:04 +0200 Subject: [PATCH] Detect whether internal emmc is mmcblk1 or mmcblk1 at boot and not when mass-storage-enable.sh is called --- etc/init.d/rcS | 14 ++++++++++++-- rescueOS/mass-storage-enable.sh | 9 +++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/etc/init.d/rcS b/etc/init.d/rcS index ed85676..6f085ec 100755 --- a/etc/init.d/rcS +++ b/etc/init.d/rcS @@ -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 diff --git a/rescueOS/mass-storage-enable.sh b/rescueOS/mass-storage-enable.sh index 8ed12aa..e4f8641 100755 --- a/rescueOS/mass-storage-enable.sh +++ b/rescueOS/mass-storage-enable.sh @@ -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 +