summaryrefslogtreecommitdiffstats
path: root/kernel-eee/PKGBUILD
blob: 01b1c3c29f2d7d1ad5eb06c4c2f74f696c9e4d07 (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=3.1.1
_kernver=3.1
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/v3.0/linux-$_kernver.tar.bz2
        ftp://ftp.kernel.org/pub/linux/kernel/v3.0/patch-$pkgver.gz
        #ftp://ftp.archlinux.org/other/linux/patch-$pkgver.gz
        61-eee-ssd.rules
        kernelconfig)
_patches=()
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}.0eee/{build,source}
  # install the kernel
  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}.0eee'" > $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=('8d43453f8159b2332ad410b19d86a931'
         '740634b4d2e9c733642c7f9148d535eb'
         '73a20e8bf2bb29ba342f43460c6291cb'
         '5345f0492b1eaf0e578e4ddea078c3a8')