On Fri, Oct 16, 2009 at 7:54 PM, Joachim Ott <<a href="mailto:jo.omsl@googlemail.com">jo.omsl@googlemail.com</a>> wrote:<br>> 2009/10/12 Gabor Laszlo <<a href="mailto:glaszlo@gmail.com">glaszlo@gmail.com</a>>:<br>
>> I also finetuned my post-flash setup and install scripts, so<br>>> reflashing, updating and getting all my settings back is a matter of a<br>>> few commands and an hour's thumb-twiddling. If anyone is interested I<br>
>> can post them.<br>><br>> Yes, I'd like to look at that script. Actually I'd like 2 scripts, one<br>> to save my changes I made to system files on the FR to the desktop pc<br>> and the other script to merge this changes to a newly flashed system.<br>
<br>Well, I have all personal data on a flash card, including the scripts, so after a reflash I just need to call /media/mmcblk0/setup.sh in the terminal. Note that I moved Maps, Music, and Books to /media/card/home. Here's the script:<br>
### start setup.sh<br><br>#!/bin/sh<br>echo "# Set card device name"<br>sed -i -e 's/mmcblk0p1/mmcblk0/' /etc/fstab<br>grep card /etc/fstab<br>mount /media/card<br>mount |grep card<br><br>echo "# Relink home"<br>
cd /media/card/home<br>for i in $(ls -a); do rm -rf ~/$i; done<br>cd<br># link Books .FBReader Maps .mplayer Music .navit .purple .ssh .tangogps<br>ln -s /media/card/home/* .<br>ln -s /media/card/home/.* .<br>
<br>echo "# Configure network"<br>sed -i -e 's/192\.168\.0/192\.168\.1/g' /etc/network/interfaces<br>/etc/init.d/networking restart<br>ifconfig usb0<br><br>killall dropbear && dropbear<br><br>echo "# Set timezone"<br>
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime<br><br>echo "# Resume speedup"<br>cat > /etc/init.d/resumespeedup << EOF<br>#!/bin/sh<br>/sbin/klogd -c 1<br>EOF<br><br>chmod +x /etc/init.d/resumespeedup<br>
ln -s ../init.d/resumespeedup /etc/rc1.d/S06resumespeedup<br>ln -s ../init.d/resumespeedup /etc/rc2.d/S06resumespeedup<br>ln -s ../init.d/resumespeedup /etc/rc3.d/S06resumespeedup<br>ln -s ../init.d/resumespeedup /etc/rc4.d/S06resumespeedup<br>
ln -s ../init.d/resumespeedup /etc/rc5.d/S06resumespeedup<br><br>echo "# Depmod when needed"<br>cat > /etc/init.d/moduledepends << EOF<br>#!/bin/sh<br>if cmp /proc/version /var/lib/kernelversion; then<br>
echo Not recalculating the module dependencies: Kernel has not changed.<br>else<br> echo Recalculating the kernel module dependencies...<br> depmod -a<br> cp /proc/version /var/lib/kernelversion<br>fi<br>EOF<br><br>
chmod +x /etc/init.d/moduledepends<br>ln -s ../init.d/moduledepends /etc/rc1.d/S00moduledepends<br>ln -s ../init.d/moduledepends /etc/rc2.d/S00moduledepends<br>ln -s ../init.d/moduledepends /etc/rc3.d/S00moduledepends<br>
ln -s ../init.d/moduledepends /etc/rc4.d/S00moduledepends<br>ln -s ../init.d/moduledepends /etc/rc5.d/S00moduledepends<br><br>### end setup.sh<br><br>And here's the other, run after connecting to the PC:<br><br>### start install.sh<br>
<br>#!/bin/sh<br><br>echo "# Fix software repos"<br>sed -i 's-ipk//-ipk/-' /etc/opkg/*feed.conf<br>mv /etc/opkg/armv4-feed.conf /etc/opkg/armv4-feed.conf_<br>echo "src/gz navit <a href="http://download.navit-project.org/navit/openmoko/svn">http://download.navit-project.org/navit/openmoko/svn</a>" >/etc/opkg/navit-feed.conf<br>
<br>echo "# Run update"<br>opkg update<br>opkg list_upgradable<br>if read dummy; then opkg upgrade; fi<br>echo "# Install other packages"<br>opkg install libpurple-protocol-yahoo libpurple-protocol-icq libpurple-protocol-bonjour fbreader midori-doc libgps17 navit pidgin-doc pythm libcanberra-gtk mokomaze<br>
ln -s /usr/lib/libgps.so.17 /usr/lib/libgps.so.16 <br>#diff -w -U 0 navit.xml /usr/share/navit/navit.xml<br><br>### end install.sh<br><br>The list of packages there at the end is a matter of personal preference.<br>><br>
> Much better would be, if I could mount the rootfs readonly and have an<br>> overlay-fs for changes.<br>Or at least put root's home on the card from the start. Hmmm, I might try that.<br><br>Gabor<br>-- <br>We are born wet, naked and hungry.<br>
Then things get worse.<br><br>