Author Topic: can you stop losing everything when you hard reset?  (Read 1172 times)

daemon1

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
can you stop losing everything when you hard reset?
« on: May 06, 2004, 07:12:19 pm »
im using the tkcROM...

the only prob i have with it, is if it crashes, and do do a reset, or take the battery out, you lose all your progs installed, settings, everything...

the restore restores the settings, but not all the progs and things you installed...

how can i enable this on tkcROM... in know OZ has small jjfs filesystem for this?
C3000 - Debian EABI - Kernel 2.6.23 of Angstrom

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
can you stop losing everything when you hard reset?
« Reply #1 on: May 06, 2004, 07:27:58 pm »
You didn\'t say which model, but from the probelm it sounds like a 5500, which uses SDRAM as storage.  You need to switch to one of the roms which lets you mount your SD card as home.  The 5500 doesn\'t have enough internal flash to put it there.

daemon1

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
can you stop losing everything when you hard reset?
« Reply #2 on: May 06, 2004, 08:25:45 pm »
yep, im on Z 5500...
so, getting your /home on an SD card does the trick?
it it possible to manually do this on the tkcROM?
C3000 - Debian EABI - Kernel 2.6.23 of Angstrom

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
can you stop losing everything when you hard reset?
« Reply #3 on: May 06, 2004, 08:31:55 pm »
Sorry I don\'t have a 5500 so I can\'t be of more help,  but try searching the forum, I seem to recall some long threads on the topic a few months back.  BTW, mounting /home on SD has an extra benefit that you get the whole 64 megs of RAM available for programs... one of the reasons why some people still prefer the 5500 over the 5600, which is limited to 32 megs RAM.

daemon1

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
can you stop losing everything when you hard reset?
« Reply #4 on: May 06, 2004, 08:59:29 pm »
found the script:

#!/bin/sh
# prep-home-sd.sh
# Author: DSP
# This script should be used in conjunction with a Sharp 3.10 rom or
# TKC rom image that has been modified to support executing an \"rc.card\"
# script from the SD card early in the boot cycle.
# It prepares an SD card so that it can function as a /home filesystem.

# Get commandline arguments
while [ \"$1\" != \"\" ]
do
 case $1 in
 -c) iopt=\"c\"; shift;;
 -i) iopt=\"i\"; shift;;
 -s) swap=$2; shift; shift;;
 -t) tmpfs=\"y\"; shift;;
 -f) fastSD=\"y\"; shift;;
 *) shift;
 esac
done
if [ \"$iopt\" = \"\" ]
then
 echo \"Usage: prep-home-sd.sh\"
 echo \" [-c | -i ] [-s size] [-t]\"
 echo \"This script will set up a\"
 echo \"home-on-sd environment on your\"
 echo \"SD card\"
 echo \"\"
 echo \"Note: This will WIPE OUT your\"
 echo \"current SD card contents!!!\"
 echo \"Options:\"
 echo \" -c -- copy existing ramdisk-\"
 echo \" based /home contents to the\"
 echo \" SD card\"
 echo \"\"
 echo \" -i -- initialize fresh SD\"
 echo \" card. This will also copy\"
 echo \" over a few default settings\"
 echo \" to the SD card (timezone,\"
 echo \" touchscreen calibration etc)\"
 echo \"\"
 echo \" -s size -- create a swapfile\"
 echo \" of specified size megs on\"
 echo \" the ramdisk.\"
 echo \"\"
 echo \" -t -- mount /tmp as a tmpfs\"
 echo \" filesystem type (should be\"
 echo \" used with ramdisk option)\"
 echo \"\"
 echo \" -f -- fast SD mount\"
 echo \" mounts SD card via loopback\"
 echo \" filesystem for write speed\"
 echo \" boost (warning experimental)\"
 exit
fi

if grep \"mmcda1\" /proc/mounts >/dev/null 2>&1
then
 if ! umount /dev/mmcda1
 then
 echo \"Error unmounting SD card\"
 exit
 fi
fi
if ! mke2fs /dev/mmcda1
then
 echo \"Problem encountered in reformatting the SD card\"
 exit
fi
if ! mount -oasync,noatime,loop /dev/mmcda1 /mnt/card
then
 echo \"Can\'t mount the sd card\"
 exit
fi

# Set up a home environment on the SD card


if [ \"$iopt\" = \"c\" ]
then
 # Copy existing ramdisk contents to SD card
 cd /home
 echo \"./swapfile\" >/tmp/sd_exclude.tmp1
 tar -c -X /tmp/sd_exclude.tmp1 -f - . |
 if cd /usr/mnt.rom/card
 then
 tar -xvf -
 fi
elif [ \"$iopt\" = \"i\" ]
then
 # Set up a fresh image on SD card
 cd /usr/mnt.rom/card
 tar -xvf /root/.home_default.tar
 mv home/* .
 rmdir home
 cd system
 tar -xf /root/.var_default.tar
 ### Copy the ssh host keys over to the SD card (for TKC rom)
 cp /home/etc/ssh/*key* /usr/mnt.rom/card/etc/ssh/.
 ### Copy over some default system settings to SD card
 cp /home/etc/MACHINE.SID /usr/mnt.rom/card/etc/.
 cp /home/etc/pointercal /usr/mnt.rom/card/etc/.
 cp /home/zaurus/Settings/locale.conf /usr/mnt.rom/card/zaurus/Settings/.
 cp /home/zaurus/Settings/CityTime.conf /usr/mnt.rom/card/zaurus/Settings/.
 cp /home/zaurus/Settings/Security.conf /usr/mnt.rom/card/zaurus/Settings/.
else
 # Shouldn\'t get here
 echo \"Error\"
 exit
fi
cd /usr/mnt.rom/card
rm -rf /usr/mnt.rom/card/tmp
ln -s /mnt/ramdisk/tmp tmp
mkdir ./system/var/mnt/ramdisk
cd /usr/mnt.rom/card/system/var
mv lock lock.old
mv run run.old
ln -s /mnt/ramdisk/system/var/lock lock
ln -s /mnt/ramdisk/system/var/run run
if [ \"${swap}\" != \"\" ]
then
 dd if=/dev/zero of=/home/swapfile bs=1024k count=${swap}
 mkswap /home/swapfile
fi
if [ \"${tmpfs}\" = \"y\" ]
then
 echo \"none /mnt/ramdisk/tmp ramfs defaults 0 0\" >>/usr/mnt.rom/card/etc/fstab
fi
# Create the rc.card script on the SD card
cd /usr/mnt.rom/card
cat <<!EOT >rc.card
cd /
umount /home
fsck.ext2 -y /dev/mmcda1
swap=\"${swap}\"
fastSD=\"${fastSD}\"
# Rename the devices. This is so the SD shows up
# as \"Internal Storage\" in Qtopia
mv /dev/mtdblock1 /dev/iramdisk
mv /dev/mmcda1 /dev/mmcsd1
if [ \"${fastSD}\" != \"\" ]
then
 ln -s /dev/loop0 /dev/mtdblock1
 mount -oloop /dev/mmcsd1 /usr/mnt.rom/card
 umount -l /usr/mnt.rom/card
 mount -oasync,noatime /dev/mtdblock1 /home
else
 ln -s /dev/mmcsd1 /dev/mtdblock1
 mount -oasync,noatime /dev/mtdblock1 /home
fi
echo \"Mounting internal ramdisk\"
mount /dev/iramdisk /mnt/ramdisk
if [ ! -f /mnt/ramdisk/swapfile -a \"$swap\" != \"\" ]
then
 dd if=/dev/zero of=/mnt/ramdisk/swapfile bs=1024k count=${swap}
 mkswap /mnt/ramdisk/swapfile
fi
if [ -f /mnt/ramdisk/swapfile ]
then
 swapon /mnt/ramdisk/swapfile
fi
!EOT
cd /
umount /mnt/card
echo \"Home on SD is set up.\"
echo \"You need to reboot for it to\"
echo \"take affect\"
C3000 - Debian EABI - Kernel 2.6.23 of Angstrom