Monday, January 3, 2011

Work Summary and Build Instructions.

The past few months have been unseasonably busy. As a result, I've been relying increasingly on SVN to document my work.

Using the command
svn diff --revision 110:114
I generated this document, a diff summarizing all changes made over the past two months.
http://itdnhr.com/p?suGS. The changes fix many bugs and includes additional language packs and programs at the request of our contacts at the Haitian Coalition.

For the record, the files for the project can be found at http://open1to1.org/svn/trunk/build-scripts/
Running "svn co http://open1to1.org/svn/trunk/build-scripts/" will mirror the folder to the local drive.

Building an image of One2One2Go can be done easily on any Ubuntu machine as follows:
  1. run "svn co http://open1to1.org/svn/trunk/build-scripts/" to mirror the build scripts to the folder "build-scripts" on a local machine.
  2. move to that directory and run "http://open1to1.msln.net/Images/open1to1-asus1005ha-10.08.v02.zip" to download the upstream images from the Open1to1 Project.
  3. extract the archive, giving you open1to1-asus1005ha-10.08.v02.fsa and open1to1-asus1005ha-10.08.v02.f01. this can be done with the command "unzip open1to1-asus1005ha-10.08.v02.zip"
  4. install "fsarchiver," the tool needed to extract those images. this can be done with the command "sudo apt-get install fsarchiver"
  5. insuring that you have at least 20gb of free disk space, run the following command: "sudo ./0loopback_setup.sh; sudo ./1chroot_setup.sh." this will create a virtual disk, mount it as a loopback, extract the open1to1 disk image to it, chroot into the virtual disk, modify it extensively, and package it as an ISO. this will take at least two or three hours to run, and will require an internet connection.

Tuesday, November 2, 2010

Default Session Fix

Hi All,

Just rebuilt the image with the netbook-edition session as default.

Go ahead and grab it from http://people.sugarlabs.org/~it/One2One2Go-r.3.iso!

Best,
--
Ian

Saturday, October 30, 2010

New Release! Fixed Bugs!

Hi All!

The latest and greatest One2One2Go image can be downloaded here:
http://people.sugarlabs.org/~it/One2One2Go.iso.

By modifying casper.conf during the image creation process, I resolved the autologin errors.

There are still major modifications to be made to facilitate fast user switching and to speed up the boot process, but this release is a solid backbone off of which we can build.

Best,
--
Ian

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

Speedy Boot


A live CD or USB key starts up using syslinux, casper, then upstart. My efforts to speed up the boot process have been centered around grapling with these tools.

Syslinux is the first-stage bootloader, starting a Linux kernel from a FAT filesystem like our sticks. Casper is a set of scripts packaged in the initial ramdisk file(initrd) which facilitate booting off of live media. Upstart is the designed-for-Ubuntu startup manager. 

All of these software systems have significant room for improvement and specialization, especially Casper. 
Out of the box, casper is designed to provide the best possible user experience for an Ubuntu livecd. This, however, does not mean that it is well-documented or efficient. In this case, it is neither. I have been unable to turn up official or unofficial documentation on the internals of casper.

The Casper scripts are located in a folder aptly titled "scripts" in the root of the initrd. They are split up by category, with the scripts located in "casper-bottom" doing most of the work, and the rest serving largely as hooks to other boot steps.
In the "scripts/casper-bottom" folder, there are scripts for everything from checking the integrity of the boot media to configuring x. Many of the scripts located in casper-bottom are single-purpose. I'm having a hard time figure out what to keep and what's acting as an unnecessary load on the startup process.
In addition, there are a few scripts in casper-bottom that are actively interfering with progress. Scripts "10adduser," "15autologin," and "25configure_init" appear to be responsible for a bug I've observed. Upon boot, Linux TTYs 0-6 are locked down with security errors. These scripts appear to be attempting to automatically log in the [non-existent] user "ubuntu" to these terminals. For deployment and testing purposes, we most definitely do not want third parties have access to user's account. I've been working on figuring out how[and where!] to disable the autologin without breaking casper or weakening some other aspect of the system.

Another significant time-suck in both the boot and development process is the upstart system. De-crufting the startup tasks requires more knowledge of upstart than I have right now, and would greatly improve the startup speed and user experience. Many of programs started on boot are only occasionally used by the average user. On a modern computer, this results in a baseline increase in RAM usage. On a live system, this can result in an unacceptable slowdown.


Tuesday, October 26, 2010

Tool for Comparing Two Directories

I'm struggling with initrd patches to improve boot-speed and durability and have found myself needing to compare two directories.
For future reference, this command, specifically for initrd images, will do so.
diff -qr $DIR1 $DIR2 | grep -v modules | sed -e 's/ and / /g' -e 's/Files //g' -e 's/ differ//g' | xargs -L 1 diff

Floppy Drive Errors

Often, on boot of a livecd, one gets errors related to '/dev/fd0.'

The solution for this error is to blacklist the floppy-drive module, preventing its use during boot.

To do this, extract the initial ramdisk file and run the command
"echo 'blacklist floppy' >> etc/modprobe.d/blacklist.conf "
and rebuild.