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!


Saturday, October 30, 2010

New Release! Fixed Bugs!

Hi All!

The latest and greatest One2One2Go image can be downloaded here:

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.


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
    echo "Already mounted"

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

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.

Wednesday, October 6, 2010

Technical Tour-de-Stick

If you are not interested in the technical underbelly of this project, it would be best if you skipped this post. Also, use the information below at your own risk. I've done my best to make sure that it is correct and up-to-date, but there may be places where I'm off-base.

Before I delve into initrd and casper, I figure I'd best post an explanation of the files on the stick. To do this, I'll explain what's on my development stick at present.

I ran the command "find -maxdepth 3" from the root of my stick and pasted the result below. 
I annotated the paste with comments above the file/folder they describe.

#used by syslinux for first-stage booting
#a list of the installed packages
#a list of the installed packages discounting those used for installation
#a compressed, read-only filesystem containing a copy of the O121 image
#the initial ramdisk image, compressed. more about this below
#the linux kernel

#a folder containing an extracted copy of the the initial ramdisk
#contains shared files and application libraries used in the boot process
#contains the casper boot scripts. This folder deserves(and will get!) its own blog post.
#contains the binaries used in the boot process
#contains more esoteric binaries used in the boot process
#contains low-level drivers, libraries, and kernel modules
#contains configuration files for the boot process
#contains configuration files for the kernel and programs used in the boot process
#the main boot script

#the scripts used to extract and rebuild the initrd image
#gzip -dc ../initrd.gz | cpio -id

#mv ../initrd.gz ../initrd.$(md5sum ../initrd.gz | awk '{print $1}').gz

#find . | cpio --quiet --dereference -o -H newc | gzip -9 > ../initrd.gz

#the initial initrd file, kept around for good luck and occasional versioning
#a previous version of the initrd file

#a version of the Linux kernel designed to test ram
#smart boot manager - http://linux.simple.be/tools/sbm
#a large file containing an ext3 filesystem, used as a boot-time overlay for persistence 
#contains misc metadata files
#empty file used to claim this image as an ubuntu derivative

#the isolinux bootloader
#the isolinux config file - isolinux is called "syslinux" when used on a USB drive

For more information, a full "find" tree of my development drive can be found here



Made tons of progress yesterday.

The Main Stick Image

  • now boots fully on the Haitian Coalition machines with wonky graphic cards
  • doesn't block login on consoles 1-6
  • shutsdown cleanly
  • doesn't probe the floppy drive on boot
All of these changes were made by modifying the initrd.gz image, except for the graphics issue, which was resolved by disabling 3d hardware acceleration.

I'll be posting the casper hacks I made to the comments section of this blog in the next few days.

The Fastswitch Image
  • needs work, but progress is no longer being blocked by the above

    The Boothelper Image
    • no longer requires userinput to boot, this eliminating any need for USB keyboards to work 

    • was proof-of-concept'ed yesterday as I programatically installed dropbox on a One2One2Go drive with the sync directory set to /home

    Keep an eye out for an ISO containing the main-image fixes in the next few days!

    Tuesday, October 5, 2010

    Summary of Technical Work

    The software for the upcoming pilot with the Haitian Coalition has four main pieces.

    The Main Stick Image

    The software for the stick is largely completed, as the build scripts to create an image from the open1to1 harddrive files have been written. However, there are bugs with our implementation of casper and with the video drivers for the donated computers. The casper bugs are related to casper's autologin and autohardware check. Both of these interfere with a normal use case and slow boot time. 

    There are four possible kernel arguments to resolve the driver issues, and the best approach to fixing this problem appears to be a syslinux.conf file which poses all of the options as selectable items. This means I won't have to rebuild every time I want to try a new approach.

    The casper problems are more challenging. I haven't found good documentation for the purpose and contents of the scripts involved, and while they're written in BASH, this does not mean they are easy to read. Fortunately, other individuals on the internet have encountered similar problems, and there are some solutions posted. However, due to casper's role in the initial ramdisk image, modifying casper necessitates a lengthy rebuild from scratch.


    The Fast Switch image.

    Luke Faraone and I worked together to design a solution to allow for students to switch between computers in a lab very quickly. The basic premise is that as the students don't have access to modify the stick past their /home directory, a simple over-mounting of the /home from the persistent file should function to allow students to access all the files on their stick in a transparent manner.

    For more information, see my notes at on SVN at http://open1to1.org/svn/trunk/build-scripts/fastswitch_notes.txt.

    The Boothelper image.

    As the BIOS of older machines, like many of the P4s we're using in our pilot, don't support booting from USB, some form of alternate bootloader is needed. For this purpose, we're using the "PLOP" Bootmanager, customized to detect USB devices and attempt to boot off them in a mostly-silent manner. The ISO image for this is available here.

    One issue with this is that the boothelper does not support USB keyboards. As, in normal operation, no keyboard entry should be needed, this isn't really a problem. However, this makes debugging difficult.


    The backup solution designed for this pilot is dropbox-based. Keep an eye out for a blog post about that soon!

    In other news, the most recent image can be downloaded as an ISO from my sugarlabs page. This file has both Spanish, French, and Haitian creole language packs, as well as a plethora of educational software. The md5sum for this file is f6d8724693c90ac9b2b758b7730a5604.


    Monday, August 23, 2010

    Maple Syrup v3 Ready for Download

    Hi Guys,

    I'm happy to announce the release of v3 of Maple Syrup in ISO format. ISO packaging allows one to use Maple Syrup as a live USB disk or DVD.

    The image contains numerous fixes in form and function and will make this Open-1-to-1 / Sugar fusion even more enjoyable to use.

    To make a bootable USB stick from an ISO image, follow the instructions contained in section two of the Ubuntu USB Stick Instructions.

    Grab the image here. The md5sum of the file is 07d5470e61fe7deefa5507aee5764da7.



    Wednesday, August 4, 2010

    Announcing Maple Syrup Alpha!

    The first version of "Maple Syrup" is available!

    Built on Release-Candidate 1 of Maine's Open 1-to-1 project and Sugar, the educational software stack maintained by sugarlabs, the Maple Syrup image provides a teacher and classroom tested collection of educational software for grades K-12.

    The alpha is available as an ISO image allowing use as a LiveCD or as a bootable, persistent, USB stick. This means you can try it out without making changes to the host computer.

    Grab the file here. The MD5 checksum is 0985e4abfebb790d8008b1c82c8b68aa.

    When downloading, keep in mind that the ISO is a large file - it may be best to let it run overnight!

    As always, feedback and bug reports are appreciated!


    Thursday, July 15, 2010

    Google for Classroom Collaboration

    The OLPC project has proven value to a one-to-one computing approach facilitating collaborative learning

    Similar projects, from first-world XO deployments, to the open 1-to-1 project in Maine, are following suite. 

    The XO's mesh networking and collaboration functionality is buggy at times, but quite useful in a rural setting where infrastructure is unavailable. 
    In my life, I have found collaboration to be best done via Google's web apps, with Gdocs and Gwave a staple of my business and scholastic life, providing real-time, multi-media collaboration anywhere with internet. Any document created with Google Docs are automagically stored in the cloud, where they are available for download or remote editing. Taking advantage of these free services makes tons of sense in an educational computing setup.

    In stick-based 1-to-1 education, where the kids carry all of their files and programs around on a bootable flash drive, GDocs would provide a full backup in case of loss of stick. Storing editable files in the cloud would also let kids work on school projects, or parents/teachers monitor school projects, from home computers, without needing to boot into the stick OS.

    In first-world educational laptop deployments, Google apps act as a "path of least resistance" for collaboration. Rather than having the IT staff install a custom Jabber server, simply configuring Google apps for school use accomplishes very nearly the same goal.

    In very small schools or very large schools, Google apps acts as a "path of least resistance" for collaboration. Small schools often lack the resources necessary for internal collaboration servers. Google Apps for Education is free, and easy to set up. For larger institutions, it's a significant strain on internal resources to provide real-time collaboration via traditional methods. Google scales up excellently. 

    There are obvious failings with this proposal. Right now, the primary interface for Google Docs is via web browser. In a modern educational setting, the last thing you want your students doing is having a web browser up in a classroom setting. Facebook and Flash games provide a powerful distraction from note-taking and group work.  Also, using a web browser as the primary text processor leads to issues when internet is unavailable.

    Fortunately, there are solutions. HTML5, an upcoming web standard, will allow for GDocs to be used offline. Additional coding using the Abiword engine, used in the "Write" activity, with the GDoc API, would produce a platform-and-web-independent word processor with local and cloud file storage.

    What do you think? In what other situations would cloud-based collaboration pay off? What sort of scenarios should software like this be designed for?

    Tuesday, July 13, 2010

    Open 1-to-1, "Maple Syrup," and customization.

    Last Friday saw the conclusion of the FOSSed conference in Bethel, Maine. The conference was a hugely influential experience for the project and provided me with faces to go with three usergroups I've been designing for, Administrators, Students, and Teachers. I have quite a few thoughts I'd like to get on paper.

    After my introduction to the Open One-to-One computing project running in Maine, Caroline and I have come to the conclusion that it may serve as an excellent platform to base the USR Bootable Flashdrive off of. With this in mind, I'm helping to evolve the O121 image development system using the LiveCD customization process used by the USR project to create a live O121 flash drive. Nicknamed "Maple Syrup," named after the popular sugar product of New England, this system will serve as a technological tool for K-12 education.

    Right now, the Open 1-to-1 image is created manually, by modifying a fresh install of Ubuntu Netbook Remix on the target hardware. This approach produced a disk image implemented in several schools across Maine to great success. While making deployment quite easy, this approach makes virtualization and live-CD / live-USB creation nearly impossible.

    To fix this, I found a means of converting the write-to-disk only image provided by O121 into a more useful form. The program Remastersys allows one to create a bootable ISO image from a running Ubuntu system. From a bootable CD ISO, I can use my existing ISO-USB script to create a persistent flash drive install.

    As a refinement of the above procedure, I intend to use a few scripts written by David Farning to create a bootable and installable disk image entirely programatically, from scratch. Modifying his shell scripts  for use with the O121 & "Maple Syrup" project will greatly simplify the build process and expand the usability of the resultant image. Alternatively, there exist several alternate procedures to develop a bootable & installable disk image based on an existing LiveCD.

    My next step is to flash the most recent O121 image to a spare netbook, install, configure, and run Remastersys, and debug / modify the resultant ISO.

    Wednesday, July 7, 2010

    FOSSed - Day .5 Reflections & Update

    It's lunch break at FOSSed, a conference in Bethel, Maine, addressing Free-and-Open-Source-Software solutions for education. 

    The morning breakout I attended was an in-depth look into the Open 1-to-1(open1to1.org) project. 

    Open 1-to-1 is an answer to the Maine Learning Technology Initiative, a program running since 2002 which put Mac laptops into the hands of 7th and 8th graders across the state of Maine. MLTI serves as an excellent example of technology implemented in the classroom.

    Open 1-to-1 is a framework for using Linux in an educational setting from grades 7-12. Using a customized version of Ubuntu Netbook-Remix(UNR) and affordable Asus netbooks, Open 1-to-1 has provided an affordable means for many highschools to implement 1-to-1 computing across Maine and across the world.

    I recently installed Ubuntu Netbook Remix on my second-hand HP Mini 1000 Netbook. After a little bit of struggling with Broadcomm drivers, it works fine and has proved to be a very convenient tool

    My "Favorites" view. Note Chrome, Qalculate, Sugar, and TweetDeck.

    My "Home" view on Sugar on Ubuntu Netbook Remix.
    Everything here but Turtle-Art-For-Arduino and Read works!

    Yes, Write works. I fixed it. 
    Write was broken because of an Ubuntu dependency screwup with python-abiword.
    Editing control.tar.gz/control and recreating the Debian package solved the issue.

    Including Sugar with O121 will expand the target audience down into the K-6 grade level. O121 will serve as a customizable base for education all the way from Kindergarten up through 12th grade. That's cool.

    Tuesday, July 6, 2010

    Progress! [A Visual Guide]

    Just in time for Wednesday's FOSSed conference, everything is running awesomely.
    I wrote a BASH script which turns a customized ISO image and a 2GB flash drive into SoaS, USR-style.

    • the good news: most things work
    • the bad: some important things don't

    Check it out.
    This is the "neighborhood" view, as seen on my laptop.
    It successfully connected to a WPA2 WiFi network and to a Jabber Server, out-of-the-box.

    Yep, the whole thing is actually running on a flash drive.
    I've been developing with 2GB drives from MicroCenter. 
    Speed is a little lacking, but nothing overt. Also, these guys are CHEAP!($6/ea)

    Yep! Activities work too! Here's the ever-popular "Speak" activity.

    When I said some important things weren't working, this is what I was talking about.
    "Write failed to start"

    This bug also affected "Read" - two of the most important activities, hands down.

    I'm betting that the issues here are connected to packaging - both Read and Write depend upon external programs and libraries. There're kinks to be worked out as we rebase from the Fedora versions to the Ubuntu versions.

    In summary: We're close. It runs stably, but not flawlessly. Working closer with dfarning on customization and with the SEETA crew to tackle bugs will bring quick progress and a polished product in no-time flat.

    Monday, July 5, 2010

    Week 3 + 4

    Weeks three and four were a whirlwind of accomplishments. From coming to a more-or-less functional understanding of the procedure around customization, to successfully creating a bootable USB disk loading into a working Sugar environment with full driver support on my new Latitude E6400 laptop, huge strides have been made.

    Unfortunately, I'm on a very crunched timeline here - FOSSed, a conference dedicated towards free-and-open-source-software for the dedicated purpose of education, is on the 7th.

    My goal is to have a stable, functional, and distributable version of USR on a bootable CD drive between now and then. I've made quite a bit of progress, but there's tons left to go.

    In the interim, here are a few photos of USR running on my laptop:

    The "Maze" activity running on my laptop. 
    Visible is the 1gb persistent flash drive I installed the Febuary USR build onto.

    The Sugar home-page running on my laptop. 
    If you look closely, you can see a graphical glitch in the top-left corner. 
    Icons aren't properly being displayed - hopefully this will have been fixed in the July release.

    That's all for now. I'll be blogging from FOSSed and will likely post tomorrow, after an all-day work session on programmatic flash-drive generation and bug squashing.

    Sunday, July 4, 2010

    Weeks 1 + 2

    The first several weeks of working on this project consisted of less work than expected. I met with Manu when he was in town for a conference and discussed the future of the project and the roles we were to play.  I spent extensive amounts of time re-familiarizing myself with the current state of the Sugar project, the Sugar Labs organizational structure, and discussing, briefly, the Debian/Ubuntu packaging system with Luke.

    Delayed Introduction

    This blog was created to chronicle my work with SugarLabs on an Ubuntu-Sugar Remix.

    The posts are being amalgamated as I transcribe my by-the-monitor notes and merge them with the handful of textfiles in my /home/it/USR folder.

    Over the past month or so, I've been working with dfarning, lfaraone, and Caroline Meeks, in addition to a team of programmers from the Indian SEETA, to rebase Sugar, the graphical interface and top-level software best known via its use on the OLPC project's XO-1, onto the Ubuntu Linux distro.

    The goal of this project is a bootable thumbdrive providing the 'meat' of the One Laptop Per Child education project in a hardware-independent manner. Flash drives are cheaper, more readily distributable, and, in the first world, much more compatible with existent educational paradigms. Most modern schools have computer labs featuring hardware enough for a classroom of students at a time and many children have computers readily accessible at home. The constant presence of computers more powerful than the XO laptop in the lives of 1st world children slightly invalidates the need for a separate 1-to-1 computing paradigm. A 1-to-1 stick paradigm, however, can be implemented successfully for 5% of the cost.

    Luke has been working under David, primarily focusing on packaging of Sugar activities for Debian & Ubuntu.
    SEETA has been squashing bugs left and right and tackling testing.
    David has been working on customization of a bootable Ubuntu image for out-of-box use with Sugar.
    I've been working on taking David's customized image and turning it into a persistent bootable USB stick.

    Upcoming posts will provide greater detail about my efforts.