summaryrefslogtreecommitdiffstats
path: root/kernel-eee/PKGBUILD
blob: 0e2c48e03f549cd09c4f5b35e17f8818e897604c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Maintainer: Dan McGee <dan@archlinux.org>

pkgname=kernel-eee
pkgver=2.6.39
_kernver=2.6.39
pkgrel=1
pkgdesc="The Linux Kernel and modules for the Asus Eee PC 701"
arch=('i686')
license=('GPL2')
url="http://www.kernel.org"
groups=(eee)
depends=('coreutils' 'module-init-tools')
optdepends=('crda: for wireless regulatory domain support'
            'iw: for wireless configuration support')
replaces=('linux-uvc-eee-svn' 'madwifi-eee-svn')
install=kernel-eee.install
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_kernver.tar.bz2
        ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-$pkgver.bz2
        61-eee-ssd.rules
        kernelconfig)
_patches=(fix_autosense_emulation.patch)
source=(${source[@]} ${_patches[@]})

build() {
  # unset since our build machine may differ from eee
  unset CFLAGS CXXFLAGS

  # get into the linux source directory and start some magic
  cd $srcdir/linux-$_kernver

  if [ "$_kernver" != "$pkgver" ]; then
    # add latest kernel stable patch
    patch -Np1 < ../patch-$pkgver || return 1
  fi

  # patch time!
  for p in "${_patches[@]}"; do
    patch -Np1 < ../$p || return 1
  done

  # load configuration and build kernel + modules
  cp ../kernelconfig ./.config
  make silentoldconfig
  make || return 1
}

package() {
  # install our modules
  cd $srcdir/linux-$_kernver
  mkdir -p $pkgdir/{lib/modules,boot}
  make INSTALL_MOD_PATH=$pkgdir modules_install || return 1

  # remove the junk symlinks
  cd $srcdir/linux-$_kernver
  rm $pkgdir/lib/modules/${pkgver}eee/{build,source}
  # install the kernel
  cp System.map $pkgdir/boot/System.map.eee
  cp arch/x86/boot/bzImage $pkgdir/boot/vmlinuzeee
  # install a helper file for all install scripts
  mkdir -p $pkgdir/usr/share/kernel-eee/
  echo "KERNEL_VERSION='${pkgver}eee'" > $pkgdir/usr/share/kernel-eee/currver

  # udev rules for SSD drives
  mkdir -p $pkgdir/lib/udev/rules.d/
  install -m644 $srcdir/61-eee-ssd.rules $pkgdir/lib/udev/rules.d/
}

md5sums=('1aab7a741abe08d42e8eccf20de61e05'
         '07c8b7463009b336f54aca3d99e6fa3d'
         '73a20e8bf2bb29ba342f43460c6291cb'
         '15a4955061790e9e74c3bcccf23c7443')