summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaansu-auto2018-08-14 07:44:32 -0700
committerRaansu-auto2018-08-14 07:44:32 -0700
commitf7aca2f471fe721588018f358723ddafa00ad387 (patch)
treeb6cc6727255c395fde8bc6e3135fb863d175ddb1
downloadaur-f7aca2f471fe721588018f358723ddafa00ad387.tar.gz
Intital release
-rw-r--r--.SRCINFO33
-rw-r--r--99-linux.hook11
-rw-r--r--PKGBUILD161
-rw-r--r--linux-aarch64-rock64-bin.install27
-rw-r--r--linux.preset14
5 files changed, 246 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..0c13f8b1076
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+pkgbase = linux-aarch64-rock64-bin
+ pkgver = 4.4.138_1094
+ pkgrel = 1
+ url = https://github.com/ayufan-rock64/linux-kernel
+ arch = aarch64
+ license = GPL2
+ depends = coreutils
+ depends = linux-firmware
+ depends = kmod
+ depends = mkinitcpio>=0.7
+ provides = linux=4.4.138_1094
+ provides = linux-aarch64=4.4.138_1094
+ conflicts = linux
+ conflicts = linux-aarch64
+ conflicts = linux-arch64-rc
+ noextract = linux-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee_4.4.138-1094-rockchip-ayufan_arm64.deb
+ noextract = linux-headers-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee_4.4.138-1094-rockchip-ayufan_arm64.deb
+ options = !strip
+ source = https://github.com/ayufan-rock64/linux-kernel/releases/download/4.4.138-1094-rockchip-ayufan/linux-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee_4.4.138-1094-rockchip-ayufan_arm64.deb
+ source = https://github.com/ayufan-rock64/linux-kernel/releases/download/4.4.138-1094-rockchip-ayufan/linux-headers-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee_4.4.138-1094-rockchip-ayufan_arm64.deb
+ source = linux.preset
+ source = 99-linux.hook
+ source = linux-aarch64-rock64-bin.install
+ sha256sums = f61a9c611043e1f914ddd9df2c0d71cfab6eebe647e153b8ee24f9734ad576bc
+ sha256sums = e7a28757bf5242ed3e0f7d46542e9b1c1b65604ae6cc7fef8c1f21bbb339d2e7
+ sha256sums = 9757ea513c67c9fb14e9ba9b681069f091e60bc5f892c9a2c4fe3cd57ca3fbe4
+ sha256sums = be679ded489c484ec6a9eeed78c6383f9c5a7fab20d2b1f00be67ac6c7185fe6
+ sha256sums = c87f3c6d4fa19319d5f81b65a45d62ab71e570bdf549c7e6c0f89292dcb5174f
+
+pkgname = linux-aarch64-rock64-bin
+
+pkgname = linux-aarch64-rock64-bin-headers
+
diff --git a/99-linux.hook b/99-linux.hook
new file mode 100644
index 00000000000..219e2d5588f
--- /dev/null
+++ b/99-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 00000000000..665e09d8c93
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,161 @@
+# AArch64 multi-platform
+# PKGBUILD Maintainer: Raanu <Gero3977@gmail.com>
+# Kernel maintainer: Ayufan <ayufan@ayufan.eu>
+
+# The below variables get updated from external script when new builds are released
+_kernver=4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
+_imagename=linux-image-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee_4.4.138-1094-rockchip-ayufan_arm64.deb
+_headersname=linux-headers-4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee_4.4.138-1094-rockchip-ayufan_arm64.deb
+_releasetag=4.4.138-1094-rockchip-ayufan
+_pkgver=4.4.138_1094
+
+
+
+_desc="AArch64 for Rock64. This package will fetch a Debian built kernel as a temporary workaround for USB 3.0 fixes."
+pkgbase=linux-aarch64-rock64-bin
+pkgver="${_pkgver}"
+pkgrel=1
+arch=('aarch64')
+url="https://github.com/ayufan-rock64/linux-kernel"
+license=('GPL2')
+options=('!strip')
+depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
+provides=("linux=${pkgver}" "linux-aarch64=${pkgver}")
+conflicts=('linux' 'linux-aarch64' 'linux-arch64-rc')
+source=("https://github.com/ayufan-rock64/linux-kernel/releases/download/${_releasetag}/${_imagename}"
+"https://github.com/ayufan-rock64/linux-kernel/releases/download/${_releasetag}/${_headersname}"
+ 'linux.preset'
+ '99-linux.hook'
+ 'linux-aarch64-rock64-bin.install')
+sha256sums=('f61a9c611043e1f914ddd9df2c0d71cfab6eebe647e153b8ee24f9734ad576bc'
+ 'e7a28757bf5242ed3e0f7d46542e9b1c1b65604ae6cc7fef8c1f21bbb339d2e7'
+ '9757ea513c67c9fb14e9ba9b681069f091e60bc5f892c9a2c4fe3cd57ca3fbe4'
+ 'be679ded489c484ec6a9eeed78c6383f9c5a7fab20d2b1f00be67ac6c7185fe6'
+ 'c87f3c6d4fa19319d5f81b65a45d62ab71e570bdf549c7e6c0f89292dcb5174f')
+noextract=("${_imagename}"
+ "${_headersname}")
+
+
+prepare() {
+ cd "${srcdir}"
+
+ # extract the prebuilt kernel files
+ mkdir -p linux-image/
+ cp "${_imagename}" linux-image/
+ cd linux-image/
+ ar xf "${_imagename}"
+ tar -xf data.tar.xz
+
+ cd "${srcdir}"
+
+ # extract the related linux headers
+ mkdir -p linux-headers/
+ cp "${_headersname}" linux-headers/
+ cd linux-headers/
+ ar xf "${_headersname}"
+ tar -xf data.tar.xz
+}
+
+_package() {
+ 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')
+ provides=("linux=${pkgver}" "linux-aarch64=${pkgver}")
+ conflicts=('linux' 'linux-aarch64' 'linux-arch64-rc') provides=('kernel26' "linux=${pkgver}")
+ replaces=('linux-armv8')
+ backup=("etc/mkinitcpio.d/${pkgbase}.preset")
+ install=${pkgname}.install
+
+ cd "${srcdir}/linux-image"
+
+ # copy boot files
+ cp -r boot "${pkgdir}/boot"
+ cp "boot/vmlinuz-${_kernver}" "${pkgdir}/boot/Image"
+ mkdir -p "${pkgdir}/boot/dtbs/rockchip"
+ mv "usr/lib/linux-image-${_kernver}/rockchip" "${pkgdir}/boot/dtbs/rockchip"
+
+ # copy kernel files
+ mkdir -p "${pkgdir}/usr"
+ mkdir -p "${pkgdir}/lib"
+ cp -r usr "${pkgdir}/"
+ cp -r lib "${pkgdir}/"
+
+ # set correct depmod command for install
+ sed \
+ -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
+ -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
+ -i "${startdir}/${pkgname}.install"
+
+ # install mkinitcpio preset file for kernel
+ install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+ sed \
+ -e "1s|'linux.*'|'${pkgbase}'|" \
+ -e "s|ALL_kver=.*|ALL_kver=\"${_kernver}\"|" \
+ -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+
+ # install pacman hook for initramfs regeneration
+ sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/99-linux.hook" |
+ install -D -m644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/99-${pkgbase}.hook"
+
+ # Now we call depmod...
+ depmod -b "$pkgdir" -F "boot/System.map-${_kernver}" "$_kernver"
+
+ # move module tree /lib -> /usr/lib
+ mkdir -p "${pkgdir}/usr"
+ cp -r "$pkgdir/lib" "$pkgdir/usr"
+ rm -rf "$pkgdir/lib"
+
+}
+
+_package-headers() {
+ pkgdesc="Header files and scripts for building modules for linux kernel - ${_desc}"
+ provides=("linux-headers=${pkgver}")
+ replaces=('linux-armv8-headers')
+ conflicts=('linux-headers')
+
+ KARCH=arm64
+
+ mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
+ cp -rT "${srcdir}/linux-headers/usr/src/linux-headers-${_kernver}/" "${pkgdir}/usr/lib/modules/${_kernver}/build"
+
+ install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
+
+ cd "${srcdir}/linux-headers/usr/src/linux-headers-${_kernver}"
+ install -D -m644 Makefile \
+ "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
+ install -D -m644 kernel/Makefile \
+ "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
+ install -D -m644 .config \
+ "${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
+
+ mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
+
+ # fix permissions on scripts dir
+ chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
+ mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
+
+ chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
+ find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
+
+ # strip scripts directory
+ find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
+ case "$(file -bi "${binary}")" in
+ *application/x-sharedlib*) # Libraries (.so)
+ /usr/bin/strip ${STRIP_SHARED} "${binary}" || true;;
+ *application/x-archive*) # Libraries (.a)
+ /usr/bin/strip ${STRIP_STATIC} "${binary}" || true;;
+ *application/x-executable*) # Binaries
+ /usr/bin/strip ${STRIP_BINARIES} "${binary}" || true;;
+ esac
+ done
+
+ # remove unneeded architectures
+ rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,x86,xtensa}
+}
+
+pkgname=("${pkgbase}" "${pkgbase}-headers")
+for _p in ${pkgname[@]}; do
+ eval "package_${_p}() {
+ _package${_p#${pkgbase}}
+ }"
+done
diff --git a/linux-aarch64-rock64-bin.install b/linux-aarch64-rock64-bin.install
new file mode 100644
index 00000000000..6d68df29298
--- /dev/null
+++ b/linux-aarch64-rock64-bin.install
@@ -0,0 +1,27 @@
+# arg 1: the new package version
+# arg 2: the old package version
+
+KERNEL_NAME=
+KERNEL_VERSION=4.4.138-1094-rockchip-ayufan-gf13a8a9a4eee
+
+post_install () {
+ # updating module dependencies
+ echo ">>> Updating module dependencies. Please wait ..."
+ depmod ${KERNEL_VERSION}
+}
+
+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
+
+ # updating module dependencies
+ echo ">>> Updating module dependencies. Please wait ..."
+ depmod ${KERNEL_VERSION}
+}
+
+post_remove() {
+ # also remove the compat symlinks
+ 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 00000000000..c3c52297a90
--- /dev/null
+++ b/linux.preset
@@ -0,0 +1,14 @@
+# mkinitcpio preset file for the 'linux-aarch64-rock64-bin' package
+
+ALL_config="/etc/mkinitcpio.conf"
+ALL_kver="4.3.0-1-ARCH"
+
+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"