summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Chen2020-11-25 17:00:47 +0800
committerJack Chen2020-11-25 17:00:47 +0800
commita159caf9eaecd0735d19d209809c4d224b169059 (patch)
tree619235feba745ae652c5638cfcd9072f5de3f10c
parent418f1c04fb3897c9e95d400014f6f6802799cdef (diff)
downloadaur-a159caf9eaecd0735d19d209809c4d224b169059.tar.gz
update PKGBUILD
-rw-r--r--.SRCINFO42
-rw-r--r--60-linux.hook12
-rw-r--r--90-linux.hook11
-rw-r--r--PKGBUILD123
-rw-r--r--linux-rockchip.install3
-rw-r--r--linux.preset10
-rw-r--r--mkinitcpio.preset10
7 files changed, 139 insertions, 72 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 50afa5fac896..63767349d649 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,31 +1,45 @@
pkgbase = linux-rockchip
- pkgdesc = Rockchip Linux kernel and modules from Armbian
pkgver = 5.8.18
pkgrel = 1
- url = https://github.com/redchenjs/armbian-ci
+ url = https://github.com/armbian/build
arch = armv7h
license = GPL2
makedepends = curl
- noextract = mkinitcpio.preset
+ noextract = linux.preset
+ noextract = 60-linux.hook
+ noextract = 90-linux.hook
noextract = linux-dtb-current-rockchip_20.11.0-trunk_armhf.deb
noextract = linux-image-current-rockchip_20.11.0-trunk_armhf.deb
noextract = linux-headers-current-rockchip_20.11.0-trunk_armhf.deb
options = !strip
- source = mkinitcpio.preset
- source = https://github.com/redchenjs/armbian-ci/releases/download/v5.8.18-rockchip/linux-dtb-current-rockchip_20.11.0-trunk_armhf.deb
- source = https://github.com/redchenjs/armbian-ci/releases/download/v5.8.18-rockchip/linux-image-current-rockchip_20.11.0-trunk_armhf.deb
- source = https://github.com/redchenjs/armbian-ci/releases/download/v5.8.18-rockchip/linux-headers-current-rockchip_20.11.0-trunk_armhf.deb
- sha512sums = 4e479e5c010c5cd6105b104419bbf1886a60174535d17a34ae457f2744598d0f1c4e2b24dc989c038fa2c51b3d076e0acd3210e1492a87db68b1d43840e11e8a
+ source = linux.preset
+ source = 60-linux.hook
+ source = 90-linux.hook
+ source = linux-dtb_20.11.0-5.8.18.deb::https://github.com/redchenjs/armbian-ci/releases/download/v5.8.18-rockchip/linux-dtb-current-rockchip_20.11.0-trunk_armhf.deb
+ source = linux-image_20.11.0-5.8.18.deb::https://github.com/redchenjs/armbian-ci/releases/download/v5.8.18-rockchip/linux-image-current-rockchip_20.11.0-trunk_armhf.deb
+ source = linux-headers_20.11.0-5.8.18.deb::https://github.com/redchenjs/armbian-ci/releases/download/v5.8.18-rockchip/linux-headers-current-rockchip_20.11.0-trunk_armhf.deb
+ sha512sums = a492aae17ee4a316ce03faf9f1b284b2529c485f4b092cc4a1f865a6c68d482fd356fd30efa296c116975a3bdf3922f5bf03912a8d0e76f4ab24aa6ab9f8c276
+ sha512sums = 7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a
+ sha512sums = a8fc668de860cf7b44269e35f879d130ccbc7db84d159ffcac6a92c02324f09c08fb57cccad18332f423bf2153c928633fa681ee96482c778dc76bffe80dd4f5
sha512sums = cc546f4045ccaa5e8339e8df05189dd0ced374a6cd1174585b063cccf89e09c2425ce0cc654b8d091484a780089e840e9df059710360985506bc86ab026d9779
sha512sums = be14d1423cfa5b8ba0144c48ceeffdfb5439c3d91c8846ee1da3ab3b96da795ff5d57a92a154b2d313d4384fc347024f7319930e1be9c9eafa330681b87008c3
sha512sums = fb5e33e81db5aef4dfd1dd4db6889ad69116c66a80b4f0f5951e1fab4f086452a672f92b124a49e50719cbaf8db3c9685317b17b39787e9efe80c9986c7665b5
pkgname = linux-rockchip
- optdepends = mkinitcpio: initramfs support
- provides = linux
- provides = linux-rockchip
+ pkgdesc = The Linux Kernel and modules - ARMv7 multi-platform Rockchip
+ install = linux-rockchip.install
+ depends = coreutils
+ depends = linux-firmware
+ depends = kmod
+ depends = mkinitcpio>=0.7
+ optdepends = crda: to set the correct wireless channels of your country
+ provides = linux=5.8.18
+ provides = WIREGUARD-MODULE
+ conflicts = linux
+ backup = etc/mkinitcpio.d/linux-rockchip.preset
pkgname = linux-rockchip-headers
- pkgdesc = Headers and scripts for building modules for the linux-rockchip kernel
- provides = linux-headers
- provides = linux-headers-rockchip
+ pkgdesc = Header files and scripts for building modules for linux kernel - ARMv7 multi-platform Rockchip
+ provides = linux-headers=5.8.18
+ conflicts = linux-headers
+
diff --git a/60-linux.hook b/60-linux.hook
new file mode 100644
index 000000000000..b33873c854fb
--- /dev/null
+++ b/60-linux.hook
@@ -0,0 +1,12 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/lib/modules/%KERNVER%/*
+Target = usr/lib/modules/%EXTRAMODULES%/*
+
+[Action]
+Description = Updating %PKGBASE% module dependencies...
+When = PostTransaction
+Exec = /usr/bin/depmod %KERNVER%
diff --git a/90-linux.hook b/90-linux.hook
new file mode 100644
index 000000000000..6ad74b4564c5
--- /dev/null
+++ b/90-linux.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Target = boot/zImage
+Target = usr/lib/initcpio/*
+
+[Action]
+Description = Updating %PKGBASE% initcpios...
+When = PostTransaction
+Exec = /usr/bin/mkinitcpio -p %PKGBASE%
diff --git a/PKGBUILD b/PKGBUILD
index eee9f0c0957d..c8fbae0b1c9c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,75 +3,102 @@
pkgbase=linux-rockchip
pkgname=('linux-rockchip' 'linux-rockchip-headers')
pkgver=5.8.18
+_armbian=20.11.0
+_kernver="$pkgver-rockchip"
pkgrel=1
-pkgdesc="Rockchip Linux kernel and modules from Armbian"
arch=('armv7h')
-url="https://github.com/redchenjs/armbian-ci"
+_desc="ARMv7 multi-platform Rockchip"
+url="https://github.com/armbian/build"
license=('GPL2')
makedepends=('curl')
options=('!strip')
-_armbian=20.11.0
source=(
- 'mkinitcpio.preset'
- "https://github.com/redchenjs/armbian-ci/releases/download/v$pkgver-rockchip/linux-dtb-current-rockchip_$_armbian-trunk_armhf.deb"
- "https://github.com/redchenjs/armbian-ci/releases/download/v$pkgver-rockchip/linux-image-current-rockchip_$_armbian-trunk_armhf.deb"
- "https://github.com/redchenjs/armbian-ci/releases/download/v$pkgver-rockchip/linux-headers-current-rockchip_$_armbian-trunk_armhf.deb"
+ "linux.preset"
+ "60-linux.hook"
+ "90-linux.hook"
+ "linux-dtb_$_armbian-$pkgver.deb::https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-dtb-current-rockchip_$_armbian-trunk_armhf.deb"
+ "linux-image_$_armbian-$pkgver.deb::https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-image-current-rockchip_$_armbian-trunk_armhf.deb"
+ "linux-headers_$_armbian-$pkgver.deb::https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-headers-current-rockchip_$_armbian-trunk_armhf.deb"
)
sha512sums=(
- '4e479e5c010c5cd6105b104419bbf1886a60174535d17a34ae457f2744598d0f1c4e2b24dc989c038fa2c51b3d076e0acd3210e1492a87db68b1d43840e11e8a'
- "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$pkgver-rockchip/linux-dtb-current-rockchip_$_armbian-trunk_armhf.deb.sha512sum)"
- "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$pkgver-rockchip/linux-image-current-rockchip_$_armbian-trunk_armhf.deb.sha512sum)"
- "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$pkgver-rockchip/linux-headers-current-rockchip_$_armbian-trunk_armhf.deb.sha512sum)"
+ "a492aae17ee4a316ce03faf9f1b284b2529c485f4b092cc4a1f865a6c68d482fd356fd30efa296c116975a3bdf3922f5bf03912a8d0e76f4ab24aa6ab9f8c276"
+ "7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a"
+ "a8fc668de860cf7b44269e35f879d130ccbc7db84d159ffcac6a92c02324f09c08fb57cccad18332f423bf2153c928633fa681ee96482c778dc76bffe80dd4f5"
+ "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-dtb-current-rockchip_$_armbian-trunk_armhf.deb.sha512sum)"
+ "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-image-current-rockchip_$_armbian-trunk_armhf.deb.sha512sum)"
+ "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-headers-current-rockchip_$_armbian-trunk_armhf.deb.sha512sum)"
)
noextract=("${source[@]##*/}")
prepare() {
- cd "$srcdir"
+ cd "$srcdir"
- rm -rf $(find -mindepth 1 -maxdepth 1 -type d)
+ rm -rf $(find -mindepth 1 -maxdepth 1 -type d)
}
package_linux-rockchip() {
- optdepends=('mkinitcpio: initramfs support')
- provides=('linux' 'linux-rockchip')
-
- cd "$srcdir"
-
- ar x "linux-dtb-current-rockchip_$_armbian-trunk_armhf.deb"
- tar -xf data.tar.xz
- ar x "linux-image-current-rockchip_$_armbian-trunk_armhf.deb"
- tar -xf data.tar.xz
-
- mkdir -p "$pkgdir/usr"
- mv lib "$pkgdir/usr/lib"
-
- mkdir -p "$pkgdir/boot"
- mv "boot/dtb-$pkgver-rockchip" "$pkgdir/boot/dtb"
-
- echo "$pkgbase" > "$pkgdir/usr/lib/modules/$pkgver-rockchip/pkgbase"
- install -Dm644 "boot/vmlinuz-$pkgver-rockchip" "$pkgdir/usr/lib/modules/$pkgver-rockchip/vmlinuz"
-
- install -Dm644 "mkinitcpio.preset" "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
- sed -r -i "s#\\\$pkgbase#$pkgbase#g" "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
+ pkgdesc="The Linux Kernel and modules - $_desc"
+ depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
+ optdepends=('crda: to set the correct wireless channels of your country')
+ backup=("etc/mkinitcpio.d/$pkgbase.preset")
+ provides=("linux=$pkgver" "WIREGUARD-MODULE")
+ conflicts=('linux')
+ install="$pkgname.install"
+
+ cd "$srcdir"
+
+ ar x "linux-dtb_$_armbian-$pkgver.deb"
+ tar -xf data.tar.xz
+ ar x "linux-image_$_armbian-$pkgver.deb"
+ tar -xf data.tar.xz
+
+ install -dm755 "$pkgdir/usr"
+ cp -r lib "$pkgdir/usr/lib"
+
+ install -Dm644 "boot/vmlinuz-$_kernver" "$pkgdir/boot/zImage"
+ cp -r "boot/dtb-$_kernver" "$pkgdir/boot/dtb"
+
+ # make room for external modules
+ local _extramodules="extramodules-$_kernver"
+ ln -s "../$_extramodules" "$pkgdir/usr/lib/modules/$_kernver/extramodules"
+
+ # add real version for building modules and running depmod from hook
+ echo "$_kernver" |
+ install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules/$_extramodules/version"
+
+ # sed expression for following substitutions
+ local _subst="
+ s|%PKGBASE%|$pkgbase|g
+ s|%KERNVER%|$_kernver|g
+ s|%EXTRAMODULES%|$_extramodules|g
+ "
+
+ # install mkinitcpio preset file
+ sed "$_subst" ../linux.preset |
+ install -Dm644 /dev/stdin "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
+
+ # install pacman hooks
+ sed "$_subst" ../60-linux.hook |
+ install -Dm644 /dev/stdin "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook"
+ sed "$_subst" ../90-linux.hook |
+ install -Dm644 /dev/stdin "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook"
}
package_linux-rockchip-headers() {
- pkgdesc="Headers and scripts for building modules for the $pkgbase kernel"
- provides=('linux-headers' 'linux-headers-rockchip')
-
- cd "$srcdir"
+ pkgdesc="Header files and scripts for building modules for linux kernel - $_desc"
+ provides=("linux-headers=$pkgver")
+ conflicts=('linux-headers')
- ar x "linux-image-current-rockchip_$_armbian-trunk_armhf.deb"
- tar -xf data.tar.xz
- ar x "linux-headers-current-rockchip_$_armbian-trunk_armhf.deb"
- tar -xf data.tar.xz
+ cd "$srcdir"
- mkdir -p "$pkgdir/usr/lib/modules/$pkgver-rockchip"
- mv "usr/src/linux-headers-$pkgver-rockchip" "$pkgdir/usr/lib/modules/$pkgver-rockchip/build"
+ ar x "linux-image_$_armbian-$pkgver.deb"
+ tar -xf data.tar.xz
+ ar x "linux-headers_$_armbian-$pkgver.deb"
+ tar -xf data.tar.xz
- install -Dm644 "boot/config-$pkgver-rockchip" "$pkgdir/usr/lib/modules/$pkgver-rockchip/build/.config"
- install -Dm644 "boot/System.map-$pkgver-rockchip" "$pkgdir/usr/lib/modules/$pkgver-rockchip/build/System.map"
+ install -dm755 "$pkgdir/usr/lib/modules/$_kernver"
+ cp -r "usr/src/linux-headers-$_kernver" "$pkgdir/usr/lib/modules/$_kernver/build"
- mkdir -p "$pkgdir/usr/src"
- ln -s "../lib/modules/$pkgver-rockchip/build" "$pkgdir/usr/src/$pkgbase"
+ install -Dm644 "boot/config-$_kernver" "$pkgdir/usr/lib/modules/$_kernver/build/.config"
+ install -Dm644 "boot/System.map-$_kernver" "$pkgdir/usr/lib/modules/$_kernver/build/System.map"
}
diff --git a/linux-rockchip.install b/linux-rockchip.install
new file mode 100644
index 000000000000..127de9cfd3a1
--- /dev/null
+++ b/linux-rockchip.install
@@ -0,0 +1,3 @@
+post_remove() {
+ rm -f boot/initramfs-linux.img
+}
diff --git a/linux.preset b/linux.preset
new file mode 100644
index 000000000000..8d7f379c9e04
--- /dev/null
+++ b/linux.preset
@@ -0,0 +1,10 @@
+# mkinitcpio preset file for the '%PKGBASE%' package
+
+ALL_config="/etc/mkinitcpio.conf"
+ALL_kver="%KERNVER%"
+
+PRESETS=('default')
+
+#default_config="/etc/mkinitcpio.conf"
+default_image="/boot/initramfs-linux.img"
+#default_options=""
diff --git a/mkinitcpio.preset b/mkinitcpio.preset
deleted file mode 100644
index 7979fca35fae..000000000000
--- a/mkinitcpio.preset
+++ /dev/null
@@ -1,10 +0,0 @@
-# mkinitcpio preset file for the '$pkgbase' package
-
-ALL_config="/etc/mkinitcpio.conf"
-ALL_kver="$(dd if=/boot/vmlinuz-$pkgbase skip=$(grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' /boot/vmlinuz-$pkgbase | head -n 1 | cut -d ':' -f 1) iflag=skip_bytes 2>&1 | zcat -q | grep -a 'Linux version [0-9]' | sed -r 's#.*([0-9]+.[0-9]+.[0-9]+-[a-z0-9]+).*#\1#')"
-
-PRESETS=('default')
-
-#default_config="/etc/mkinitcpio.conf"
-default_image="/boot/initramfs-$pkgbase.img"
-#default_options=""