summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Chen2020-11-18 17:22:19 +0800
committerJack Chen2020-11-18 18:37:00 +0800
commit6e05d1ee5500f0f6f5f422cdb615d04168243c70 (patch)
tree480da12fd885bedda9104c8474e2836e0ae498a4
downloadaur-6e05d1ee5500f0f6f5f422cdb615d04168243c70.tar.gz
init commit
-rw-r--r--.SRCINFO46
-rw-r--r--.gitignore2
-rw-r--r--59-linux-rockchip-remove.hook15
-rw-r--r--91-linux-rockchip-install.hook11
-rw-r--r--PKGBUILD88
-rw-r--r--linux-rockchip.preset8
6 files changed, 170 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fbd71731de1e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,46 @@
+pkgbase = linux-rockchip
+ pkgver = 20.08.14
+ pkgrel = 1
+ url = https://apt.armbian.com
+ arch = armv7
+ license = GPL2
+ depends = coreutils
+ depends = kmod
+ depends = mkinitcpio
+ depends = uboot-tools
+ provides = linux
+ provides = linux-rockchip
+ noextract = linux-rockchip.preset
+ noextract = 59-linux-rockchip-remove.hook
+ noextract = 91-linux-rockchip-install.hook
+ noextract = linux-dtb-current-rockchip_20.08.14_armhf.deb
+ noextract = linux-image-current-rockchip_20.08.14_armhf.deb
+ noextract = linux-headers-current-rockchip_20.08.14_armhf.deb
+ options = !strip
+ source = linux-rockchip.preset
+ source = 59-linux-rockchip-remove.hook
+ source = 91-linux-rockchip-install.hook
+ source = https://apt.armbian.com/pool/main/l/linux-5.8.16-rockchip/linux-dtb-current-rockchip_20.08.14_armhf.deb
+ source = https://apt.armbian.com/pool/main/l/linux-5.8.16-rockchip/linux-image-current-rockchip_20.08.14_armhf.deb
+ source = https://apt.armbian.com/pool/main/l/linux-5.8.16-rockchip/linux-headers-current-rockchip_20.08.14_armhf.deb
+ sha512sums = 0ec3bafb51e4476d6499e9e243501b677637a4218f2f425faa39689e999a364c1d0fda6f3f0ec392611262d086dcb9e1ee5314567e6a7746ab7d98816ce12328
+ sha512sums = 905c31481d2d6c5da65f58270e0c165b62d795d85bacf117faf1934007464696a2a5589f8a0d1cd3c12bf3ff13385ba43b20416f9ad2b199038fdb9208a6416b
+ sha512sums = a98abd5e200089925b1d1efa7a43284960afe38b7c4b07c517fd4b7d2dc31096089d6abd55d55cb8ff0f5c0b740247e6a0a810e4b9e5509b9e15b843b9224f09
+ sha512sums = 723c3acdc7e3f56b7bb071b0d0ac8f284ba1bc2cb13aa318f30d431c49e635171492cd6648d601272259ed4e61f1ab3ac2555e182da9259d53fc148d0b3436ea
+ sha512sums = 59cea050cb3ca50d6e4c59fd7b2686eaf2762dd8da4bfaae360fb4410f615a5e2107d7c0789e75944620603707a6a6e817619d713c901633277c1fba9e5611d5
+ sha512sums = 961b8f97ad773d8c5da6d7ab3c5cb1268eea1aaff9ebaf2dc692a31aadb451a9a3ac6300078d2dd704e31e5cedb32aa43c023e991f5b592fd4ae7f01056407da
+
+pkgname = linux-rockchip
+ pkgdesc = Rockchip Linux kernel and modules from Armbian
+ depends = coreutils
+ depends = kmod
+ depends = mkinitcpio
+ depends = uboot-tools
+ provides = linux
+ provides = linux-rockchip
+
+pkgname = linux-rockchip-headers
+ pkgdesc = Headers and scripts for building modules for the linux-rockchip kernel
+ provides = linux-headers
+ provides = linux-headers-rockchip
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..62514e8a2fb9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*
+.*
diff --git a/59-linux-rockchip-remove.hook b/59-linux-rockchip-remove.hook
new file mode 100644
index 000000000000..5e46eb899b3a
--- /dev/null
+++ b/59-linux-rockchip-remove.hook
@@ -0,0 +1,15 @@
+[Trigger]
+Type = Path
+Operation = Remove
+Target = boot/zImage
+
+[Trigger]
+Type = Package
+Operation = Remove
+Target = linux-rockchip
+
+[Action]
+Description = Removing u-boot ramdisk image...
+When = PreTransaction
+Exec = rm -f /boot/uInitrd
+NeedsTargets
diff --git a/91-linux-rockchip-install.hook b/91-linux-rockchip-install.hook
new file mode 100644
index 000000000000..238a2d36f6f6
--- /dev/null
+++ b/91-linux-rockchip-install.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Type = Path
+Operation = Install
+Operation = Upgrade
+Target = boot/zImage
+
+[Action]
+Description = Updating u-boot ramdisk image...
+When = PostTransaction
+Exec = mkimage -C none -A arm -T ramdisk -d /boot/initramfs-linux.img /boot/uInitrd
+NeedsTargets
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..14ca5a8b2a21
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,88 @@
+# Maintainer: Jack Chen <redchenjs@live.com>
+
+pkgbase=linux-rockchip
+pkgname=('linux-rockchip' 'linux-rockchip-headers')
+pkgver=20.08.14
+pkgrel=1
+arch=('armv7')
+url="https://apt.armbian.com"
+license=('GPL2')
+depends=('coreutils' 'kmod' 'mkinitcpio' 'uboot-tools')
+provides=('linux' 'linux-rockchip')
+options=('!strip')
+
+_pkgfile=$(curl -s -L https://apt.armbian.com/dists/focal/main/binary-armhf/Packages -o Packages)
+_kernver=$(cat Packages | grep 'linux-dtb-current-rockchip.*deb' | head -n 1 | sed -r 's#.*l/linux-(.*)/l.*#\1#')
+
+source=(
+ "linux-rockchip.preset"
+ "59-linux-rockchip-remove.hook"
+ "91-linux-rockchip-install.hook"
+ "$(cat Packages | grep 'linux-dtb-current-rockchip.*deb' | head -n 1 | sed -r 's#Filename: #https://apt.armbian.com/#')"
+ "$(cat Packages | grep 'linux-image-current-rockchip.*deb' | head -n 1 | sed -r 's#Filename: #https://apt.armbian.com/#')"
+ "$(cat Packages | grep 'linux-headers-current-rockchip.*deb' | head -n 1 | sed -r 's#Filename: #https://apt.armbian.com/#')"
+)
+sha512sums=(
+ '0ec3bafb51e4476d6499e9e243501b677637a4218f2f425faa39689e999a364c1d0fda6f3f0ec392611262d086dcb9e1ee5314567e6a7746ab7d98816ce12328'
+ '905c31481d2d6c5da65f58270e0c165b62d795d85bacf117faf1934007464696a2a5589f8a0d1cd3c12bf3ff13385ba43b20416f9ad2b199038fdb9208a6416b'
+ 'a98abd5e200089925b1d1efa7a43284960afe38b7c4b07c517fd4b7d2dc31096089d6abd55d55cb8ff0f5c0b740247e6a0a810e4b9e5509b9e15b843b9224f09'
+ "$(cat Packages | grep 'linux-dtb-current-rockchip.*deb' -A 5 | grep SHA512 | head -n 1 | sed -r 's#SHA512: ##')"
+ "$(cat Packages | grep 'linux-image-current-rockchip.*deb' -A 5 | grep SHA512 | head -n 1 | sed -r 's#SHA512: ##')"
+ "$(cat Packages | grep 'linux-headers-current-rockchip.*deb' -A 5 | grep SHA512 | head -n 1 | sed -r 's#SHA512: ##')"
+)
+noextract=("${source[@]##*/}")
+
+pkgver() {
+ cat Packages | grep 'linux-image-current-rockchip.*deb' | head -n 1 | sed -r 's#.*_(.*)_armhf.*#\1#'
+}
+
+prepare() {
+ cd "$srcdir"
+
+ rm -rf boot etc lib usr
+}
+
+package_linux-rockchip() {
+ pkgdesc="Rockchip Linux kernel and modules from Armbian"
+ depends=('coreutils' 'kmod' 'mkinitcpio' 'uboot-tools')
+ provides=('linux' 'linux-rockchip')
+
+ cd "$srcdir"
+
+ ar x linux-dtb-current-rockchip_*.deb
+ tar -xf data.tar.xz
+ ar x linux-image-current-rockchip_*.deb
+ tar -xf data.tar.xz
+
+ mkdir -p "$pkgdir/usr"
+ mv lib "$pkgdir/usr/lib"
+
+ mkdir -p "$pkgdir/boot"
+ mv "boot/dtb-$_kernver" "$pkgdir/boot/dtb"
+
+ install -Dm644 "boot/vmlinuz-$_kernver" "$pkgdir/boot/zImage"
+ 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"
+
+ install -Dm644 linux-rockchip.preset "$pkgdir/etc/mkinitcpio.d/linux-rockchip.preset"
+ install -Dm644 59-linux-rockchip-remove.hook "$pkgdir/usr/share/libalpm/hooks/59-linux-rockchip-remove.hook"
+ install -Dm644 91-linux-rockchip-install.hook "$pkgdir/usr/share/libalpm/hooks/91-linux-rockchip-install.hook"
+
+ install -Dm644 /dev/null "$pkgdir/usr/lib/initcpio/hooks/$pkgname"
+}
+
+package_linux-rockchip-headers() {
+ pkgdesc="Headers and scripts for building modules for the $pkgbase kernel"
+ provides=('linux-headers' 'linux-headers-rockchip')
+
+ cd "$srcdir"
+
+ ar x linux-headers-current-rockchip_*.deb
+ tar -xf data.tar.xz
+
+ mkdir -p "$pkgdir/usr/lib/modules/$_kernver"
+ mv "usr/src/linux-headers-$_kernver" "$pkgdir/usr/lib/modules/$_kernver/build"
+
+ mkdir -p "$pkgdir/usr/src"
+ ln -s "../lib/modules/$_kernver/build" "$pkgdir/usr/src/$pkgbase"
+}
diff --git a/linux-rockchip.preset b/linux-rockchip.preset
new file mode 100644
index 000000000000..3bc3c21570bb
--- /dev/null
+++ b/linux-rockchip.preset
@@ -0,0 +1,8 @@
+ALL_config="/etc/mkinitcpio.conf"
+ALL_kver="$(dd if=/boot/zImage skip=$(grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' /boot/zImage | 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-zA-Z]+).*#\1#')"
+
+PRESETS=('default')
+
+#default_config="/etc/mkinitcpio.conf"
+default_image="/boot/initramfs-linux.img"
+#default_options=""