Author Topic: /home on SD and OpenZaurus 3.5.1  (Read 4483 times)

darac

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • http://www.darac.org.uk
/home on SD and OpenZaurus 3.5.1
« on: September 09, 2004, 02:25:52 pm »
Does anyone here use an SD card as their home directory under the new OZ3.5.1 or even 3.3.6pre1?

If so, how stable is it?

I'm really pleased with my 3.3.5 with the above configuration, but the one annoying thing is that the SD module doesn't seem to like suspending. This means that every time I want to turn the Z off, I've got to halt it.

If one of the newer versions has a better SD module, then I think I'll be switching over proto  :-)
--
SL-5500 (Collie)
OpenZaurus 3.3.5 (64/0)
Kingston 128Mb SD
TwinMOS/DabsValue 256Mb CF
Mavin MFC-M2.1 Bluetooth CF
ExtremeLimit Leather BodySuit
zThinUSB cable

asmar

  • Newbie
  • *
  • Posts: 9
    • View Profile
/home on SD and OpenZaurus 3.5.1
« Reply #1 on: September 15, 2004, 05:59:25 pm »
Quote
Does anyone here use an SD card as their home directory under the new OZ3.5.1 or even 3.3.6pre1?

If so, how stable is it?

I'm really pleased with my 3.3.5 with the above configuration, but the one annoying thing is that the SD module doesn't seem to like suspending. This means that every time I want to turn the Z off, I've got to halt it.

If one of the newer versions has a better SD module, then I think I'll be switching over proto  :-)
Hi,

I just installed /home /opt /root on my 256MB Lexus SD card and is working like a charm.

 

Teletubbie

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
    • http://
/home on SD and OpenZaurus 3.5.1
« Reply #2 on: September 15, 2004, 06:58:14 pm »
having that on a panasonic highspeed.
I recommend hentges.net rom
Cheers,
Sam
SL-5500G
OZ 3.3.6-pre1
Opie 1.1.4

Teletubbie

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
    • http://
/home on SD and OpenZaurus 3.5.1
« Reply #3 on: September 15, 2004, 07:01:20 pm »
SL-5500G
OZ 3.3.6-pre1
Opie 1.1.4

technojunkie

  • Full Member
  • ***
  • Posts: 172
    • View Profile
/home on SD and OpenZaurus 3.5.1
« Reply #4 on: November 08, 2004, 03:53:11 pm »
I'm beginning to get the feeling that the problem with sd cards not liking to suspend is more a problem with the cards than any ROM/driver issue. I have now tries OZ 64/0, crow 64/0, and tkcROM 64/0 all with home on sd. and every ROM requires reboot after resume. I just didn't want to blame my SD card cuz Lexar has high repute here. But then again home on sd may be more demanding than just extra storage...
SL 5500 Cacko 3.10 ROM 64-0, Symbol Wifi
storage on 256MB Lexar High Speed SD card
64MB/32MB CF cards for removable storage.
---------------------------------------------------------
Doing my part to keep the 5500 platform alive

ozric100

  • Newbie
  • *
  • Posts: 9
    • View Profile
/home on SD and OpenZaurus 3.5.1
« Reply #5 on: November 09, 2004, 12:17:41 pm »
I had the suspend issues with a total root on SD card.  I used a script the moves everything to SD while mounted with option sync.   It takes along time to do that, but ..  Now I can suspend and resume with out issues most of the time.  Once in a awhile ..  my wifi card with hang up,  and I will have to do a hard boot with the battery switch.

I will find the link to the the script for you later today.

ozric100

  • Newbie
  • *
  • Posts: 9
    • View Profile
/home on SD and OpenZaurus 3.5.1
« Reply #6 on: November 09, 2004, 01:11:10 pm »
Code: [Select]
#!/bin/sh
#
# Author: Daniel Steen
# Email: daniel@steen-family.com # but your better off writing to:
# oe@handhelds.org
#
# Script to setup a Zaurus system to boot from the sd card (/mnt/card).
#
# I don't really know very much about shell scripting so this script is not
# very robust. Any suggestions would be most welcome.

# set up our variables
NEWROOT=/mnt/card
#DEVICE=/dev/mmcda1 # this is the future

# remount $NEWROOT with the sync option. This makes everything very slow,
# but it prevents corruption. if you want to risk it but speed things up alot
# comment this out
mount -o remount,sync $NEWROOT

# copy the files
echo "Copying /bin"
cp -a /bin /$NEWROOT/
echo "Copying /etc"
cp -a /etc /$NEWROOT/
echo "Copying /home"
cp -a /home /$NEWROOT/
echo "Copying /lib"
cp -a /lib /$NEWROOT/
echo "Copying /opt"
cp -a /opt /$NEWROOT/

# if you want to link the root folder comment in the next 2 lines this will
# speed up writes to your home folder because it is on internal memory,
# however you are now dependent on internal memory. This was more of an
# issue for pre-3.5.1 releases as 3.5.1 runs much faster.
echo "Copying /root"
cp -a /root /$NEWROOT/

echo "Copying /sbin"
cp -a /sbin /$NEWROOT/
echo "Copying /tmp"
cp -a /tmp /$NEWROOT/
echo "Copying /usr"
cp -a /usr /$NEWROOT/
echo "Copying /boot"
cp -a /boot /$NEWROOT/
echo "Copying /sys"
cp -a /sys /$NEWROOT/

# /dev is a special case and only some files are copied
mkdir /$NEWROOT/dev
cp -a /dev/hda /dev/mem /dev/tty /dev/hda1 /dev/hda2 /dev/hda3 /dev/hda4 /dev/hda5 /dev/hda6 /dev/hda7 /dev/hda8 /dev/hda9 /dev/kmem /dev/mtd0 /dev/mtd1 /dev/mtd2 /dev/mtd3 /dev/mtd4 /dev/mtd5 /dev/mtd6 /dev/mtd7 /dev/null /dev/ram0 /dev/ram1 /dev/ram2 /dev/ram3 /dev/tty0 /dev/tty1 /dev/tty2 /dev/tty3 /dev/tty4 /dev/tty5 /dev/tty6 /dev/tty7 /dev/tty8 /dev/zero /dev/console /dev/hda10 /dev/hda11 /dev/hda12 /dev/hda13 /dev/hda14 /dev/hda15 /dev/hda16 /dev/hda17 /dev/hda18 /dev/hda19 /dev/ttyS0 /dev/initctl /dev/apm_bios /dev/mtdblock0 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock6 /dev/mtdblock7 /dev/ttySA0 /$NEWROOT/dev
# this needs to be changed or opie does some funny things
cp /dev/mmcda1 /$NEWROOT/dev/mmsda1

# If you want to link the root folder uncomment the next two lines
#echo "Linking /root"
#ln -s /mnt/root/root /$NEWROOT/root

# make the folders that we don't copy
echo "Creating folders"
mkdir /$NEWROOT/var
mkdir /$NEWROOT/proc
mkdir /$NEWROOT/mnt
mkdir /$NEWROOT/mnt/root
mkdir /$NEWROOT/mnt/cf
mkdir /$NEWROOT/mnt/net

# copy the /dev/mmcda1 to the actual /dev folder. We have to move the
# ramfs that is mounted on /dev to do this, and then move it back.
# also change the name of mmcda1 to mmsda1 see above
mkdir /dev.tmp
mount -o move /dev /dev.tmp
cp -a /dev.tmp/mmcda1 /dev/mmsda1
mount -o move /dev.tmp /dev
rmdir /dev.tmp

# modify init to pivot the root

echo "Modifying init"

# see if init.org exists
if [ -f /sbin/init.org ]
then
        echo 'Init already modified -'
        echo 'Cleaning up from previous install'
        mv /$NEWROOT/sbin/init.org /$NEWROOT/sbin/init
else

# move the old init and make our new one
cd /sbin
mv init init.org
touch init

echo "#!/bin/sh" >> init
echo " " >> init
echo "#Check to see if we are being run to shutdown" >> init
echo 'if [ "$1" = 0 ] || [ "$1" = 6 ]' >> init
echo "then" >> init
echo ' exec /sbin/init.org "$1"' >> init
echo "fi" >> init
echo " " >> init
echo "# Script to pivot the root to $NEWROOT" >> init
echo " " >> init
echo "echo \"Pivoting Root...\" >> /dev/tty0" >> init
echo " " >> init
echo "/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/block/sharp_mmcsd_m.o" >> init
echo "/bin/mount -t ext2 -o defaults,noatime /dev/mmsda1 $NEWROOT" >> init
echo " " >> init
echo "if [ -f $NEWROOT/sbin/init ]" >> init
echo "then" >> init
echo "if(/sbin/pivot_root $NEWROOT $NEWROOT/mnt/root)" >> init
echo "then" >> init
echo "echo \" Successful\" >> /dev/tty0" >> init
echo 'exec /sbin/init $1' >> init
echo "fi" >> init
echo "fi" >> init
echo " " >> init
echo "echo \" Failed!\" >> /dev/tty0" >> init
echo 'exec /sbin/init.org $1' >> init

# make init executable
chmod a+x init
fi

# modify /etc/device_table. If we don't do this than opie will do some
# funny things happen to opie
echo "modifying $NEWROOT/etc/device_table"
cd $NEWROOT/etc
mv device_table device_table.org
sed -e 's/mmcda1/mmsda1/' < device_table.org > device_table

# uncomment the following 14 lines if you are running 3.5.1 this will
# prevent it from crashing on wake
# create our remount script

echo "adding remount.sh bootscript"
cd $NEWROOT/etc/init.d
touch remount.sh
echo "#!/bin/sh" >> remount.sh
echo " " >> remount.sh
echo "# make sure that we only run if we are running off of the card" >> remount.sh
echo " " >> remount.sh
echo 'if [ ! -f /sbin/init.org ]' >> remount.sh
echo "then" >> remount.sh
echo ' mount -o remount,sync /' >> remount.sh
echo 'fi' >> remount.sh

# make remount.sh executable
chmod a+x remount.sh

# uncomment the following 11 lines if you are using OZ 3.3.6pre1. This will
# will prevent it from crashing on sleep.
#cd $NEWROOT/etc/apm/scripts.d
#touch mount
#echo "#!/bin/sh" >> mount
#echo "if [ \"\$1\" = suspend ]; then" >> mount
#echo " mount -o remount -o ro /" >> mount
#echo "elif [ \"\$1\" = resume ]; then" >> mount
#echo " mount -o remount -o rw /" >> mount
#echo "fi" >> mount
#chmod +x mount
#ln -s ../scripts.d/mount ../suspend.d/S34mount
#ln -s ../scripts.d/mount ../resume.d/R34mount


Try that out.   Like I said ... its working great for me,  but this is a total SD setup not just home.   I can still remove my SD card and boot from the NVram.

ciffus

  • Newbie
  • *
  • Posts: 3
    • View Profile
/home on SD and OpenZaurus 3.5.1
« Reply #7 on: November 16, 2004, 04:30:42 pm »
After following these directions I am still unable to boot off of my sd card.
If I run the pivot root manually after booting up, I am unable to run any of the apps.

Any ideas of where to look?

ozric100

  • Newbie
  • *
  • Posts: 9
    • View Profile
/home on SD and OpenZaurus 3.5.1
« Reply #8 on: November 18, 2004, 02:03:08 pm »
Did run the script from your NVram root  ?  if you did it right you should have this in /sbin

Code: [Select]
/mnt/root/sbin#ls -l init*
-rwxrwxrwx    1 root     root          585 Nov  8 11:33 init
lrwxrwxrwx    1 root     root            8 Nov  2 21:53 init.org -> sysvinit
/mnt/root/sbin#