|
2011-04-20
, 13:23
|
Posts: 268 |
Thanked: 1,053 times |
Joined on May 2010
@ The Netherlands
|
#2
|
sfdisk -c /dev/mmcblk0 26
echo "/dev/mmcblk1p1 /home/user/MyDocs vfat $fat_opts 0 0" >> $tmp_fstab
/bin/mount /home/user/MyDocs
if [ $# = 1 ]; then DEV=/dev/mmcblk1p1 STR=`cat $LUN0` if [ "x$STR" = "x" ]; then # echo $1 > $LUN0 echo $DEV > $LUN0 else echo $1 > $LUN1 fi fi exit 0
mount /home/user/MyDocs exit 0
The Following 4 Users Say Thank You to iDont For This Useful Post: | ||
|
2011-04-25
, 14:47
|
Posts: 21 |
Thanked: 7 times |
Joined on Jul 2010
@ Ipswich, England
|
#3
|
|
2011-04-25
, 18:02
|
Posts: 268 |
Thanked: 1,053 times |
Joined on May 2010
@ The Netherlands
|
#4
|
I don't know what went wrong there, but now my N900 just keeps showing the white "NOKIA" screen, going blank and then repeating itself.
|
2011-04-25
, 18:09
|
Posts: 21 |
Thanked: 7 times |
Joined on Jul 2010
@ Ipswich, England
|
#5
|
|
2011-04-26
, 15:53
|
Posts: 21 |
Thanked: 7 times |
Joined on Jul 2010
@ Ipswich, England
|
#6
|
start on MYDOCS_REPLACED
description "unmounts normal MyDocs filesystem and replaces it with the SD card" # Runs afer rcS-late has mounted everything start on MOUNTS_OK console none script # Alter the next six lines if necessary for your system MYDOCS_DEVICE=/dev/mmcblk0p1 SD_DEVICE=/dev/mmcblk1p1 MYDOCS_MOUNTPOINT=/home/user/MyDocs MYDOCS_FILESYSTEM=vfat SD_MOUNTPOINT=/media/mmc1 SD_FILESYSTEM=vfat # Check that MyDocs hasn't already been replaced if [ ! -z "`mount | grep $MYDOCS_MOUNTPOINT | grep $SD_DEVICE`" ] then # Already mounted. normal exit 0 fi # It can take a few seconds for MyDocs to actually mount after rsS-late # has finished, so we'll watch for it i=0 while [ -z "`mount | grep $MYDOCS_MOUNTPOINT`" -o -z "`mount | grep $SD_MOUNTPOINT`" ] do i=$(($i+1)) if [ $i -eq 120 ] then # If it hasn't mounted within two minutes, something's gone # horribly wrong, so we may as well give up normal exit 0 fi sleep 1 done # Get mount options from the fstab file OPTS=`grep $MYDOCS_MOUNTPOINT /etc/fstab | awk ' { print $4 } '` # Unmount the SD card umount $SD_MOUNTPOINT # Check it unmouted OK if [ $? -eq 0 ] then # Unmount the MyDocs filesystem umount $MYDOCS_MOUNTPOINT # Check it unmounted OK if [ $? -eq 0 ] then # Mount the SD on MyDocs mount $SD_DEVICE -t $SD_FILESYSTEM -o "$OPTS" $MYDOCS_MOUNTPOINT if [ $? -ne 0 ] then # Failed to mount the SD so fall back to original mount $MYDOCS_DEVICE -t $MYDOCS_FILESYSTEM -o "$OPTS" $MYDOCS_MOUNTPOINT else initctl emit MYDOCS_REPLACED fi fi fi end script normal exit 0
|
2011-05-06
, 15:47
|
Posts: 21 |
Thanked: 7 times |
Joined on Jul 2010
@ Ipswich, England
|
#7
|
description "unmounts normal MyDocs filesystem and replaces it with the SD card" # Runs afer rcS-late has mounted everything start on MOUNTS_OK console none script MYDOCS_DEVICE=/dev/mmcblk0p1 SD_DEVICE=/dev/mmcblk1p1 MYDOCS_MOUNTPOINT=/home/user/MyDocs MYDOCS_FILESYSTEM=vfat SD_MOUNTPOINT=/media/mmc1 SD_FILESYSTEM=ext3 # Check that MyDocs hasn't already been replaced if [ ! -z "`mount | grep $MYDOCS_MOUNTPOINT | grep $SD_DEVICE`" ] then # Already mounted. normal exit 0 fi # It can take a few seconds for MyDocs to actually mount after rsS-late # has finished, so we'll watch for it i=0 if [ $SD_FILESYSTEM == "vfat" ] then # The SD will auto-mount if if's vfat, but won't otherwise. So if it's vfat # we want to wait until it's been mounted so we don't interrupt while [ "`mount | grep $SD_MOUNTPOINT`" ] do i=$(($i+1)) if [ $i -eq 120 ] then # If it hasn't mounted within two minutes, something's gone # horribly wrong, so we may as well give up normal exit 0 fi sleep 1 done fi i=0 while [ -z "`mount | grep $MYDOCS_MOUNTPOINT`" ] do i=$(($i+1)) if [ $i -eq 120 ] then # If it hasn't mounted within two minutes, something's gone # horribly wrong, so we may as well give up normal exit 0 fi sleep 1 done if [ $SD_FILESYSTEM == "vfat" ] then # Get mount options from the fstab file OPTS=`grep $MYDOCS_MOUNTPOINT /etc/fstab | awk ' { print $4 } '` else # We don't want the mount options from fstab, as some are invalid for # other filesystems. OPTS="noauto,nodev,nosuid,noatime,nodiratime" fi if [ $SD_FILESYSTEM == "vfat" ] then # Unmount the SD card umount $SD_MOUNTPOINT # Check it unmouted OK if [ $? -ne 0 ] then exit fi fi # Unmount the MyDocs filesystem umount $MYDOCS_MOUNTPOINT # Check it unmounted OK if [ $? -eq 0 ] then # Mount the SD on MyDocs mount $SD_DEVICE -t $SD_FILESYSTEM -o "$OPTS" $MYDOCS_MOUNTPOINT if [ $? -ne 0 ] then # Failed to mount the SD so fall back to original mount $MYDOCS_DEVICE -t $MYDOCS_FILESYSTEM -o "$OPTS" $MYDOCS_MOUNTPOINT else initctl emit MYDOCS_REPLACED fi fi end script normal exit 0
|
2014-06-11
, 12:41
|
Posts: 58 |
Thanked: 134 times |
Joined on Dec 2012
@ Vilnius, Lithuania
|
#8
|
if [ $# = 1 ]; then umount /home/user/MyDocs STR=`cat $LUN0` if [ "x$STR" = "x" ]; then echo $1 > $LUN0 else echo $1 > $LUN1 fi fi exit 0
mount /home/user/MyDocs exit 0
|
2014-06-11
, 16:33
|
Posts: 2,102 |
Thanked: 1,937 times |
Joined on Sep 2008
@ Berlin, Germany
|
#9
|
|
2014-06-12
, 07:53
|
Posts: 58 |
Thanked: 134 times |
Joined on Dec 2012
@ Vilnius, Lithuania
|
#10
|
I seem to have a problem with the MyDocs filesystem, so I'd like to use an SD card instead.
I know I could play around with mountpoints with an upstart script, but it would be infinitely better to somehow persuade the startup to assign and mount it in the first place.