Open Source Workshop #2 - Voyage Linux Introduction

I have given a 5 min lightning talk about Voyage Linux in Open Source Workshop #2 held in Hong Kong Polytechnic University on Jan 14, 2012.

The presentation slides could be found here:

It is a nice gathering for all open source developers in Hong Kong to meet regularly. I decide to join the workshop whenever I have free ti

Spam protected email address for mailman archive

As a voyage-linux list administrator, I have recently received a request from a list member for removing his email address from the archive. I have reviewed the archive immediately and the email address is shown as "xxx at yyy.com", which makes intelligent spam-bots easily to find out the email address.

I have prepared the a script called "replace_spam.sh" to replace "xxx at yyy.com" with "(spam-protected)" for all archived messages.

#!/bin/sh
for FILE in 20[0-9][0-9]-*/0*.html
do
    echo $FILE
    #grep "TITLE=.*\>.* at .*$" $FILE
    sed -e "s/TITLE=\(.*\)>.* at .*$/TITLE\1>\(spam-protected\)/" -i $FILE
done

Put the script to the archive root and run it:

# cd /usr/local/mailman/archives/private/voyage-linux
# replace_spam.sh

Next, we need to change the achiver program such that it will not generated "xxx at yyy.com" as well. In /usr/local/mailman/Mailman/Archiver/HyperArch.py, change:

-                self.email = re.sub('@', _(' at '), self.email)
+                self.email = "(spam-protected)"

-                author = re.sub('@', _(' at '), self.author)
+                author = "(spam-protected)"

-            author = re.sub('@', _(' at '), author)
+            author = "(spam-protected)"

That's it. When new mail comes from the list member, the archiver will now mask xxx at yyy.com email address as "(spam-protected)".

2010-06-08 Update: Two of the above changes in incorrect. Now fixed. I also have found a way to regenerate all the archive by using this command:

# cd /usr/local/mailman
# bin/arch voyage-linux archives/private/voyage-linux.mbox/voyage-linux.mbox 

Subversion to DVCS - Your mindset has to change as well

Joel Spolsky has setup Mercurial Tutorial [1] that help developers understand DVCS and work it works.

Joel shares the same confusion as I have with git and mercurial. Right now, I still don't buy the way how git and mercurial work. Hoping I will accept the novel DVCS concept with a my mindset change.

The key point is: don't assume your subversion knowledge will apply to DVCS, it will just make you more confused. And you need re-education to learn this new version control concept again.

[1] - Hg Init: a Mercurial tutorial

DNMA92, ath9k and hostapd with Voyage Linux

| |

After the release of Voyage Linux 0.6.5, I finally have time to explore AP mode with ath9k driver.

DNMA-92 wireless card is donated by PCEngines for ath9k driver and Voyage Linux integration.

First, you will need to install iw package from http://www.voyage.hk/dists/0.6/iw/. Voyage Linux 0.6.5 didn't package it, so you need to install it manually.

Although you won't need iw tool in the instructions further below, you can use it for getting information on your nl80211 based wireless interface instead of iwconfig (See this page for more info). To start with, install iw tool:

# remountrw
# wget http://www.voyage.hk/dists/0.6/iw/iw_0.9.14-1_i386.deb
# dpkg -i iw_0.9.14-1_i386.deb
According to this link, ath9k will need to use nl80211 driver for hostap functions. So, in /etc/hostapd/hostapd.conf, append the following at the end of the file.
driver=nl80211
interface=wlan0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
debug=4
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
macaddr_acl=0
auth_algs=3
eapol_key_index_workaround=0
eap_server=0
wpa=3
ssid=voyage-wpa
wpa_passphrase=voyage-wpa
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
channel=11
hw_mode=g
eapol_version=1
Please note that Voyage Linux use wlan0 for ath9k interface. From the above configure, I have configured WPA/WPA2, using voyage-wpa as both SSID and pre-shared key, running 802.11g mode on channel 11. eapol_version=1 is set for backward compatibility to my damn old 2001 iBook. Later, I may further explore on setting up 802.11n mode, I won't do it now since I have no client device with 11n.

At last, don't forget to enable wlan0 in /etc/network/interfaces:

auto wlan0
iface wlan0 inet static
        address 10.1.10.1
        netmask 255.255.255.0
        broadcast 10.1.10.255
        up nat.sh wlan0 eth0 "10.1.10.0/24"
You don't need to set anything with iw tools since hostapd will do it for you. Now, make sure hostapd is enabled in /etc/default/hostapd and restart wlan0 interface and hostapd by:
# ifdown wlan0
# ifup wlan0
# /etc/init.d/hostapd restart
That's it. I can now connecting my iBook and iPhone to Voyage Linux with running ath9k in AP mode!

Slides for Open Source Developer talk at SFD

| |

Although my session in SFD is a little bit rush, I got a good feeling that my presentation on Voyage Linux project is a successful one. Here is the slides of my session:

At last, I would like to thank the organizer and Ben Lau for arranging SFD event and a session for introducing Open Source Developer in HK.

DIY Open Source Project (Part 1)

| |

Nowadays, the easiest way to setup an open source project is hosting via sourceforge.net. But did you ever think about hosting a project by yourself so that you will have complete control of the project and not dependent by others? My project, Voyage Linux, is built by me little-by-little, bit-by-bit over 4-year time span. At the time of writing (Sep 2009), the project homepage has over 10,000 pageviews per month, the community mailing list has 430 subscribes, and 13 country mirror sites from sponsors.

This series of articles documents my experiences on setting up open source project totally by yourself. Part 1 of this series covers the preparation before setting up open source project that includes the following topics:

  • Setting up dedicate Linux Server
  • Selecting ISP
  • Domain name registration

Open Source Developer talk at Software Freedom Day 2009 HK

| |

Invited by Ben Lau, I will present Voyage Linux project at Software Freedom Day 2009 HK on 19 Sept 2009 to share my experiences as an open source developer in Hong Kong.

I have conducted similar talk back in 2007 at Linux the Gathering #3. I am looking forward to meeting up with other open source hackers in Hong Kong, and I am particularly interested in the project related to Linux DMB-T driver.

I am now preparing the slides for the talk, and will probably publish it on punknix.com after the talk. These weeks, I am preparing a series of articles about DIY setting up OSS project. Hopefully, I am able to publish the first article before the talk.

Building compat-wireless drivers for 2.6.30

| |

ath5k driver in 2.6.30 does not support AP mode. After a bit of research, it was found that the latest compat-wireless code supports it and it will be probably included in 2.6.31. For 2.6.30 kernel, I will need to build from either compat-wireless or to patch it. It is a bit troublesome to build the driver modules out-of-kernel-tree and cannot use debian's make-kpkg to bundle the drivers in the kernel image. Since I am testing it rather than releasing it, I should investigate later to build compat-wireless module package.

First, download bleeding-edge source code and extract it. As describe here, you cannot use wget to automate the download of compat-wireless-2.6.tar.bz2, which contain all the latest codes of wireless drivers. However, the tarball with a date in the file name (e.g. compat-wireless-2009-07-10.tar.bz2) can. So browse this directory and download the tarball with the current date accordingly:

# cd /usr/src/
# wget http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2009-07-10.tar.bz2
# tar -jxf compat-wireless-2009-07-10.tar.bz2 
Since I build the drivers for Voyage Linux kernel, I need to specify KLIB and KLIB_BUILD to different directory. Otherwise, "uname -r" will be used to determine your kernel version.
# cd /usr/src/compat-wireless-2009-07-10
# make KLIB=/usr/src/linux-source-2.6.30-voyage/ \
    KLIB_BUILD=/usr/src/linux-source-2.6.30-voyage/
This will built all modules /usr/src/compat-wireless-2009-07-10. To get all the .ko driver modules, it is more tricky and you need to specify the correct variables accordingly.
# mkdir -p /root/compat-wireless 
# make -C /usr/src/linux-source-2.6.30-voyage/ \
   M=/usr/src/compat-wireless-2009-07-10 \
   INSTALL_MOD_PATH=/root/compat-wireless modules_install
Now all the latest drivers are now installed to /root/compat-wireless so that I can transfer the driver modules from there to my ALIX board using scp easily.

leds-alix2 module in 2.6.30 kernel

| |

When reviewing 2.6.30 kernel changes, I have found that leds support for ALIX.2/3 is now added to vanilla kernel. But when I compare the source between the openwrt version, I found they they are written by different authors. Voyage Linux 0.6.2 uses the leds-alix module written by Petr Liebman and leds-alix2 modules in 2.6.30 is written by Constantin Baranov. No matter which one is better, the one in the vanilla kernel is the champion. So the work is to port existing Voyage Linux code to load leds-alix2 instead.

After switching to 2.6.30, the driver cannot recognize my ALIX.3A (early) board. To workaround this, I need to use force parameter to bypass the BIOS check, that is

# modprobe leds-alix2 force

squashfs 4.0 on Debian Lenny and 2.6.30 kernel

| |

Recently, I started 2.6.30 kernel development on Voyage Linux. When reviewing 2.6.30 changes, I found that squashfs is now included in vanilla kernel. So I am very pleased to use the built-in squashfs module instead of out of tree module.

One notable thing of the in-kernel squashfs module is with a newer version 4.0 than version 3.3 provided in Lenny and/or Voyage Linux 0.6.2. Running re-built Voyage Linux Live CD with a 2.6.30 kernel, squashfs filesystem cannot be mount as the same time I was surprisingly to know that squashfs 4.0 module is incompatible to 3.x squashfs filesystem. That's why the mount failure comes out.

I have no choice but have to rebuilt squashfs-tools package from squeeze/sid. I download and rebuild the package on Lenny by:

# dget http://ftp.de.debian.org/debian/pool/main/s/squashfs/squashfs_4.0-1.dsc
# (however, it complains key-ring not found, so use dpkg-source)
# dpkg-source -x squashfs_4.0-1.dsc
# cd squashfs-4.0
# debuild
Then, upload the built package to Voyage Linux experimental repository. Rebuild the Live CD, and everything works again.