Bleah!/ blog/ tags/ Linux

Linux is an operating system kernel, originally created by Linus Torvalds, but now one of the larger free software projects around with numerous contributors from around the world.

Installing OpenWRT on a Netgear DG834

Twice a year ManLUG has an InstallFest, where people bring in their computers and install GNU/Linux on them, and picking the brains of the other attendees. Normally they aren’t that interesting to me, and I’ll just chat to people, or get on with something on my laptop. I was going to go about installing a few GNU/Linux distributions on some virtual machines, which seemed quite suitable for an InstallFest, but instead got distracted by a Netgear router.

The router is a Netgear DG834. The initial difficulty was finding the exact model so we could be sure we were following the right instructions. All we had to go on was the model name of “DG834” but the OpenWRT wiki documents the DG834G and DG834GT. It has a TI AR7 processor, so that ruled out the DG834GT, and was an older model (the case design also gives that away), so we concentrated on the documentation for the DG834G version 1. The firmware version was reported as 3.01.25, which also helped identify it. I saw the note about firmware from this version onwards using LZMA compression, and spent some time attempting to build the patched squashfs. I didn’t manage to build it because I was missing the lzma library. I grabbed the LZMA SDK, but that didn’t help much either.

Simon Hobson came over for a bit of a nosey, and got me back on track. As per the instructions for the DG843G, we backed up the flash devices, and modified the one containing the bootloader. I didn’t have a hex editor, so used vim and xxd to edit the image. Vim mangled it, and the checksum didn’t match the expected checksum after the change. Lesson learnt. Instead of opening binary files in vim, hexifying with ‘:%!xxd’, editing then de‐hexifying with ‘:%!xxd -r’, I first run ‘xxd’, edit the result, then run ‘xxd -r’ on it. After copying the modified bootloader back, and restarting the router, we were pleased to find that it came back up successfully.

Unfortunately that’s all we had time for, and we only managed to change four bytes. The plan is to perform the install at next month’s meeting, after Jim Jackson’s talk on IPv6. It should prove to be another interesting meeting, and not just because of the router: I’ll be paying attention the the IPv6 talk.

I currently use IPv6 at home via a tunnel broker (Hexago, formerly Freenet6), but I haven’t updated any of my servers to do so. One of the reasons blocking it was the lack of support for stateful filtering in the Linux kernel. As of version 2.6.20 this changed, and Bytemark (yes, that’s a sneaky referral link, here is a non‐referral link) have some kernels with the relevant options in testing, so I shall be requesting a block of the IPv6‐space from them soon (yes, Bytemark are great, they’ll give you IPv6 connectivity as a free extra).

Posted Sat 20 Oct 2007 19:06:13 BST Tags: Linux
Mounting / with the ‘nodev’ option

“Linus put his device files in /dev, and so should you.”

fophillips in #lugradio, from The Linux Kernel Module Programming Guide

I almost responded to that by saying “device files would be pretty useless in anywhere but /dev on my boxen, because they’re not allowed anywhere else” but that’s not strictly true. My rootfs, because that’s where /dev lives, is mounted with the ‘dev’ option (or rather ‘defaults’ which includes ‘dev’).

I then continued with “since my /dev is actually a tmpfs (udev), could / be mounted with nodev?”

The answer turns out to be “yes”, at least with some basic testing. I first tried remounting / with the ‘nodev’ option, accessing devices, and creating device files. Things seemed to happen normally, so I rebooted with a modified fstab(5), and things seem to be working fine.

Are there any pitfalls I’m missing here?

Posted Tue 14 Aug 2007 00:23:07 BST Tags: Linux