You are not logged in.

#1 2010-04-24 12:09:38

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Review PKGBUILD: compat-wireless

So.. this is my first PKGBUILD, it would be great if someone could look at it and see if it is ok!

There have been some proposed PKBUILDS for compat-wireless in the forums and an old one in AUR, which I used as a start. These included patching the makefile, but this seems no longer necessary (or believing so was a big mistake on my side...?).

The original "make install" routine runs three parts in the makefile:
1. uninstall
2. install-modules
3. install-scripts

In the beginning, I moved all the stuff either into the PKGBUILD or in the .install file, but I stripped out a lot of it already. To make it easier to see what I moved where, see this file (the relevant parts of the makefile with comments what I did with them).

PKGBUILD

pkgname=compat-wireless
pkgver=2010_04_23
pkgrel=1
pkgdesc='Snapshots of the wireless-testing tree ported to older kernels'
arch=('i686' 'x86_64')
url='http://wireless.kernel.org/'
license=('GPL')
depends=('kernel26')
makedepends=('kernel26-headers' 'sed')
install=$pkgname.install
source=(http://wireless.kernel.org/download/compat-wireless-2.6/$pkgname-${pkgver//_/-}.tar.bz2)
sha1sums=('ac57ae322443b256c2bcfc05b970ecab341a54da')

build() {
  cd "$srcdir/$pkgname-${pkgver//_/-}"
  #select driver (optional): ath9k ath9k_htc ar9170 b43 zd1211rw
  scripts/driver-select ath9k
  make || return 1
  make INSTALL_MOD_PATH=$pkgdir install-modules || return 1
  install -dm755 $pkgdir/usr/sbin
  install -dm755 $pkgdir/usr/lib/compat-wireless
  install -dm755 $pkgdir/lib/udev/rules.d
  install scripts/modlib.sh        $pkgdir/usr/lib/compat-wireless/
  install scripts/madwifi-unload    $pkgdir/usr/sbin/
  install scripts/athenable        $pkgdir/usr/sbin/
  install scripts/b43enable        $pkgdir/usr/sbin/
  install scripts/iwl-enable        $pkgdir/usr/sbin/
  install scripts/athload        $pkgdir/usr/sbin/
  install scripts/b43load        $pkgdir/usr/sbin/
  install scripts/iwl-load        $pkgdir/usr/sbin/
  install udev/compat_firmware.sh    $pkgdir/lib/udev/
  install udev/50-compat_firmware.rules $pkgdir/lib/udev/rules.d/
  install scripts/check_depmod      $pkgdir/usr/lib/compat-wireless/
}

compat-wireless.install

post_install() {
  /usr/lib/compat-wireless/check_depmod
  /sbin/depmod
  echo
  /usr/sbin/athenable ath5k
  /usr/sbin/iwl-enable iwlagn
  echo 
  echo Madwifi has been disabled, when present.If you
  echo would like to enable MadWifi at a later time 
  echo and disable ath5k you can run: 
  echo sudo athload madwif
  echo
  echo To use the new modules, unload your old wireless 
  echo modules first and load them again, or simply reboot. 
  echo 
  echo Make sure to have read the full documentation under
  echo http://wireless.kernel.org/en/users/Download
  echo
}

post_upgrade() {
  /sbin/depmod
  echo
  /usr/sbin/athenable
  /usr/sbin/iwl-enable
  echo 
  echo Madwifi has been disabled, when present.If you
  echo would like to enable MadWifi at a later time 
  echo and disable ath5k you can run: 
  echo sudo athload madwif
  echo
  echo To use the new modules, unload your old wireless 
  echo modules first and load them again, or simply reboot. 
  echo 
  echo Make sure to have read the full documentation under
  echo http://wireless.kernel.org/en/users/Download
  echo
}

post_remove() {
    /sbin/depmod 
}

This script here I am not sure if it is really needed, the conf file seems absent but the scripts says all fine:
checkdepmod

    @# Mandrake doesn't have a depmod.d/ conf file to prefer
    @# the updates/ dir which is what we use so we add one for it
    @# (or any other distribution that doens't have this).

Right now I have it install under /usr/libs/compat-wireless and run from post.install.


Any comments about the sanity of this? I basically made it up from what the original files seemed to do, but I have no particular knowledge even of bash  - so my confidence with the product is not-so-great (it builds and installs fine on my system, though).

edit: link fixed / added Allan' suggestions / typo / real stupid typo

Last edited by hokasch (2010-04-25 02:46:09)

Offline

#2 2010-04-24 13:20:15

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,427
Website

Re: Review PKGBUILD: compat-wireless

Use (e.g.) "install -dm755 $pkdir/usr/lib" instead of mkdir.

The kernel-version sed is a bit ugly...   I would just let people manually adjust that in the .install file.  You can make that easier by defining it at the top of the file.

Just make the depends kernel26.

Offline

#3 2010-04-24 13:45:51

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Review PKGBUILD: compat-wireless

Thanks!

Actually, when I think about it, specifying the kernel when running depmod could probably be removed. In the hypothetical case that someone installs the package under a different kernel than it was build on, depmod will be run in rc.sysinit on next boot anyway.

Offline

#4 2010-04-24 20:31:40

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: Review PKGBUILD: compat-wireless

There are some trubles.

install: cannot change permissions of `/usr/lib/sbin': No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/lib/compat-wireless/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/sbin/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/sbin/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/sbin/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/sbin/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/sbin/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/sbin/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/sbin/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/lib/udev/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/lib/udev/rules.d/' is not a directory: No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/lib/compat-wireless/' is not a directory: No such file or directory

And the build failes.

Am I missing something? It fails on

install: cannot change permissions of `/usr/lib/sbin': No such file or directory
install: target `/data/myabs/compat-wireless/pkg/usr/lib/compat-wireless/' is not a directory: No such file or directory

Last edited by ammon (2010-04-24 23:22:24)

Offline

#5 2010-04-25 02:46:22

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Review PKGBUILD: compat-wireless

sorry, copied over a typo into the above PKGBUILD ("$pkdir"). Should work again.
lesson: always post _exactly_ the file you've tested with...

Offline

#6 2010-04-26 10:40:06

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Review PKGBUILD: compat-wireless

Alright, I'll adopt the aur package then, and update it ~once a week for now - bumping it yourself is obviously very easy anyway.

A "dynamic", always up-to-date package should probably use git, since there are so much issues with the "normal" tarball builds (version naming, checksums, entering src-dir etc), but it looks to me like one would have to check out the whole linux-next.git tree to do this -  not worth the effort.  If someone has any tips how this could be solved, please share them!

Offline

#7 2010-04-26 15:47:02

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: Review PKGBUILD: compat-wireless

Hey I have some troubles with installing it.

WARNING: Loop detected: /lib/modules/2.6.34-rc5-00142-g33eaf78-dirty/updates/drivers/net/wireless/iwlwifi/iwlcore.ko which needs iwlcore.ko again!
WARNING: Module /lib/modules/2.6.34-rc5-00142-g33eaf78-dirty/updates/drivers/net/wireless/iwlwifi/iwlcore.ko ignored, due to loop
WARNING: Module /lib/modules/2.6.34-rc5-00142-g33eaf78-dirty/updates/drivers/net/wireless/iwlwifi/iwlagn.ko ignored, due to loop
WARNING: Module /lib/modules/2.6.34-rc5-00142-g33eaf78-dirty/updates/drivers/net/wireless/iwlwifi/iwl3945.ko ignored, due to loop

This is with git kernel.

Offline

#8 2010-04-26 16:41:56

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Review PKGBUILD: compat-wireless

These warning appear as well when building manually from the compat-wireless tarball - this is not a problem with the PKGBUILD. You don't have to build all wireless drivers, just select the one you need (look at the build array).

compat-wireless are backports from the development tree, so if you build the newest kernel from git you shouldn't really need them.

Offline

#9 2010-04-26 17:35:45

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: Review PKGBUILD: compat-wireless

Yes I know I can choose driver, I need only ath9_htc, driver is still not in main git but one can find it in compat-wireless.
I had many experiments with compat-wireless and none of them worked.
This one is not working too, but I still have to try something. Ill report latter.

Offline

#10 2010-04-26 17:42:04

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Review PKGBUILD: compat-wireless

If it won't work the traditional "make/sudo make install" way, the PKGBUILD won't fix it...
The warnings about intel driver module above disappear when you select ath9k only.

Offline

#11 2010-04-27 13:27:00

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: Review PKGBUILD: compat-wireless

Ok, it works with kernel-git. Ath9k_htc one. But it is still low quality driver. Practicly useless. Thank you for pkgbuild. It makes testing easier.

Offline

Board footer

Powered by FluxBB