My new project: juicyD (maybe)

Posted on Wednesday, 17 December 2008

Being a sysadmin I tend to install operating systems quite often on various bits of hardware. This means a lot of CDs. I carry at least 4 CDs in my laptop sleeve and that's not really enough, plus I sometimes burn CDs to update firmwares in laptops, etc.

It doesn't sound like the end of the world, because it's not, but that doesn't mean the status quo is worth keeping. I've been thinking for a while now that it would be great to have a solid-state device I could use as a USB CDROM. I could load it up with a bunch of ISOs and boot from them without having to carry round a load of CDs or waste blank CDs for BIOS/firmware upgrades that are only a few MB.
A little research showed that, as ever, Linux was the perfect candidate because of its USB Gadget subsystem, which lets it act as USB Mass Storage, USB Ethernet, USB Serial, USB MIDI and other things.

While the Mass Storage support currently in the kernel doesn't include CDROM support, there is a patch kicking around which adds it as an option when loading the g_file_storage kernel module.

Next up - selecting some suitable hardware to test this on.

Atmel's NGW100 ticks all of the boxes for a test rig, it's got a serial port, a USB port, a power port and an MMC card slot. It's much bigger than a gumstix, and not powered by USB (although there is a dubious sounding hardware hack for this), but this is a low cost board to prove the project is possible.

The board comes with linux pre-installed, but the kernel isn't super-new, and since the CD-ROM patch isn't in mainline yet, I needed to get the board up to date.

Fortunately there is a great community of people around embedded linux. With a bunch of googling and help from HcE on #elinux, last night I got stuck in and built a toolchain, kernel, root image and upgraded the bootloader. This morning I uploaded a new image with a slightly old version of the CD-ROM patch (because I only just found the newer version while writing this post).

There's also plenty of information around about this, but it can be a challenge to wade into a brand new system and immediately know the right places to look (the avr32linux.org wiki turns out to be supremely useful, as was HcE).

So the question is, does it work? The simple anwer is yes, a Linux machine sees it as a CD-ROM drive and can mount it as such. The more complex, and slightly worse answer is not yet, because a test against a BIOS didn't work. It's possible this is a hardware issue, but it could be a software issue too, so I'm casting around for ideas :)
(the name "juicyD" is probably temporary, and I noticed about 6 hours after I chose it that someone commented on an earlier post with that nick a while ago. Weird)


  1. It would be really slick if you could get this to run on an iPod - it's got USB and a good hard drive all built in, and you might even be able to use the interface to pick an ISO image. It's probably a huge amount of hacking though, even with all the progress the iPod Linux guys have done.

    iPodLinux is built on a 2.4.24 kernel, which has USB gadget support, but it doesn't look like they've gotten the USB controller working.

  2. I don't have an ipod that could run ipodlinux, sorry :)

  3. I might just have to pick one up on eBay and start hacking at it then. :)

  4. I had the same issue with carrying and throwing away out-of-date CDs as you! I took a different approach though..

    I have a preseeded net-boot-installer that uses apt-cacher-ng to store all the needed files to save on unnecessary bandwidth. All this runs on my laptop at no cost to resources. Basically I connect the targeted computer to the same network as my laptop, boot it up and press F12. All automatic. 20 minutes later I have a fresh install.

    This however only works with debian derivatives. With other OSs I have to download the iso and write a custom PXElinux entry to get the target pc to load the contents of the file and thereafter it is as if I was installing from cd..
    This method is actually quite neat. For example I can load the liveCD of any respective distro off the net just to let people try out the different linux's and decide which they like the best.

    As for the comment on getting it to work on an ipod I am sure you could.. but it would be easier to get it working on a neo-freerunner. I am getting one for example to put into a UAV to control its flight patterns and send back and forth data. Pretty cool!