Postcards from the Bleeding Edge
Friday, September 11, 2009

  Building a virtual mesh potato, part 1

Hardware for the mesh potato has been delayed another month or so (and I can expect another month for delivery), and I'd planned on starting work on it in September, so I was stuck. I have plenty of things to do but my mindset had turned toward hacking... I also wanted to hack my existing router into better shape for ipv6. The two tasks are congruent as they use basically the same OS and toolchain, so I spent most of the last two days building up an environment to work on it, without the hardware.

Enter qemu debian mips.

I spent a lot of time going down the wrong paths - for example it wasn't obvious to me that you needed an elf format kernel to run the thing. I also spent 24 hours of computer cycles trying to do debian install via the emulator, only to have the power fail 93% of the way through.

So, this morning, I downloaded a debian image for qemu mips. 24 minutes later I had a booting virtual mips box, emulating the MIPS to fool around in.

It Just Worked.

Embedded development just got a lot less hard. Flashing (and crashing) boards is a painful process easily avoided with an emulator. You can also do all sorts of robustness testing of the core software without fear of wrecking one of the precious few boards available, and you can work on "branches" of the core software by just keeping a couple copies of the emulator image around.

Heck, a good multi-core machine could probably emulate a dozen potatoes at the same time.

Once I get openwrt boostrapped onto it, it will let me fiddle with more modern kernels, alternate tools, and eventually the openwrt userspace that the mesh potato uses with well as the web interface, etc, long before the hardware is available.

I seriously doubt this is going to be fast enough to actually run the core voip software, but we'll see. The other core feature - mesh networking - may well be simulatable.

Maybe I can make a virtual box visible on the internet, too. That could help a lot of people.

My hat is off to the QEMU and Debian guys. You're awesome.

Back to hacking together a more modern kernel....

Labels:

 
Wednesday, September 09, 2009

  Accidentally cross building Linux 2.6.31

I'm not really planning on re-entering kernel development. While intensely fascinating, it takes too long to compile on the hardware I have left to me, programming in it is finicky and painful, and getting fixes pushed upstream can be a nightmare, especially on the embedded architectures I used to do so much work on. It takes forever to download updates to whatever git tree I'm working out of, where I am, too.... I have a lot of trees and code lying around that let me build custom OSes quickly, but nothing worth publishing, all of it out of date...

...I am planning on kind of getting involved again, to whatever extent necessary, when the village telco ships some boards, but that's it. Well, that, and freeswitch. I keep telling myself that. I have to keep my involvement in charitable projects down enough so I can afford to eat, next year.

But I got a bee up my butt regarding dd-wrt. DD-WRT is a fabulous upgrade to many consumer grade routers, I've been running it (and its cousin, openwrt) off and on, since the projects' inception. They make consumer grade routers tolerable, with features like dynamic dns, local dns, sip routing, and ipv6. I installed the latest on my WRT300N a while back, and it's quite awesome, a real step up in sane additions to your home network.

I've also been fooling around with ipv6 a lot ever since all of google got on it a few months back, and dd-wrt almost - kind of - works - well enough to tolerate. The default dd-wrt doesn't contain ping6 or iptables6 or a current version of radvd and the web server doesn't do ipv6, and there's no dhcp6 server, and I'd really like to get bind running on it... and... it bugs me and...

... the dd-wrt kernel on this particular router is still at 2.4.X, which is so obsolescent it hardly bears thinking of. Worse, in dd-wrt - that kernel gets compiled with an ancient version of gcc - 3.3 - and there was just no way to get the 20GB+ svn checkout of dd-wrt from there to here without a lot of pain I still can't bear thinking of.

Fiddling with toolchain incompatibilities is something that I'm not even willing to get paid for nowadays. Fixing code to compile is not coding.

There has been a lot of changes to IPv6 that landed in the 2.6 kernel and didn't get backported to 2.4, too. In particular, so far as I know routing announcements got made more sane (so default routes should "just work"), mobile ipv6 (which kind of appears to be a dead project) got incorporated, and all this other cool stuff is in there too (and yea, I'm the type to get excited about fannotify).

I had a little spare time this afternoon...

So, on my well connected host (thank YOU isc!), I pulled down Linus's entire git tree today. It took about 4 minutes. kernel.org is on a GigE network 4 hops away.

traceroute to git.kernel.org (204.152.191.40), 30 hops max, 60 byte packets
1 guest.r1.sql1.isc.org (149.20.54.2) 1.469 ms 1.842 ms 1.832 ms
2 int-0-1-0-0-606.r1.sfo2.isc.org (149.20.65.3) 6.497 ms 6.522 ms 6.502 ms
3 int-3-0-0.r1.pao1.isc.org (149.20.65.129) 4.059 ms 4.070 ms 4.050 ms
4 git2.kernel.org (204.152.191.40) 1.757 ms 1.744 ms 1.725 ms

It would probably take a few days to pull the tree where I live now, and forever where I am moving next week. I try to tradeo-ff bandwidth issues with rsync a lot, pulling down source trees to this machine, then (slowly) pulling them down to my home machines. That way I can handle partial transfers and eventually get what I need to home base, but multi-GB downloads are no fun, regardless...

I configured a basic kernel for the mips + broadcom architecture that's in my WRT300N, did an apt-get install of emdebian's cross development infrastructure (another 20 minutes because it had to come from France) and the gcc 4.3.2 cross toolchains for mips and arm...

and fired off a batch process to compile the kernel.

batch <<AAA
cd ~/src/git/linux-2.6; make O=/home/d/build_wrt CROSS_COMPILE=mipsel-linux-gnu- vmlinux modules
AAA

I may be horribly retro for using batch but I love it - I can queue up lots of work for (this very slow) processor, go offline, and get notified via email when each job finishes. (I configure atd to default to a high load average so it handles the multiple cores better) I queued up a download of the latest dd-wrt tree, too...

About an hour and half later, my email dinged. There wasn't a single error in the compile. It generated the modules, symtabs, and vmlinux, apparently perfectly. Amazing. Compiling for alternate architectures never looked so clean before.

It can't possibly be this easy. No, I don't want to take this further. There's probably definitely something that just won't work on 2.6 on this router, some proprietary module somewhere, and that's why nobody's done it yet... No, I don't want to try booting this kernel on my WRT. No... somebody stop me... please...

I had entered the kernel development schedule into my org-mode so I can surface every so often and check in on things, and I was kind of aware that Linus was planning on releasing 2.6.31 "soon". It turned out that about 5 minutes after that build completed, he released the that exact same code with the change to the makefile calling it 2.6.31...

Now I have to recompile with the right version number, so I did a make clean, and fired off the same batch process.

And checked in on my svn checkout of the rest of dd-wrt. It had hung partway through... but enough came down for me to figure I really could try a new toolchain through the whole thing, update busybox, radvd, and maybe take a stab at cross compiling a minimal version of bind...

Do I really want to rebuild my entire router from source code and move ipv6 another iota towards acceptance?

I just checked the surf report. There's no waves til saturday. I'm doomed. I Sure wish I had two of these wrts available so I could brick one - or a working qemu emulator. Yea, lacking those, it would be insane for me to continue... I *NEED* this router just to exist on the internet...

batch <<AAA
cd ~/src/qemu-0.11.0-rc2; ./configure; make -j 2
AAA

I'm going to dinner now. I need another distraction, fast.

Update: I got back from dinner and went right back into deep hack mode until 6AM. I managed to build an ipv6 enabled version of openwrt for the mesh potato, but have totally failed to get a working mips emulator going...

I guess freeswitch is next. And maybe some more sleep.

Labels: , , ,

 
David Täht writes about politics, space, copyright, the internet, audio software, operating systems and surfing.


Resume,Songs,
My new blog, NeX-6, My facebook page
Orgs I like
The EFF - keeping free speech in the world
Musical stuff I like
Jeff, Rick, Ardour, Jack
Prior Rants - Sharing your home network better in a time of covi... Designing for the disconnect Email lists going down the memory hole Instituting saner, professional source code manage... Wireless and Wifi in 2015 - not what I dreamed of Saving wifi! Fixing Bufferbloat! Fighting the vend... Virgin Media - Fixing the epidemic of bufferbloat ... 49... and trying to find my navel Wheels down on mars! Tracking the landing of Curiosity, from Seattle
Best of the blog:
Uncle Bill's Helicopter - A speech I gave to ITT Tech - Chicken soup for engineers
Beating the Brand - A pathological exploration of how branding makes it hard to think straight
Inside the Internet Mind - trying to map the weather within the global supercomputer that consists of humans and google
Sex In Politics - If politicians spent more time pounding the flesh rather than pressing it, it would be a better world
Getting resources from space - An alternative to blowing money on mars using NEAs.
On the Columbia - Why I care about space
Authors I like:
Doc Searls
Where's Cherie?
UrbanAgora
Jerry Pournelle
The Cubic Dog
Evan Hunt
The Bay Area is talking
Brizzled
Zimnoiac Emanations
Eric Raymond
Unlocking The Air
Bob Mage
BroadBand & Me
SpaceCraft
Selenian Boondocks
My Pencil
Transterrestial Musings
Bear Waller Hollar
Callahans
Pajamas Media BlogRoll Member

If you really want to, you can poke through the below links as well.

ARCHIVES
06/09/2002 - 06/16/2002 / 07/28/2002 - 08/04/2002 / 08/11/2002 - 08/18/2002 / 08/18/2002 - 08/25/2002 / 08/25/2002 - 09/01/2002 / 09/22/2002 - 09/29/2002 / 11/10/2002 - 11/17/2002 / 12/15/2002 - 12/22/2002 / 12/22/2002 - 12/29/2002 / 12/29/2002 - 01/05/2003 / 01/05/2003 - 01/12/2003 / 01/19/2003 - 01/26/2003 / 01/26/2003 - 02/02/2003 / 02/09/2003 - 02/16/2003 / 02/16/2003 - 02/23/2003 / 03/02/2003 - 03/09/2003 / 03/16/2003 - 03/23/2003 / 04/06/2003 - 04/13/2003 / 04/13/2003 - 04/20/2003 / 04/20/2003 - 04/27/2003 / 05/04/2003 - 05/11/2003 / 05/18/2003 - 05/25/2003 / 05/25/2003 - 06/01/2003 / 06/01/2003 - 06/08/2003 / 06/08/2003 - 06/15/2003 / 06/15/2003 - 06/22/2003 / 06/22/2003 - 06/29/2003 / 06/29/2003 - 07/06/2003 / 07/20/2003 - 07/27/2003 / 07/27/2003 - 08/03/2003 / 08/03/2003 - 08/10/2003 / 08/10/2003 - 08/17/2003 / 08/17/2003 - 08/24/2003 / 08/24/2003 - 08/31/2003 / 08/31/2003 - 09/07/2003 / 09/07/2003 - 09/14/2003 / 09/14/2003 - 09/21/2003 / 09/21/2003 - 09/28/2003 / 09/28/2003 - 10/05/2003 / 10/05/2003 - 10/12/2003 / 10/12/2003 - 10/19/2003 / 10/19/2003 - 10/26/2003 / 10/26/2003 - 11/02/2003 / 11/02/2003 - 11/09/2003 / 11/09/2003 - 11/16/2003 / 11/30/2003 - 12/07/2003 / 12/07/2003 - 12/14/2003 / 12/14/2003 - 12/21/2003 / 12/28/2003 - 01/04/2004 / 01/11/2004 - 01/18/2004 / 01/18/2004 - 01/25/2004 / 01/25/2004 - 02/01/2004 / 02/01/2004 - 02/08/2004 / 02/08/2004 - 02/15/2004 / 02/15/2004 - 02/22/2004 / 02/22/2004 - 02/29/2004 / 02/29/2004 - 03/07/2004 / 03/14/2004 - 03/21/2004 / 03/21/2004 - 03/28/2004 / 03/28/2004 - 04/04/2004 / 04/04/2004 - 04/11/2004 / 04/11/2004 - 04/18/2004 / 04/18/2004 - 04/25/2004 / 04/25/2004 - 05/02/2004 / 05/02/2004 - 05/09/2004 / 05/09/2004 - 05/16/2004 / 05/16/2004 - 05/23/2004 / 05/30/2004 - 06/06/2004 / 06/06/2004 - 06/13/2004 / 06/13/2004 - 06/20/2004 / 06/20/2004 - 06/27/2004 / 06/27/2004 - 07/04/2004 / 07/04/2004 - 07/11/2004 / 07/11/2004 - 07/18/2004 / 07/18/2004 - 07/25/2004 / 08/08/2004 - 08/15/2004 / 08/22/2004 - 08/29/2004 / 08/29/2004 - 09/05/2004 / 09/05/2004 - 09/12/2004 / 09/19/2004 - 09/26/2004 / 09/26/2004 - 10/03/2004 / 10/03/2004 - 10/10/2004 / 10/10/2004 - 10/17/2004 / 10/17/2004 - 10/24/2004 / 10/24/2004 - 10/31/2004 / 10/31/2004 - 11/07/2004 / 11/07/2004 - 11/14/2004 / 11/14/2004 - 11/21/2004 / 11/21/2004 - 11/28/2004 / 11/28/2004 - 12/05/2004 / 12/05/2004 - 12/12/2004 / 12/12/2004 - 12/19/2004 / 12/19/2004 - 12/26/2004 / 12/26/2004 - 01/02/2005 / 01/02/2005 - 01/09/2005 / 01/16/2005 - 01/23/2005 / 01/23/2005 - 01/30/2005 / 01/30/2005 - 02/06/2005 / 02/06/2005 - 02/13/2005 / 02/13/2005 - 02/20/2005 / 02/20/2005 - 02/27/2005 / 02/27/2005 - 03/06/2005 / 03/06/2005 - 03/13/2005 / 03/27/2005 - 04/03/2005 / 04/03/2005 - 04/10/2005 / 04/10/2005 - 04/17/2005 / 05/29/2005 - 06/05/2005 / 06/05/2005 - 06/12/2005 / 06/12/2005 - 06/19/2005 / 06/19/2005 - 06/26/2005 / 06/26/2005 - 07/03/2005 / 07/03/2005 - 07/10/2005 / 07/10/2005 - 07/17/2005 / 07/24/2005 - 07/31/2005 / 07/31/2005 - 08/07/2005 / 08/07/2005 - 08/14/2005 / 08/14/2005 - 08/21/2005 / 08/21/2005 - 08/28/2005 / 08/28/2005 - 09/04/2005 / 09/04/2005 - 09/11/2005 / 09/11/2005 - 09/18/2005 / 09/18/2005 - 09/25/2005 / 09/25/2005 - 10/02/2005 / 10/02/2005 - 10/09/2005 / 10/09/2005 - 10/16/2005 / 10/16/2005 - 10/23/2005 / 10/23/2005 - 10/30/2005 / 10/30/2005 - 11/06/2005 / 11/06/2005 - 11/13/2005 / 11/13/2005 - 11/20/2005 / 11/20/2005 - 11/27/2005 / 11/27/2005 - 12/04/2005 / 12/04/2005 - 12/11/2005 / 12/11/2005 - 12/18/2005 / 12/18/2005 - 12/25/2005 / 01/01/2006 - 01/08/2006 / 01/08/2006 - 01/15/2006 / 01/15/2006 - 01/22/2006 / 01/22/2006 - 01/29/2006 / 01/29/2006 - 02/05/2006 / 02/19/2006 - 02/26/2006 / 03/05/2006 - 03/12/2006 / 03/19/2006 - 03/26/2006 / 03/26/2006 - 04/02/2006 / 04/02/2006 - 04/09/2006 / 04/09/2006 - 04/16/2006 / 04/23/2006 - 04/30/2006 / 05/07/2006 - 05/14/2006 / 05/14/2006 - 05/21/2006 / 05/21/2006 - 05/28/2006 / 06/04/2006 - 06/11/2006 / 06/11/2006 - 06/18/2006 / 06/18/2006 - 06/25/2006 / 06/25/2006 - 07/02/2006 / 07/02/2006 - 07/09/2006 / 07/09/2006 - 07/16/2006 / 07/23/2006 - 07/30/2006 / 08/06/2006 - 08/13/2006 / 08/13/2006 - 08/20/2006 / 09/03/2006 - 09/10/2006 / 09/17/2006 - 09/24/2006 / 09/24/2006 - 10/01/2006 / 10/01/2006 - 10/08/2006 / 10/22/2006 - 10/29/2006 / 11/19/2006 - 11/26/2006 / 11/26/2006 - 12/03/2006 / 12/03/2006 - 12/10/2006 / 12/10/2006 - 12/17/2006 / 12/17/2006 - 12/24/2006 / 12/24/2006 - 12/31/2006 / 01/07/2007 - 01/14/2007 / 01/14/2007 - 01/21/2007 / 01/28/2007 - 02/04/2007 / 02/11/2007 - 02/18/2007 / 02/18/2007 - 02/25/2007 / 02/25/2007 - 03/04/2007 / 03/04/2007 - 03/11/2007 / 03/18/2007 - 03/25/2007 / 04/01/2007 - 04/08/2007 / 04/08/2007 - 04/15/2007 / 04/15/2007 - 04/22/2007 / 04/22/2007 - 04/29/2007 / 04/29/2007 - 05/06/2007 / 05/06/2007 - 05/13/2007 / 05/20/2007 - 05/27/2007 / 05/27/2007 - 06/03/2007 / 06/03/2007 - 06/10/2007 / 06/10/2007 - 06/17/2007 / 06/17/2007 - 06/24/2007 / 07/01/2007 - 07/08/2007 / 07/08/2007 - 07/15/2007 / 07/22/2007 - 07/29/2007 / 07/29/2007 - 08/05/2007 / 08/05/2007 - 08/12/2007 / 08/26/2007 - 09/02/2007 / 09/09/2007 - 09/16/2007 / 09/23/2007 - 09/30/2007 / 09/30/2007 - 10/07/2007 / 10/07/2007 - 10/14/2007 / 10/14/2007 - 10/21/2007 / 10/21/2007 - 10/28/2007 / 10/28/2007 - 11/04/2007 / 11/04/2007 - 11/11/2007 / 11/11/2007 - 11/18/2007 / 11/18/2007 - 11/25/2007 / 11/25/2007 - 12/02/2007 / 12/02/2007 - 12/09/2007 / 12/09/2007 - 12/16/2007 / 12/16/2007 - 12/23/2007 / 12/23/2007 - 12/30/2007 / 01/06/2008 - 01/13/2008 / 02/03/2008 - 02/10/2008 / 02/17/2008 - 02/24/2008 / 02/24/2008 - 03/02/2008 / 03/02/2008 - 03/09/2008 / 03/09/2008 - 03/16/2008 / 03/16/2008 - 03/23/2008 / 03/23/2008 - 03/30/2008 / 03/30/2008 - 04/06/2008 / 04/20/2008 - 04/27/2008 / 04/27/2008 - 05/04/2008 / 05/04/2008 - 05/11/2008 / 05/11/2008 - 05/18/2008 / 05/18/2008 - 05/25/2008 / 05/25/2008 - 06/01/2008 / 06/01/2008 - 06/08/2008 / 06/08/2008 - 06/15/2008 / 06/15/2008 - 06/22/2008 / 06/22/2008 - 06/29/2008 / 07/06/2008 - 07/13/2008 / 07/13/2008 - 07/20/2008 / 07/20/2008 - 07/27/2008 / 07/27/2008 - 08/03/2008 / 08/03/2008 - 08/10/2008 / 08/10/2008 - 08/17/2008 / 08/17/2008 - 08/24/2008 / 08/31/2008 - 09/07/2008 / 09/07/2008 - 09/14/2008 / 09/14/2008 - 09/21/2008 / 09/21/2008 - 09/28/2008 / 09/28/2008 - 10/05/2008 / 10/05/2008 - 10/12/2008 / 10/12/2008 - 10/19/2008 / 10/19/2008 - 10/26/2008 / 10/26/2008 - 11/02/2008 / 11/02/2008 - 11/09/2008 / 11/09/2008 - 11/16/2008 / 11/16/2008 - 11/23/2008 / 12/07/2008 - 12/14/2008 / 12/21/2008 - 12/28/2008 / 12/28/2008 - 01/04/2009 / 01/18/2009 - 01/25/2009 / 01/25/2009 - 02/01/2009 / 03/22/2009 - 03/29/2009 / 05/10/2009 - 05/17/2009 / 05/17/2009 - 05/24/2009 / 05/31/2009 - 06/07/2009 / 06/14/2009 - 06/21/2009 / 06/21/2009 - 06/28/2009 / 06/28/2009 - 07/05/2009 / 07/05/2009 - 07/12/2009 / 07/12/2009 - 07/19/2009 / 07/26/2009 - 08/02/2009 / 08/09/2009 - 08/16/2009 / 08/23/2009 - 08/30/2009 / 09/06/2009 - 09/13/2009 / 09/20/2009 - 09/27/2009 / 09/27/2009 - 10/04/2009 / 10/04/2009 - 10/11/2009 / 10/11/2009 - 10/18/2009 / 10/18/2009 - 10/25/2009 / 10/25/2009 - 11/01/2009 / 11/29/2009 - 12/06/2009 / 12/27/2009 - 01/03/2010 / 01/31/2010 - 02/07/2010 / 02/07/2010 - 02/14/2010 / 02/28/2010 - 03/07/2010 / 03/07/2010 - 03/14/2010 / 03/28/2010 - 04/04/2010 / 04/18/2010 - 04/25/2010 / 05/16/2010 - 05/23/2010 / 05/30/2010 - 06/06/2010 / 06/13/2010 - 06/20/2010 / 06/20/2010 - 06/27/2010 / 07/04/2010 - 07/11/2010 / 07/11/2010 - 07/18/2010 / 07/18/2010 - 07/25/2010 / 08/08/2010 - 08/15/2010 / 08/29/2010 - 09/05/2010 / 09/05/2010 - 09/12/2010 / 09/19/2010 - 09/26/2010 / 09/26/2010 - 10/03/2010 / 10/10/2010 - 10/17/2010 / 10/17/2010 - 10/24/2010 / 10/31/2010 - 11/07/2010 / 11/28/2010 - 12/05/2010 / 12/05/2010 - 12/12/2010 / 12/12/2010 - 12/19/2010 / 12/26/2010 - 01/02/2011 / 03/06/2011 - 03/13/2011 / 03/13/2011 - 03/20/2011 / 05/22/2011 - 05/29/2011 / 08/07/2011 - 08/14/2011 / 08/14/2011 - 08/21/2011 / 09/18/2011 - 09/25/2011 / 10/02/2011 - 10/09/2011 / 10/09/2011 - 10/16/2011 / 11/06/2011 - 11/13/2011 / 01/15/2012 - 01/22/2012 / 04/22/2012 - 04/29/2012 / 06/24/2012 - 07/01/2012 / 08/05/2012 - 08/12/2012 / 08/11/2013 - 08/18/2013 / 03/01/2015 - 03/08/2015 / 10/04/2015 - 10/11/2015 / 11/08/2015 - 11/15/2015 / 12/22/2019 - 12/29/2019 / 04/05/2020 - 04/12/2020 /


Powered by Blogger