2008年5月31日土曜日

EeePCで無線LANがつながらなくなる

先日のアップデートにてカーネルのバージョンが上がって、EeePCの無線LANがつながらなくなりました。というわけで、またつながるようにします。簡単にドライバを導入できるようにパッケージを作ってみました。
http://rep2.clear-net.jp/temp/eeepc-madwifi-modules-2.6.24-17-generic_1.0.0-1_i386.deb
$ sudo dpkg -i eeepc-madwifi-modules-2.6.24-17-generic_1.0.0-1_i386.deb
$ sudo update-rc.d -f linux-restricted-modules-common remove
$ sudo depmod -a -q -F /boot/System.map-2.6.17-generic
PCを再起動して、つながるようになります。

以下、作成手順を書いていきます。よくわからず作ったので、色々間違ってるかも。
$ wget 'http://snapshots.madwifi.org/special/madwifi-nr-r3366+ar5007.tar.gz'
$ tar xvzf madwifi-nr-r3366+ar5007.tar.gz
$ sudo apt-get install dh-make debhelper devscripts fakeroot
(パッケージ作成ソフトのインストール)
$ mv madwifi-nr-r3366+ar5007 eeepc-madwifi-1.0.0
(パッケージ化するときは、<パッケージ名>-<バージョン>としないとだめらしい)
$ cd eeepc-madwifi-1.0.0
$ dh_make -e mail@address -f ../madwifi-nr-r3366+ar5007.tar.gz
Type of package: single binary, multiple binary, library, kernel module or cdbs?
[s/m/l/k/b] k
(kでカーネルモジュールのパッケージにする)
$ cd debian
$ mv postinst.ex postinst
$ rm *.ex
$ rm *.EX
$ cp control.modules.in control
$ gedit control
---
Source: eeepc-madwifi
Section: unknown
Priority: optional
Maintainer: u1f
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2

Package: eeepc-madwifi-modules-2.6.24-17-generic
Architecture: any
Provides: eeepc-madwifi-modules
Description: eeepc-madwifi modules for Linux (kernel 2.6.24-17-generic).
This package contains the set of loadable kernel modules for the Atheros Wireless LAN Adaptor.
This package contains the compiled kernel modules for 2.6.24-17-generic.
If you have compiled your own kernel, you will most likely need to build
your own eeepc-madwifi-modules. The eeepc-madwifi-source package has been
provided for use with the Debian's module-assistant or kernel-package
utilities to produce a version of eeepc-madwifi-modules for your kernel.
---

$ gedit rules
---
# Copy only the driver source to the proper location
#cp -s driver/* debian/$(psource)/usr/src/modules/$(sname)
# Copy the needed debian/ pieces to the proper location
#cp debian/*modules.in* \
# debian/$(psource)/usr/src/modules/$(sname)/debian
#cp debian/*_KVERS_* debian/rules debian/changelog debian/copyright \
# debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/
#cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar
.bz2 && rm -rf modules
make install DESTDIR=$(CURDIR)/debian/eeepc-madwifi-modules-2.6.24-17-generic
---

として、パッケージをビルドしました。
$ sudo dpkg-buildpackage -rfakeroot