summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorFrans-Willem Hardijzer2019-07-27 10:54:47 +0200
committerFrans-Willem Hardijzer2019-07-27 10:54:47 +0200
commit30184b3fcf60fb70ce9442001b5e5326832aed58 (patch)
tree882614d11c18ac576ca404224b145e5ea361b752 /PKGBUILD
parent0fc791d02018e1856df2e934a99f0c6e06d26eb4 (diff)
downloadaur-30184b3fcf60fb70ce9442001b5e5326832aed58.tar.gz
Attempt at adding headers package to enable DKMS modules.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD26
1 files changed, 24 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 0bb3ae07497..d2f221ee82b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,6 @@
# Maintainer: Frans-Willem Hardijzer <fw@hardijzer.nl>
-pkgname=linux-surface-jakeday-bin
+pkgbase=linux-surface-jakeday-bin
+pkgname=(linux-surface-jakeday-bin linux-surface-jakeday-bin-headers)
pkgver=5.0.10
pkgrel=1
_releasenum=5
@@ -11,14 +12,17 @@ license=('custom')
options=(!strip)
source=(
"https://github.com/jakeday/linux-surface/releases/download/${pkgver}-${pkgrel}/linux-image-${pkgver}-surface-linux-surface_${pkgver}-surface-linux-surface-${_releasenum}_amd64.deb"
+ "https://github.com/jakeday/linux-surface/releases/download/${pkgver}-${pkgrel}/linux-headers-${pkgver}-surface-linux-surface_${pkgver}-surface-linux-surface-${_releasenum}_amd64.deb"
"linux.preset"
"60-linux.hook"
"90-linux.hook"
)
noextract=(
"linux-image-${pkgver}-surface-linux-surface_${pkgver}-surface-linux-surface-${_releasenum}_amd64.deb"
+ "linux-headers-${pkgver}-surface-linux-surface_${pkgver}-surface-linux-surface-${_releasenum}_amd64.deb"
)
md5sums=('12d8bac0d8e32a4faf00ee138f69949a'
+ '31626e7edcd3a22ef0311ada70b57d49'
'a329f9581060d555dc7358483de9760a'
'ce6c81ad1ad1f8b333fd6077d47abdaf'
'b448c99f0ea9aaee9b13784958a98fd0')
@@ -29,9 +33,15 @@ prepare() {
cd kernel-deb
ar x "${srcdir}/linux-image-${pkgver}-surface-linux-surface_${pkgver}-surface-linux-surface-${_releasenum}_amd64.deb"
tar -xf data.tar.xz
+
+ cd "${srcdir}/"
+ mkdir -p header-deb
+ cd header-deb
+ ar x "${srcdir}/linux-headers-${pkgver}-surface-linux-surface_${pkgver}-surface-linux-surface-${_releasenum}_amd64.deb"
+ tar -xf data.tar.xz
}
-package() {
+package_linux-surface-jakeday-bin() {
install -d "${pkgdir}/boot"
install -Dm644 "${srcdir}/kernel-deb/boot/vmlinuz-${pkgver}-surface-linux-surface" "${pkgdir}/boot/vmlinuz-linux-surface-linux-surface"
install -d "${pkgdir}/etc/mkinitcpio.d"
@@ -68,3 +78,15 @@ package() {
depmod -b "${pkgdir}/usr" -F "${srcdir}/kernel-deb/boot/System.map-${_kernver}" "${_kernver}"
}
+
+package_linux-surface-jakeday-bin-headers() {
+ local _kernver=${pkgver}-surface-linux-surface
+ install -d "${pkgdir}/usr/lib/modules/"
+ install -d "${pkgdir}/usr/lib/modules/${_kernver}"
+ cp -r "${srcdir}/header-deb/usr/src/linux-headers-${_kernver}" "${pkgdir}/usr/lib/modules/${_kernver}/build"
+ # Remove all non-x86 architectures
+ for remove_arch in $(ls "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/" | grep -v "x86\|Kconfig")
+ do
+ rm -rf "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${remove_arch}"
+ done
+}