XO yum cache on the local XS

With the release of the new 860 XO build, you might have a few XOs to update.  Of course, flashing an XO with a USB drive is the fastest way to get a clean install, but then you might want to yum update or install other stuff.  In low bandwidth situations or where USB drives are small and scarce, it’s really easy to keep the yum cache on the XS.
You’ll need a user account on the XS and ssh access (keys or passwords).  In the user account on the XS, create a directory to keep the XO yum cache.  I’ve got an XS user named olpc and I created xo1/yum in /home/olpc.

Get a fuse-sshfs rpm into an Apache accessible directory on the XS.  Mine is in /var/www/html/olpc/updates.

On the freshly flashed XO, connect to the XS’s wifi.  Become root and install the rpm.  You can do this in Gnome or Sugar.

sudo su –
rpm -ivh http://172.18.0.1/olpc/updates/fuse-sshfs-2.2-5.fc11.i586.rpm

If you want to enable the RPM Fusion repos go ahead and do that now.

Set it up so you can connect to the XS’s wifi AP in single user mode.  Put this in /etc/sysconfig/network-scripts/ifcfg-eth0 where OLPCOFW is the ssid of the AP.

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Wireless
MODE=Managed
ESSID=OLPCOFW

Change /etc/yum.conf so it keeps the cache.

keepcache=1

Get into single user mode.

init 1

Bring up the wifi connection.  Note – this will not work if your AP is B only.

ifup eth0

Mount the remote cache.  If you run ssh on a non-standard port, put the port number in.  Otherwise omit -p port.

sshfs -p port olpc@172.18.0.1:/home/olpc/xo1/yum /var/cache/yum

Now when you yum update or yum install stuff, it’ll download it to the XS and install over the network.  When you move to the next XO and mount the cache from the XS on the XO, it doesn’t have to download all that stuff again, making updates and installations a lot faster.  If you’re like me and have a scandalous number of USB drives in your lab, this way you don’t have to remember which one you were keeping the yum cache on.

When yum stuff is finished, go ahead and reboot and you’ll be back in Sugar or Gnome (whichever you were using last).

Leave a Reply