Recovering from a Firmware Flash
So with new firmware images coming from Nokia (which is a good thing) you have to start to deal with picking up the pieces after a flash. The built in control panel 'Backup' does a questionable job - while it does seem to work, it also seems to have made my 770 totally wonky, and I've been better off not using it after re-flashing 51.
So what to do?
One solution is again the ever-maturing Synchronisation and backup using rsync & make by Andrew Flegg at Bleb- be sure and read his solution which is clearly outlined at his site.
Meanwhile, I've put together some very simple scripts which can help bootstrap your 770 right after a firmware flash.
I'm assuming that you have a MMC card, and you'll keep these scripts on the card along with your 3rd party packages- so that they are available right after a flash.
You'll have to install xterm using the 770 GUI and then run these scripts just one time. One for user and one for root.
As you can see, I keep the public RSA keys from my main desktop computers also on the MMC card, so that I can ssh right in after running these scripts. These scripts are very simple but hopefully they can save you some time after your next flash.
User script:
#!/bin/sh echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/lib/install/usr/lib' >> /home/user/.profile echo 'export PATH=$PATH:/var/lib/install/usr/bin:/var/lib/install/usr/sbin' >> /home/user/.profile echo 'set nocompatible' >> /home/user/.vimrc mkdir /home/user/.ssh cat /media/mmc1/keys/id_rsa_mac >> /home/user/.ssh/authorized_keys cat /media/mmc1/keys/id_rsa_XP >> /home/user/.ssh/authorized_keys chmod 400 /home/user/.ssh/authorized_keys chmod 700 /home/user/.ssh
Root script:
#!/bin/sh echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/lib/install/usr/lib' >> /root/.profile echo 'export PATH=$PATH:/var/lib/install/usr/bin:/var/lib/install/usr/sbin' >> /root/.profile echo 'set nocompatible' >> /root/.vimrc app-installer-tool install /media/mmc1/Installers/load-plugin_0.2.4-1_arm.deb app-installer-tool install /media/mmc1/Installers/dropbear-client_0.46-2_arm.deb app-installer-tool install /media/mmc1/Installers/dropbear-key_0.46-2_arm.deb app-installer-tool install /media/mmc1/Installers/dropbear-server_0.46-2_arm.deb app-installer-tool install /media/mmc1/Installers/vim-tiny_5.6.070-1.1_all.deb app-installer-tool install /media/mmc1/Installers/fbreader-maemo_0.7.1b-1_arm.deb ln -s /var/lib/install/etc/init.d/dropbear-server /etc/rc2.d/S20dropbear-server
Note: this does not address backing up any data... see Andrew's solution for that. At this point I really don't keep anything on the 770 that I can't reload after a flash from my Macintosh. But if you are keeping data on it, make sure to take some action and back it up before you flash.
What Happened in .51?
Issues with 51
Ok, since I've flashed 51 onto my 770, all hell has broken loose. So far I've had these issues:
- News Reader won't load (and it constantly refreshes)
- Sporadic reboots
- Out of Memory errors (I never had them before)
- Using swapon causes immediate out of memory and or reboot
I had to finally re-flash '51 again, and this time I didn't restore by data (which I had backed-up using the built in control utility) back onto the 770. It seems more stable now, except for the issues using swap. I don't mind resetting up my stuff by hand- my backup data must have corrupted something.
People I've talked with talk about initial reboots, but then 'things calm down over time' which seems impossible to me- how can things calm down? They should stay the same at least.
Does anyone have any solid information on what has changed in this release?
Gainroot and Root
Meanwhile, I've been banging my head with gainroot, and why it wouldn't read the .profile of the root user in /root... nothing was working, till I finally realized that perhaps this wasn't some new shell I was in.. and sure enough, invoking su - while in 'gainroot' put me into a proper root shell with a working environment. See below for the difference in environments...
~ $ sudo gainroot Root shell enabled BusyBox v1.00 (Debian 2:20041102-11) Built-in shell (ash) Enter 'help' for a list of built-in commands. /home/user # env SUDO_GID=29999 USER=root HOME=/home/user SUDO_UID=29999 LOGNAME=root MALLOC_MMAP_THRESHOLD_=32768 TERM=xterm-color PATH=/bin:/usr/bin:/sbin:/usr/sbin SUDO_COMMAND=/usr/sbin/gainroot SHELL=/bin/sh SUDO_USER=user MALLOC_TRIM_THRESHOLD_=4096 PWD=/home/user
Now with a proper root shell:
/home/user # su - BusyBox v1.00 (Debian 2:20041102-11) Built-in shell (ash) Enter 'help' for a list of built-in commands. Nokia770-51:~# env USER=root LD_LIBRARY_PATH=:/var/lib/install/usr/lib:/var/lib/install/usr/lib HOME=/root PS1=\h:\w\$ LOGNAME=root MALLOC_MMAP_THRESHOLD_=32768 TERM=xterm-color PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin: /sbin:/bin:/usr/bin/X11:/var/lib/install/usr/bin: /var/lib/install/usr/sbin SHELL=/bin/sh MALLOC_TRIM_THRESHOLD_=4096 PWD=/root Nokia770-51:~#
That's one small consolation.