Tiny Core Linux/Reversion

From OLPC
< Tiny Core Linux
Revision as of 01:39, 17 January 2011 by Quozl (talk | contribs) (Timings)
Jump to: navigation, search

A procedure for reverting an XO to pristine filesystem configuration, as if it had just been installed, using Tiny Core Linux.

Requirements

  • an XO to act as a server,
  • any number of XO to act as client to undergo reversion,
  • a Tiny Core Linux bootable USB drive,
  • a wireless or wired network.

Setup for Server

  • install the required build but do not boot into it,
  • boot into Tiny Core Linux,
  • configure wireless:
iwconfig eth0 essid NETWORK
  • install rsync:
su -c 'tce-load -wi rsync' tc
  • mount the filesystems:
mount /mnt/mmcblk0p1
mount /mnt/mmcblk0p2
  • create an rsyncd.conf file:
cat << EOF > /etc/rsyncd.conf
[p1]
        path = /mnt/mmcblk0p1
        uid = root
        gid = root
[p2]
        path = /mnt/mmcblk0p2
        uid = root
        gid = root
  • start rsync daemon:
rsync --daemon
  • identify IP address:
ifconfig eth0

Setup for Clients

  • boot into Tiny Core Linux,
  • configure wireless:
iwconfig eth0 essid NETWORK
  • install rsync:
su -c 'tce-load -wi rsync' tc
(this step may be omitted by rebuilding Tiny Core Linux with rsync already installed)
  • mount the filesystems:
mount /mnt/mmcblk0p1
mount /mnt/mmcblk0p2
  • restore the filesystem to pristine state:
rsync --archive --compress --delete rsync://IP/p1 /mnt/mmcblk0p1
rsync --archive --compress --delete rsync://IP/p2 /mnt/mmcblk0p2
(where IP is the IP address or host name of the server)
  • reboot:
reboot

Timings

Reversion of three XO-1.5 that had been booted once into 10.1.3 os860 cost 1m 45s each as compared to 17m using fs-update and over half an hour using NANDblaster.