August 24th, 2009
I use OpenWRT for my wireless access point, and for some other projects. I often set up an OpenWRT box running off an external USB stick, instead of its internal flash. This gives me more storage space – for software packages but also pictures when I’m hosting a web site, etc. Another advantage of an external USB stick is that it’s cheap to replace when you burn out the flash, although I’ve never actually had this happen to me.
So how do you boot OpenWRT off an external USB stick? Well, midway through the boot process you change the root filesystem from the one on the internal flash to the one on the external stick. That means you need to check first that there’s a filesystem to boot off of. There’s a standard procedure on the OpenWRT wiki, using what’s called a pivotroot script.
In White Russian (the older OpenWRT release) the procedure was to replace /sbin/init with pivotroot. This is scary, because if you step wrong you’ve bricked your router – made it unbootable. In Kamikaze (the newer release), the recommendation has changed, and instead pivotroot is explicitly called from rcS, a very early bootup script. This is a better idea, and when I was done with my changes it was even safer.
What does a pivotroot script need to do? It needs to:
- Make sure the kernel can recognize your USB stick, by loading kernel modules to support USB and USB storage devices
- Make sure the kernel can recognize the filesystem on your USB stick, by loading more kernel modules. For example, I use the ext3 filesystem on my USB stick, and that’s not built in to the OpenWRT kernels
- Check whether your USB stick is even present
- Mount the filesystem on your USB stick
- Finally, if everything else is OK, it remounts all the filesystems so that your USB stick is the root filesystem and the flash-based root filesystems are mounted elsewhere
Note that this procedure still uses the flash-based root filesystem to get partway booted. Any special software packages you need to boot up – all those kernel modules, for example – and the pivotroot script itself need to be on the flash-based root filesystem, and not the root filesystem you see once you’re booted. This also makes debugging a pivotroot script tricky, because by the time OpenWRT is booted the environment is very different from the one pivotroot sees.
Next time I’ll outline the changes I made to improve the standard OpenWRT pivotroot.
Posted in OpenWRT | No Comments »
August 22nd, 2009
NY Times: Karla Kuskin, Creator of Witty Children’s Books, Dies at 77
Roar and More, which grew out of Ms. Kuskin’s graduate school project at Yale, was one of the classic books of my childhood. We can still recite many of the poems (“Fish is the wish / Of the cat on the mat / Or maybe his dream / Is catnip and cream”). And then the next page is a drawing of the cat’s reaction (“PRRRRRrrrrrrrr”).
My wife and I read Roar and More to our son when he was young, but he didn’t cotton to it. We were horrified to discover that he thought the Kangaroo noises (“whamp thrimp thrump”) were of the mother kangaroo falling on the joey!
But I’ve never read anything else she wrote. I like some of the work quoted in the NYT obituary, I’ll have to keep an eye out next time I’m in the library.
Posted in Uncategorized | No Comments »
May 20th, 2009
There are some things that would make my Nokia N810 better or easier to use (for my purposes).
- Line-out. Apple got this right, there’s line-out on the iPods (and even then you need to buy the right adapter). I plug the N810 into an FM modulator wired inline into my car’s antenna; in order to get the audio loud enough, I have to turn the volume on the N810 and on the car radio way up. There’s an audible background noise from all this, and I need to remember to turn it down before I switch back to headphones (N810) or an FM station (radio).
I could use a USB audio widget, plugged through a converter to get down to the N810’s mini connector. But the USB connector on the N810 is only accessible if the easel-legs are open, which isn’t exactly car-friendly. Plus I might have to fool around with kernel modules. I haven’t tried any of this yet.
- Working GPS. ‘nuf said.
- gphoto. When I’m on vacation I’d like to be able to pull pictures off my camera, and view them on the N810. I could also push them to my home server next time I found a network (WiFi or 3G, using my phone). To do this I need gphoto, or something like it. This is probably a simple matter of setting up the cross-dev environment and porting it, I haven’t gotten around to trying.
- fsck in the boot menu. I should ask fanoush, or hack it together myself.
- Automated podcast downloads. It would be nice if gpodder would do this for me, instead of having to be manually triggered. It’s on their roadmap.
- Polishing: I wish the keyboard were a little better, that it had a Tab key, that I didn’t need to use the Fn key to get to “/” (come on, if I’m typing it’s likely to be URLs or filenames!), that the directional-button-thing were on the front of the tablet and not buried on the keyboard. None of these are killers.
To reiterate, I’m happy and I use it alot. In fact the screen protector has gotten scarred up and I may need to replace it – I’ve never had to do that before. This is just the “room for improvement” category.
Posted in N810 | No Comments »
March 21st, 2009
We started M on piano lessons. She had been fooling around with ours for months, first because she was imitating a Blues Clues episode, then because Mom had shown her a few things. But she didn’t actually play tunes.
At her first piano lesson, after a little bit of discomfort with a new place and a new person, she played Twinkle, Twinkle Little Star all the way through. Now she’s admitted she can do it, she plays it at home, too, experimenting with different octaves and really figuring out how she can make music. It’s pretty neat.
Posted in Autism | No Comments »
March 20th, 2009
Herewith my hard-won knowledge on setting up a Nokia N810. You want to boot off the removable memory card – partly because it’s replaceable (when the flash memory wears out), and partly because it’s removeable (for backups, and when you need to reflash it).
- Learn how to reflash the tablet. I do this from my Linux box.
- Get root. My favorite way to do this is by installing OpenSSH, which sets the root password as part of its install process. Then you can open an X Terminal and ssh root@localhost.
- Prepare the removeable card. Mine is an 8GB SDHC micro card (with the mini adapter), formatted as 1GB for the bootable ext2 partition, and the rest as VFAT for N810 data. This is also a good time to practice with fsck on the two partitions, and to define your backup strategy (I use tar).
- Set up to boot from the removeable card. Download and follow instructions from fanoush’s site.
- Shutdown the tablet, and back up the removeable card.
- Put the card back in. boot up, and start installing and configuring software.
I use these apps daily:
- gpodder
- claws-mail
- mediabox
- maemo-mapper
- omweather on the desktop
- openssh
I also have iodine installed, but use it less often. I gave myself sudo access as well. Beware the published recipes for sudo access – believe it or not, the ones that were current 6 months not only didn’t worked, they soft-bricked the tablet so I would have to reflash, or at least reboot to the internal card (see why we did that?) and undo my changes.
Posted in N810 | No Comments »