Category: Washington State Ubuntu LoCo

Posts relating to the Washington State Ubuntu LoCo

  • Trip Report: UW signing-party

    Dear Debian Users,

    I met last night with a friend from many years ago and a number of students of cryptography. I was disappointed to see the prevalence of black hat, anti-government hackers at the event. I was hoping that civilized humanity had come to agree that using cryptography for deception, harm to others and plausible deniability is bad, m’kay? When one speaks of the government as “they,” nobody’s going to get anywhere really quick. Let’s take responsibility for the upkeep of the environment in which we find ourselves, please.

    Despite what I perceived as a negative focus of the presentation, it was good to meet with peers in the Seattle area. I was very pleasantly surprised to find that better than half of the attendees were not male, that many of the socioeconomic classes of the city were represented, as were those of various ethnic backgrounds. I am really quite proud of the progress of our State University, even if I’m not always in agreement with the content that they’re polluting our kids’ brains with. I guess I should roll up my sleeves and get busy, eh?

    V/R,

    C.J.

  • Debian on Sheeva Plug internal NAND flash

    After a bit of work, I got the sheeva plug working the way I wanted it to. First of all, I grabbed a spare 1G USB flash disk I had laying around and installed Debian squeeze to it by following tbm’s instructions here:

    http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html

    After debian was installed to the USB disk, I removed it from the plug and used dd on my laptop to create an image of the filesystem. I mounted the filesystem as a loopback device and created a jffs2 partition image from it after doing a bit of minor tweaking. I placed the USB disk back in the plug and booted to it. Using this intermediate filesystem and the mtd-tools package, I wrote the new jffs2 image to the NAND mtd device. I then modified the uboot environment to suit, saved, and now have a working setup.

    Detailed instructions are below.

    pre-requisites

    Connect the plug to your network with the rj-45/cat5 cable.

    Connect a USB flash drive to the plug. I used a 1G drive, but 512M should be sufficient.

    Install the ‘tftpd’ package on a machine on your network. You’ll also need screen on the machine that you use to connect to the plug’s serial terminal. I’ll assume these are the same host. You need the IP address of the tftp server. In this example, we will assume that the IP is 192.168.1.2 and that you will assign 192.168.1.200 to the plug.

    $ sudo apt-get install tftpd screen

    Place uImage, uInitrd, and uBoot in the /srv/tftp directory:

    $ sudo wget -O /srv/tftp/uImage http://www.cyrius.com/tmp/beta1/marvell/sheevaplug/uImage
    $ sudo wget -O /srv/tftp/uInitrd http://www.cyrius.com/tmp/beta1/marvell/sheevaplug/uInitrd
    $ sudo wget -O /srv/tftp/uBoot http://wp.colliertech.org/cj/wp-content/uploads/2010/09/07/uboot.bin

    Connecting to the serial console

    We are now ready to boot the plug. Note that you have to be quick with the screen command. I recommend you type it out and get ready to press the enter key. You have to interrupt the bootloader in order to enter the u-boot console. Attach the power and immediately enter the following command:

    $ screen -S sheeva /dev/ttyUSB0 cs8,ixoff,115200

    If you did this right, you should see a prompt like this:

    Marvell>>

    update uboot

    As per tbm’s instructions, you can now update the uboot if needed. Instructions for that are here:

    http://www.cyrius.com/debian/kirkwood/sheevaplug/uboot-upgrade.html

    I’ll put them inline here for completeness.

    Marvell>> setenv serverip 192.168.1.2 # IP of your TFTP server
    Marvell>> setenv ipaddr 192.168.1.200 # IP of the plug
    Marvell>> bubt uboot.bin
    

    be sure to answer ‘n’ to the question about env parameters.

    Now reset the device. Don’t forget to interrupt the bootloader so we can get back to the prompt:

    Marvell>> reset
    

    Let the device know that you will be running a mainline kernel and set the arcNumber:

    Marvell>> setenv mainlineLinux yes
    Marvell>> setenv arcNumber 2097
    Marvell>> saveenv
    Marvell>> reset
    

    Install Debian to the USB disk

    Interrupt the boot process once more. We are now ready to run the debian installer. I’ll leave the details as an exercise for the reader. The following should put you into the installer, which you are probably quite familiar with by now.

    NB: I will assume that you will use a single ext3 partition for the entire system. This will make it easier to build a jffs2 image out of the resultant partition on the USB disk.

    Marvell>> setenv serverip 192.168.1.2
    Marvell>> setenv ipaddr 192.168.1.147
    Marvell>> tftpboot 0x01100000 uInitrd
    Marvell>> tftpboot 0x00800000 uImage
    Marvell>> setenv bootargs console=ttyS0,115200n8 base-installer/initramfs-tools/driver-policy=most
    Marvell>> bootm 0x00800000 0x01100000
    

    build a jffs2 image

    Once the installation has completed, power down the plug and remove the USB disk. Put the USB disk in the machine you used to get the console on the plug and note what device the kernel assigns to it. In my case, it was given sdc, so debian is installed to /dev/sdc1. I will use these values for this example.

    If the filesystem was automatically mounted, unmount it. Create a disk image of the partition and mount it as a loopback device.

    $ sudo umount /dev/sdc1
    $ dd if=/dev/sdc1 of=/tmp/debian.img
    $ mkdir /tmp/mnt
    $ sudo mount -o loop /tmp/debian.img /tmp/mnt
    

    You can now remove the USB disk and return it to the plug.

    Modify the /etc/fstab file. The root filesystem will be /dev/mtdblock2 and of fs type jffs2. My fstab file looks like the following:

    proc            /proc           proc    defaults        0       0
    /dev/mtdblock2 /               jffs2    errors=remount-ro 0       1
    

    We can now create a jffs2 image from the mounted and altered fresh install:

    $ sudo mkfs.jffs2 -l \
      -e 0x20000 \
      -X zlib \
      --eraseblock=128KiB \
      --pad \
      --output=/tmp/rootfs.jffs2 \
      --compression-mode=priority \
      -n \
      --squash \
      -r /tmp/mnt
    

    write jffs2 to nand

    Now that we have an image to flash to the NAND, let’s boot off of the USB disk. It should now be attached to the plug. Power on the plug and use screen to get a console. Interrupt the bootloader and enter the following commands:

    Marvell>> setenv bootargs_console console=ttyS0,115200
    Marvell>> setenv bootcmd_usb 'usb start; ext2load usb 0:1 0x01100000 /boot/uInitrd; ext2load usb 0:1 0x00800000 /boot/uImage'
    Marvell>> setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_usb; bootm 0x00800000 0x01100000'
    Marvell>> run bootcmd
    

    Log in as root with the credentials you configured during the install. You will need to install a few packages in order to complete the nand flash. You can then ssh to the host on which you created the jffs2 image and cat it to stdout, piping this to nandwrite:

    $ sudo apt-get install mtd-utils
    $ ssh user@192.168.1.2 cat /tmp/rootfs.jffs2 | sudo nandwrite /dev/mtd2 -p -
    

    You now have a jffs2 image on the nand.

    Configure u-boot

    One more reboot to set u-boot’s environment, and you will be done. Power down and remove the USB disk. Power on and get the serial console using screen. Break into the bootloader and enter the following commands:

    Marvell>> setenv bootargs_console console=ttyS0,115200
    Marvell>> setenv mtdpartitions mtdparts=orion_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)
    Marvell>> setenv bootargs_root root=/dev/mtdblock2 rw rootfstype=jffs2
    Marvell>> setenv bootcmd 'setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
    Marvell>> saveenv
    Marvell>> reset
    

    You should now be good to go.

  • GSoC 2010

    Earlier this month, I applied to the Mono Project (and the University of Washington, and Ubuntu, and Debian, and The Perl Foundation) requesting a mentor to get Perl6 hosted on the DLR.

    Last Tuesday, Miguel contacted me and asked that I chat with Michael Hutchinson about possibly taking up a different project. It seems that the group did not have any mentors who felt comfortable mentoring the Perl6 project. After a bit of consideration, I agreed to modify my application and take up a project to revive the regular expression compiler from 2.2.

    Today, the project was officially accepted, and I met with my mentor for the first time (hi Rodrigo!).

    I will also be working with Matthew Wilson (aka @diakopter), since he has purportedly implemented a number of regex-to-IL compilers ;) He also offered to mentor me if The Perl Foundation had accepted my application, and since he has already implemented a perl6 compiler in javascript, I have been looking forward to poking some code with him.

    Although the GSoC doesn’t officially get started until 5/24, I’m making a git-svn checkout now. I’ve always committed the code directly to svn, but I’ve enjoyed working with git, and it seems about time to start contributing via git-svn. It will be easier to have local branches this way, too.

    Anyway, I’m looking forward to it ;)

  • Getting started with gtk♯

    This is a quick tutorial for getting a first gtk-sharp app up and going.

    Install MonoDevelop

    $ sudo apt-get install monodevelop libgtk2.0-cil-dev

    Start MonoDevelop

    It’ll be in your GNOME application menu under Applications->Programming->MonoDevelop

    Create a new Gtk# Project

    Create New Project
    Create New Project
    Select Gtk# 2.0 Project
    Select Gtk# 2.0 Project
    Select Project Features
    Select Project Features
    Hello World
    Hello World

    Run project

    You can run this boilerplate by pressing Ctrl-F5

    Using the Designer

    Double-click on the file named MainWindow.cs in the Solution section. When the file opens, click the Designer button below the code view.

    The Designer
    The Designer

    The Toolbox

    To add the Toolbox, press Alt-Shift-B or click View->Toolbox.

    Drag a VBox widget from the Toolbox to the main window.

    Add VBox
    Add VBox

    Drop a Menu Bar widget into the top cell of the VBox, and a Statusbar into the bottom.

    Insert Menu and Status Bar
    Insert Menu and Status Bar

    Properties grid

    Drop a Button widget into the middle cell of the VBox.
    Add the Properties grid from the View menu (Alt+Shift+P or View->Properties).
    Select the new button by clicking on it.
    In the Properties grid, expand the Button Properties section and click the value of the Label field. Delete the default content and replace it with a different string.

    Button with new Label
    Button with new Label

    Adding a Click handler

    Select the button in the Designer view
    In the Property grid, select the Signals tab
    Click twice on the text in the column to the right of the Clicked and replace Click here to add a new handler with MyButtonClickHandler

    Add a click handler
    Add a click handler

    Click on the Source Code button below the viewer window to switch to the C♯ code. You can use the find tool to search for the new handler you created, called MyButtonClickHandler. Ctrl-F will bring up the find dialogue.

    Browse to click handler
    Browse to click handler

    Add some code to update the status bar.

    	protected virtual void MyButtonClickHandler (object sender, System.EventArgs e)
    	{
    		var contextId = this.statusbar1.GetContextId("clicked");
    		this.statusbar1.Push(contextId, "Clicky-Clicky" );
    	}
    
    Click handler code
    Click handler code

    Modify button layout

    The size of the running window is a little weird. I fixed mine by un-setting the Auto Size boolean and setting the Expand and Fill in the Box Child Layout section of the Properties grid.

    Button layout changes
    Button layout changes

    Exercise button click handler

    Run your application with Ctrl-F5 and click on the button. You should see the new string show up in the status bar at the bottom left of the window.

    Not yet clicked
    Not yet clicked
    Clicked + Status update
    Clicked + Status update

    Add Menu items

    Create File Menu Entry
    Create File Menu Entry
    Create File->Quit Menu Item
    Add Quit event handler
    Add Quit event handler
    Add Clear Statusbar Activate Handler
    Add Clear Statusbar Activate Handler
  • dlr-languages 20090805+git.e6b28d27+dfsg-1 in squeeze, -2 uploaded, nearly in lucid

    Yay! The dlr-languages package has been migrated to testing, which means that it will be included in squeeze, the next release of Debian. Jo has uploaded the -2 version and it is now in sid. This version addresses the issues brought up in the Ubuntu Feature Freeze exception (FFe) bug, so I expect that it will be accepted shortly. Still lots of “ifs”, but this is pretty exciting for me, since this is my first debian package, and I’ve been intending to get it in for over two years.

    I’m not just sitting on my hands while this happens. I’ve been working with Ivan, Ankit, Dino and Michael to get the next version of the package put together. I’m currently merging Ivan’s latest branch into the changes I’ve made for DFSG compliance. Dino recommended that the next release include IronRuby 1.0 and IronPython 2.6.1, which should be released by upstream around the middle of April.

  • I’ve disabled my user approve plugin

    Sorry for the inconvenience folks. I was annoyed by having to mark so many comments as spam, but the plugin interface was so klugy that I had no idea how to find the users who would contribute useful posts. So. Feel free to comment… Nao!

  • IronRuby continuous integration back online

    We haven’t done much work on keeping the continuous integration (CI) machines online, and there haven’t been any new builds since November of ’09. I should set Nagios to remind us when things get off track or something. The recent acceptance of the DLR into Debian and our intention to get the next release produced has inspired me (and maybe others) to get things back up.

    Ivan and I put a couple of Hudson instances up recently that you can reach via hudson-windows.colliertech.org and hudson-linux.colliertech.org. The linux instance is dropping new builds of IronRuby to http://dlrci.colliertech.org/ironruby/. I expect we can tweak the build script a bit and have it also produce IronPython builds. This would hypothetically drop the builds to http://dlrci.colliertech.org/ironpython/.

    Ivan mentioned that we may get CNAME records which would activate the windows-builds.ironruby.net and linux-builds.ironruby.net hosts as well.

    Note that these builds are being produced from the linux branch of git://github.com/casualjim/ironruby.git

    Thanks for your work on this, Ivan!

  • More DLR work

    Ivan put up a hudson server on our winders box. Ankit helped me figure out the IronRuby xbuild build problems. I should probably try it on IronPython, too. I sent the ironruby-core list a patch to fix some case sensitivity issues. Some time in the near future, I’m going to get together a bug report for the compiler and send it off to Marek. But I’m tired and Scarlet’s got a friend doing the sleep-over thing tonight.

    So. Later ;)

    P.S., can you believe that nobody registered a11y.com before now? Crazy talk.

    P.P.S., does anyone out there in gnome land have a ruby app they want to test for compatibility with IronRuby?

  • IronRuby on OS X

    We had a visitor on #ironruby today asking for help getting IR running on his mac. I gave him the following directions, and they seemed to work aside from one glitch. I tested them on my wife’s mac, and it worked for me, too.

    Install Mono

    You can grab the Mono .dmg from go-mono.com. This will install the framework and put the required programs (mono, xbuild) in your PATH.

    Fetch the IronRuby source

    Since Jim Deville likes macs, I’m sure more recent versions will work, but this is the one we’ve recently packaged up for Debian and tested on Ubuntu. If you want to be certain that the IronRuby code you write on Debian works on OS X, then you should probably build from the same version of the source. You should probably also install version 2.4.3 of Mono, but that may be more effort than it’s worth ;)

    http://github.com/mletterle/ironruby/tarball/20090805+git.e6b28d27

    Unpack the tarball

    Open up a terminal and unpack the thing you just downloaded:

    $ mkdir ~/src/
    $ cd ~/src/
    $ tar xfz ~/Desktop/mletterle-ironruby-e6b28d2.tar.gz
    $ cd mletterle-ironruby-e6b28d2/
    

    Build IronRuby

    At this point, you should be able to build the IronRuby assemblies using xbuild. I don’t recommend using rake, as it has some dependencies, and I’m not a fan of dependencies.

    $ xbuild /p:TreatWarningsAsErrors=false Merlin/Main/Languages/Ruby/Ruby.sln
    <snip/>
    Build succeeded.
    	 2817 Warning(s)
    	 0 Error(s)
    
    Time Elapsed 00:00:28.8378230
    

    Run the IronRuby interactive interpreter

    Our guest mentioned that he was using a terminal with a white background. Do note that the font color of the interactive interpreter (aka Read-Eval-Print Loop or REPL) is white, so if you’re using a white background, you might want to change it. IIRC, there is a way to change the font color using a configuration setting. Figuring it out is left as an exercise for the reader.

    $ mono Merlin/Main/Bin/Debug/ir.exe
    IronRuby 0.9.0.0 on 2.6.3 (tarball Wed Mar 10 18:18:12 MST 2010)
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    >>> 1+2
    => 3
    >>> exit()
    

    Extra credit: IronPython

    The tarball you downloaded also included the source to IronPython. The procedure to build/run IronPython is pretty similar to IronRuby.

    Build IronPython

    Unlike IronRuby’s .sln, this version of IronPython’s .sln does not have a default configuration parameter, so we need to specify it with the /p:Configuration=Debug argument.

    $ xbuild /p:TreatWarningsAsErrors=false /p:Configuration=Debug Merlin/Main/Languages/IronPython/IronPython.sln
    <snip/>
    	 69 Warning(s)
    	 0 Error(s)
    
    Time Elapsed 00:00:38.8057450
    

    Run the IronPython interactive interpreter

    IronPython has a REPL interface like IronRuby’s. Or is it the other way around? Anyway, here’s an example.

    $ mono .//Merlin/Main/Bin/Debug/ipy.exe    
    IronPython 2.6 Beta 2 DEBUG (2.6.0.20) on .NET 2.0.50727.1433
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 1+2
    3
    >>> ^D
    
  • dlr-languages_20090805+git.e6b28d27+dfsg-1_amd64.changes ACCEPTED

    I’m happy to announce that after the filing of an Intent to Package and nearly 2 years of work, IronRuby 0.9, IronPython 2.6b2, and the DLR are now in Debian. To my knowledge, this is the first package in Debian with direct and active upstream support from Microsoft.

    Kudos for this release go to Jo Sheilds (package sponsorship & mentoring), Mirco Bauer (package sponsorship & mentoring), Matthias Klose (IronPython package review), Ivan Porto Carrero (IronRuby build/test support), Michael Letterle (IronRuby build/test support), Jim Deville (IronRuby build/test support), Jimmy Schementi (upstream point of contact @ Microsoft), Dino Viehland (IronPython build/test support), Michael Foord (IronPython build/test support), Marek Safar (mono c# compiler support), Ankit Jain (xbuild support), the folks on OFTC’s #debian-cli, Freenode’s #ironruby and GimpNet’s #mono, and the folks on the IronRuby and IronPython mailing lists.

    This is my first package in Debian, too. I’m pretty ecstatic ;)