Saturday, October 30, 2010

Shared Workstation Image

To address boot-speed issues associated with older hardware, Luke Faraone and I have designed what we call the "shared workstation image" or SWI for short.

The intended result is a continuously-running system which, upon the insertion of a flash drive, links /home and /etc/passwd to the /home and /etc/passwd contained in the persistence file. This will allow a user to log into the system and have access to all their user-specific configuration files and documents in a near seamless fashion.

I have not yet been able to test the system we designed, as I've been preoccupied with boot speed. As a result, I'd sincerely appreciate technical assistance with this project. With this in mind, here's what we have


as the contents of /usr/local/bin/fastswap...

mountPoint=$(mount | grep $0 | awk '{print $3}')
if [ -a $mountPoint/casper-rw]; then
    mount -o loop $mountPoint/casper-rw /mnt
    mount --bind /mnt/home /home
    mount --bind /mnt/etc/passwd /etc/passwd
else
    echo "Already mounted"
fi


contents of /etc/udev/rules.d/fastswap.rules

ACTION=="add",KERNEL=="sdb*", RUN+="/usr/local/bin/fastswap %k"
ACTION=="remove", KERNEL=="sdb*", RUN+="killall gdm-session-worker"


contents of /etc/gdm/PostSession/Default

#!/bin/sh
umount /etc/passwd
umount /home
umount /mnt
DISPLAY=:0.0  zenity --info --timeout=10 \
          --text="Your removable storage device can now be safely removed from the system."
# TODO: use the device name in the message above
exit 0

No comments:

Post a Comment