- Spam protected email address for mailman archive
- Subversion to DVCS - Your mindset has to change as well
- DNMA92, ath9k and hostapd with Voyage Linux
- Slides for Open Source Developer talk at SFD
- Open Source Developer talk at Software Freedom Day 2009 HK
- Building compat-wireless drivers for 2.6.30
- leds-alix2 module in 2.6.30 kernel
- squashfs 4.0 on Debian Lenny and 2.6.30 kernel
- Upgrade Debian Etch Xen 3.0.2 to Lenny Xen 3.2
- Modrewriting viewcvs to viewvc in Apache2
Building kernel module with module assistant (madwifi, zaptel, openswan and kvm)
In the previous post I showed how to build an external kernel modules. In this post, I explored another way to build kernel module using module assistant. For modules that could be built by module assistant, the module source must be available as deb package in the form of
Since madwifi-source is under non-free, I will need to modify /etc/apt/source.list to include non-free and contrib.
deb http://ftp.hk.debian.org/debian/ etch main contrib non-free deb-src http://ftp.hk.debian.org/debian/ etch main contrib non-free
Next, install the source deb package as always:
# apt-get install madwifi-sourceThis will download the source the module source to /usr/src/madwifi.tar.bz2
If you have not installed module-assistant (or even build-essential) before, because of package dependency it will install along with the module source together.
To build and install, you just need to run one command:
# m-a a-i madwifi-sourcewhere m-a stands for module-assistant and a-i stands for auto-install. So, this command will build the kernel module from source, and automatically install it.
Since I have a Mini-PCI to PCI converter with Senao NMP-8601 Mini-PCI card plugged on it. I can now load the madwifi module:
# modprobe ath_pci # dmesg| egrep "ath|wifi" ath_hal: module license 'Proprietary' taints kernel. ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) ath_rate_sample: 1.2 (0.9.3) ath_pci: 0.9.4.5 (0.9.3) wifi0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps wifi0: H/W encryption support: WEP AES AES_CCM TKIP wifi0: mac 10.5 phy 6.1 radio 6.3 wifi0: Use hw queue 1 for WME_AC_BE traffic wifi0: Use hw queue 0 for WME_AC_BK traffic wifi0: Use hw queue 2 for WME_AC_VI traffic wifi0: Use hw queue 3 for WME_AC_VO traffic wifi0: Use hw queue 8 for CAB traffic wifi0: Use hw queue 9 for beacons wifi0: Atheros 5212: mem=0xfdde0000, irq=217
Actually, you don't need to install the module source before running module-assistant to build it. module-assistant can do it in one shot. For example, to download, build and install zaptel and openswan by just:
# m-a a-i zaptel openswanYou don't even need to specify "-source" as well. module-assistant make the guess for you.
One more thing, I am going to show how to enable kvm kernel module on etch. kvm stands for kernel-based virtual machine [1] which is now available in 2.6.20 kernel. However, it is known to be compatible to 2.6.18 so that I give it a try. Using Debian package search function, I can find the kvm (the userland) and kvm-source (the module source) package, but it is in unstable repository.
So I download the both the module source and userland package manually:
# wget http://debian.cn99.com/debian/pool/main/k/kvm/kvm-source_18-1_all.deb # wget http://debian.cn99.com/debian/pool/main/k/kvm/kvm_18-1_i386.debAnd install it with:
# dpkg -i kvm*.debYou may encounter dependency complaints from dpkg. Install the required packages manually to satify the dependency. In my case, it requires bridge-utils (your mileage may vary):
# apt-get install bridge-utils # dpkg -i kvm*.debNow, both kvm and kvm-source are installed.
Next, use the same procedure to build kvm kernel module, that is:
# m-a a-i kvmand you are done!
Right now, I have the kvm module for 2.6.18 kernel! Check here:
# modinfo kvm-intel kvm-amd filename: /lib/modules/2.6.18-4-k7/misc/kvm-intel.ko author: Qumranet license: GPL vermagic: 2.6.18-4-k7 SMP mod_unload K7 REGPARM gcc-4.1 depends: kvm filename: /lib/modules/2.6.18-4-k7/misc/kvm-amd.ko author: Qumranet license: GPL vermagic: 2.6.18-4-k7 SMP mod_unload K7 REGPARM gcc-4.1 depends: kvmAlright, since I have k8 cpu, so load kvm-amd:
# modprobe kvm-amdAnd verify with lsmod:
# lsmod| grep kvm kvm_amd 15112 0 kvm 57572 1 kvm_amdLovely. The kernel module part was done! The rest will be making virtual machines run under kvm. Please stay tuned in punknix.com as I will explore it in the coming weeks.


