diff options
-rw-r--r-- | .SRCINFO | 45 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | 60-linux.hook | 12 | ||||
-rw-r--r-- | 90-linux.hook | 11 | ||||
-rw-r--r-- | PKGBUILD | 104 | ||||
-rw-r--r-- | linux-sunxi64.install | 10 | ||||
-rw-r--r-- | linux.preset | 14 |
7 files changed, 198 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..aefbeb83bf81 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,45 @@ +pkgbase = linux-sunxi64 + pkgver = 5.9.11 + pkgrel = 1 + url = https://github.com/armbian/build + arch = aarch64 + license = GPL2 + makedepends = curl + noextract = linux.preset + noextract = 60-linux.hook + noextract = 90-linux.hook + noextract = linux-dtb-current-sunxi64_21.02.0-trunk_arm64.deb + noextract = linux-image-current-sunxi64_21.02.0-trunk_arm64.deb + noextract = linux-headers-current-sunxi64_21.02.0-trunk_arm64.deb + options = !strip + source = linux.preset + source = 60-linux.hook + source = 90-linux.hook + source = linux-dtb-21.02.0-5.9.11.deb::https://github.com/redchenjs/armbian-ci/releases/download/v5.9.11-sunxi64/linux-dtb-current-sunxi64_21.02.0-trunk_arm64.deb + source = linux-image-21.02.0-5.9.11.deb::https://github.com/redchenjs/armbian-ci/releases/download/v5.9.11-sunxi64/linux-image-current-sunxi64_21.02.0-trunk_arm64.deb + source = linux-headers-21.02.0-5.9.11.deb::https://github.com/redchenjs/armbian-ci/releases/download/v5.9.11-sunxi64/linux-headers-current-sunxi64_21.02.0-trunk_arm64.deb + sha512sums = f683c0639fc20e813e309df99b9b850b1f55de3fc02489d64a7d66e84df19d7836ea32042090597f1df17baed46a3ae1dfcf341c8aff206be9a1b06ee394dc3f + sha512sums = 7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a + sha512sums = b2cdb620fcc6f0b430b0cf0c844887c2c1e290844ea330750cad52c9ec04e835ead973b664c7613d147037c388120affe97dfd2f2e0f9ae224db52aaa4cb8814 + sha512sums = a41f554e92d3bfb144c2c8993e0bd50204004a272e80b46359e3d17d1b5edf7934d850c9e140fdce38b36655066daaa4956309d0178949399646d24c3f61eea1 + sha512sums = eb9fdf99cefd607df3f01363323f3f21bf796f3e08faa8120e34809758c919d6cad34b0e60222de817962ac4b06a6b88ee95df33f05063a781270b4a3bc71b71 + sha512sums = f6c4c31c9c8ae92018523f64a354228b0b844e95c501468fb5152ce903fdc962d71223999434cf12fee646023e561c28886007b27cf90688320e9b2f0c9c652a + +pkgname = linux-sunxi64 + pkgdesc = The Linux Kernel and modules - AArch64 multi-platform Sunxi + install = linux-sunxi64.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.9.11 + provides = WIREGUARD-MODULE + conflicts = linux + backup = etc/mkinitcpio.d/linux-sunxi64.preset + +pkgname = linux-sunxi64-headers + pkgdesc = Header files and scripts for building modules for linux kernel - AArch64 multi-platform Sunxi + provides = linux-headers=5.9.11 + conflicts = linux-headers + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..62514e8a2fb9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +* +.* 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..ec864d3ff6b9 --- /dev/null +++ b/90-linux.hook @@ -0,0 +1,11 @@ +[Trigger] +Type = File +Operation = Install +Operation = Upgrade +Target = boot/Image +Target = usr/lib/initcpio/* + +[Action] +Description = Updating %PKGBASE% initcpios... +When = PostTransaction +Exec = /usr/bin/mkinitcpio -p %PKGBASE% diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a0f2696699b5 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,104 @@ +# Maintainer: Jack Chen <redchenjs@live.com> + +pkgbase=linux-sunxi64 +pkgname=('linux-sunxi64' 'linux-sunxi64-headers') +pkgver=5.9.11 +_armbian=21.02.0 +_kernver="$pkgver-sunxi64" +pkgrel=1 +arch=('aarch64') +_desc="AArch64 multi-platform Sunxi" +url="https://github.com/armbian/build" +license=('GPL2') +makedepends=('curl') +options=('!strip') +source=( + "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-sunxi64_$_armbian-trunk_arm64.deb" + "linux-image-$_armbian-$pkgver.deb::https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-image-current-sunxi64_$_armbian-trunk_arm64.deb" + "linux-headers-$_armbian-$pkgver.deb::https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-headers-current-sunxi64_$_armbian-trunk_arm64.deb" +) +sha512sums=( + "f683c0639fc20e813e309df99b9b850b1f55de3fc02489d64a7d66e84df19d7836ea32042090597f1df17baed46a3ae1dfcf341c8aff206be9a1b06ee394dc3f" + "7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a" + "b2cdb620fcc6f0b430b0cf0c844887c2c1e290844ea330750cad52c9ec04e835ead973b664c7613d147037c388120affe97dfd2f2e0f9ae224db52aaa4cb8814" + "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-dtb-current-sunxi64_$_armbian-trunk_arm64.deb.sha512sum)" + "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-image-current-sunxi64_$_armbian-trunk_arm64.deb.sha512sum)" + "$(curl -s -L https://github.com/redchenjs/armbian-ci/releases/download/v$_kernver/linux-headers-current-sunxi64_$_armbian-trunk_arm64.deb.sha512sum)" +) +noextract=("${source[@]##*/}") + +prepare() { + cd "$srcdir" + + rm -rf $(find -mindepth 1 -maxdepth 1 -type d) +} + +package_linux-sunxi64() { + 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 -Dm644 "boot/vmlinuz-$_kernver" "$pkgdir/boot/Image" + cp -r "boot/dtb-$_kernver" "$pkgdir/boot/dtbs" + + install -dm755 "$pkgdir/usr" + cp -r lib "$pkgdir/usr/lib" + + # make room for external modules + local _extramodules="extramodules-$(echo $_kernver | sed -r 's|^([0-9]+.[0-9]+).*|\1|')-aarch64" + 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-sunxi64-headers() { + pkgdesc="Header files and scripts for building modules for linux kernel - $_desc" + provides=("linux-headers=$pkgver") + conflicts=('linux-headers') + + cd "$srcdir" + + 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 -dm755 "$pkgdir/usr/lib/modules/$_kernver" + cp -r "usr/src/linux-headers-$_kernver" "$pkgdir/usr/lib/modules/$_kernver/build" + + 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-sunxi64.install b/linux-sunxi64.install new file mode 100644 index 000000000000..eb302899e1ee --- /dev/null +++ b/linux-sunxi64.install @@ -0,0 +1,10 @@ +post_upgrade() { + if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then + echo "WARNING: /boot appears to be a separate partition but is not mounted." + fi +} + +post_remove() { + rm -f boot/initramfs-linux.img + rm -f boot/initramfs-linux-fallback.img +} diff --git a/linux.preset b/linux.preset new file mode 100644 index 000000000000..f3430fba3089 --- /dev/null +++ b/linux.preset @@ -0,0 +1,14 @@ +# mkinitcpio preset file for the '%PKGBASE%' package + +ALL_config="/etc/mkinitcpio.conf" +ALL_kver="%KERNVER%" + +PRESETS=('default' 'fallback') + +#default_config="/etc/mkinitcpio.conf" +default_image="/boot/initramfs-linux.img" +#default_options="" + +#fallback_config="/etc/mkinitcpio.conf" +fallback_image="/boot/initramfs-linux-fallback.img" +fallback_options="-S autodetect" |