Documentation of RescueOS ========================= RescueOS is a rescue solution for the Nokia N900, distributed as a tarball and as an initrd image. It has several features, most notable: mounting maemo / EMMC access(can mount maemo home and MyDocs partition) WiFi support USB mass-storage mode USB networking Battery charging Users must be familiar with the Linux console. How does it work? ~~~~~~~~~~~~~~~~~ The flasher utility loads rescueOS. This makes it unnecessary to modify the bootloader or maemo's /sbin/preinit. By using the "-l" option, we do not flash the kernel or initrd image. It only loads the kernel into RAM. No modification on the NAND or bootloader happens. Usecases ~~~~~~~~ In fact, most users do not need it. Either way, possible usecases: -Changing typos in bootscripts which prevent an operation system (e.g. maemo) to boot. -Backuping files prior to a reflash. -Charging the battery (when maemo is dead). -Modification of the EMMC partitions and partition table. -Backup & Restoring maemo rootfs. -fsck file system checks -and more... Installation ~~~~~~~~~~~~ Only the tarball needs to be "installed"(this means, unpacked). With the initrd, the flasher tool loads the whole system into RAM, making a microsd unnecesarry. So far, only an installation on a Unix system is described. Windows can't read let alone write to ext filesystems by default. Tarball: The installation of the tarball is rather easy. While it is recommended to create an ext4 partition, the kernel can actually handle ext2 and ext3. I assume that you only need this if maemo is broken on your device, therefore I don't want to describe how to install it directly on the N900. 1. Plug your microsd (through an adapter) into your computer. Find the device node of the first partition. For example, if it is /dev/sdf1, run mkfs.ext4 /dev/sdf1. WARNING: All data on this partition will be deleted. It is possible to use a different partition. If you use the second, replace the "mmcblk0p1" later in the kernel command line with mmclbk0p2. 40 MB should be sufficient. 2. mount /dev/sdf1 /mnt/ 3. tar xfvjp rescueOS-0.X.tar.bz2 -C /mnt/ 4. umount /mnt/ Booting the tarball: -------------------- Put your microsd card back to your N900, close the backcover. Run the following command as root: flasher-3.5 -l -k 2.6.37 -b"root=/dev/mmcblk0p1 rootwait rw console=ttyO2,115200n8 console=tty0 mtdoops.mtddev=2 wait for "suitable device not found..." and connect the N900 to your Linux box with USB. -l = load -k = kernel path -b = command line for the kernel. root=/dev/mmcblk0p1 = first sd partition. Inside maemo it is the first EMMC partition. rootwait = wait until the root partition shows up. rw = mounts the root partition read write console=tty02,115200n8 = set up a console with the given boutrate. console=tty0 = console on the first virtual terminal. mtdoops.mtddev=2 = Kernel oops (and panics) will be written to the third NAND parition /dev/mtd2 strings /dev/mtd2 to read them. RescueOS should be booting now. Booting the initrd ~~~~~~~~~~~~~~~ The initrd has actually the same features as the tarball. But you can not store persistent data, e.g. WiFi firmwares from maemo as everything happens in RAM. This method is sureley still prefered by many people. flasher-3.5 -k 2.6.37 -n initrd.img -l -b"rootdelay root=/dev/ram0 wait for "suitable device not found..." and connect the N900 to your Linux box through USB. ~~~~~~~~~~~~~~~ How to use it ~~~~~~~~~~~~~~~ The system asks you on the first boot if you want to copy maemo's firmware files for the wlan card to RescueOS. You won't see this question on the initrd image. After that you get a bash shell. The folder /rescueOS/ contains some scripts for various tasks. Not all of them are completed yet. They help you with the usual stuff, e.g. mass-storage mode, maemo root mounting, usbnetworking, WiFi setup etc. Mounting maemo root ------------------- /rescueOS/mount-maemo-root.sh This scripts mounts the maemo root to /mnt/maemo. /rescueOS/umount-maemo-root.sh USB Networking ------------- /rescueOS/usbnetworking-enable.sh Sets up USB networking in the following way: ifconfig usb0 192.168.2.15 up ifconfig usb0 netmask 255.255.255.0 route add 192.168.2.14 usb0 To disable it: /rescueOS/usbnetworking-disable.sh USB Mass-Storage mode -------------------- /rescueOS/mass-storage-enable.sh Makes /dev/mmcblk1p1 and /dev/mmcblk1p2 available for the mass-storage mode. These are the EMMC home partition and MyDocs in maemo. /rescueOS/mass-storage-disable.sh: Deactivates mass-storage mode. WiFi support ------------ It has wpa_supplicant, but without EAP support. This should be ok for most home networks which use a PSK. Give the following a try: wpa_passphrase [essid] [password] > /wlan.conf sh /rescueOS/setup-wpa-wifi.sh For DHCP, use udhcpc -i wlan0. You need the firmware files of course: /rescueOS/firmware-from-maemo.sh Shutdown -------- poweroff Root password ------------- rootme Contributions and suggestions are welcome. Write to me (NIN101 on freenode).