summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorboogie2023-07-21 14:31:25 +0200
committerboogie2023-07-21 14:31:25 +0200
commitf906e526bc2c0a0d0598560e4d71ed03e207da0e (patch)
tree252c7b253195e67431f7d98fd8e0d68856554712
parent83b22a1d5cd0edb31d2d796aea53eb4e704f3361 (diff)
downloadaur-f906e526bc2c0a0d0598560e4d71ed03e207da0e.tar.gz
move libmali to this package and fix overlays dirs
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD39
-rwxr-xr-xlibmali19
-rwxr-xr-xlibmaliw18
4 files changed, 90 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 46b6e516cc01..f00897eb6adc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = linux-radxa-rkbsp5-bin
pkgdesc = Precompiled Linux kernel package based on 5.10.x BSP kernel published by RADXA targetting rk3399 based rock4 and rk3588 based rock5 boards
pkgver = 5.10.110
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/radxa/kernel
arch = aarch64
license = GPL2
@@ -13,13 +13,28 @@ pkgbase = linux-radxa-rkbsp5-bin
noextract = linux.preset
noextract = extract-vmlinux
noextract = extlinux.arch.template
+ noextract = libmali-valhall-g610-g13p0-wayland-gbm.so
+ noextract = libmali-valhall-g610-g13p0-x11-gbm.so
+ noextract = mali_csffw.bin
+ noextract = libmali
+ noextract = libmaliw
options = !strip
source = linux.preset
source = extract-vmlinux
source = extlinux.arch.template
+ source = libmali_g610_wayland.so::https://github.com/JeffyCN/mirrors/raw/libmali/lib/aarch64-linux-gnu/libmali-valhall-g610-g13p0-wayland-gbm.so
+ source = libmali_g610_x.so::https://github.com/JeffyCN/mirrors/raw/libmali/lib/aarch64-linux-gnu/libmali-valhall-g610-g13p0-x11-gbm.so
+ source = https://github.com/JeffyCN/mirrors/raw/488f49467f5b4adb8ae944221698e9a4f9acb0ed/firmware/g610/mali_csffw.bin
+ source = libmali
+ source = libmaliw
sha512sums = 03cdaa19ff754c1b16cbfe8b08d38fed2f21c688a6e00d331ca53c4ef937c1cd3fdcfca2241d136238f220a87f3da04c1e6e192d262b4505f8bff3ddcbc8b9ad
sha512sums = ba6edcd5f56a4c3e865578eabf1e1311b8e5e7babffdb0f84b99971238505ca27eba506f2723638129ef6558eba95f7e4fd2e07b40e5a4de716e5de90d1cbe79
sha512sums = b09481badcc35acc5455b97545e87c706c5cb326e1b80237b2435d821c3c45002b44538095f3c5f3cfc720acf55bc27d97b0290e5cffa5acbdbaf0c2314f2d1b
+ sha512sums = f8e9c086156c5539b1489de57dcd378496920a7db1f6286f8a9be5f925844e97d1f43e2e9398d85d0c661eebebfd46d3a287507e8c733e45cacd3947c59337b9
+ sha512sums = fa4656885b40edf5cdb248297cddb5bb93c8c7c598a4a8dc2c658606f1814de45c32c621d3806cc65f724490779a270e156c2256e3a8df5a4aa9cc1aa4e1ab83
+ sha512sums = fbcc7d4954a35d0c15a942f0fcb55d6423c3d2263b29a575f26a17d5e4acc75897bed46d89b2504934427078b8628691fbb4a872a2b6eb658192aa856eab9460
+ sha512sums = 49299ae1f06c78746e6ef5768c1850a433ed0dcaac833ef8d060783d63d37022b4b6ada6630f7a2089a4c3a176408fce5237f79e1171a63593ce58c0c8a2228f
+ sha512sums = 459d7b1f02983a3fd82b4aadaf753e2b23f634f1d1d8299f5067cd8edcda152d374f3b07be859e70bb293d62e74d7e6b65df1cf389be46318cfc4d4fd8e4d3af
pkgname = linux-radxa-rkbsp5-bin
pkgdesc = Precompiled Linux kernel image based on 5.10.x BSP published by RADXA targetting rk3399 based rock4 and rk3588 based rock5 boards
@@ -33,6 +48,7 @@ pkgname = linux-radxa-rkbsp5-bin
provides = linux=5.10.110
provides = linux-rkbsp
conflicts = linux
+ conflicts = libmali
backup = etc/mkinitcpio.d/linux-radxa-rkbsp5.preset
pkgname = linux-radxa-rkbsp5-bin-headers
diff --git a/PKGBUILD b/PKGBUILD
index 68686a415811..cc046bb59f6b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,9 @@ _kernel=linux-radxa-rkbsp5
pkgver=5.10.110
pkgbase=$_kernel-bin
pkgname=($pkgbase $pkgbase-headers)
-pkgrel=2
+blobcommit="libmali"
+fwcommit="488f49467f5b4adb8ae944221698e9a4f9acb0ed"
+pkgrel=3
arch=('aarch64')
url="https://github.com/radxa/kernel"
_repourl="https://github.com/radxa/apt/raw/gh-pages/bullseye-stable/"
@@ -19,10 +21,20 @@ source=(
"linux.preset"
"extract-vmlinux"
"extlinux.arch.template"
+ "libmali_g610_wayland.so::https://github.com/JeffyCN/mirrors/raw/${blobcommit}/lib/aarch64-linux-gnu/libmali-valhall-g610-g13p0-wayland-gbm.so"
+ "libmali_g610_x.so::https://github.com/JeffyCN/mirrors/raw/${blobcommit}/lib/aarch64-linux-gnu/libmali-valhall-g610-g13p0-x11-gbm.so"
+ "https://github.com/JeffyCN/mirrors/raw/${fwcommit}/firmware/g610/mali_csffw.bin"
+ "libmali"
+ "libmaliw"
)
sha512sums=('03cdaa19ff754c1b16cbfe8b08d38fed2f21c688a6e00d331ca53c4ef937c1cd3fdcfca2241d136238f220a87f3da04c1e6e192d262b4505f8bff3ddcbc8b9ad'
'ba6edcd5f56a4c3e865578eabf1e1311b8e5e7babffdb0f84b99971238505ca27eba506f2723638129ef6558eba95f7e4fd2e07b40e5a4de716e5de90d1cbe79'
- 'b09481badcc35acc5455b97545e87c706c5cb326e1b80237b2435d821c3c45002b44538095f3c5f3cfc720acf55bc27d97b0290e5cffa5acbdbaf0c2314f2d1b')
+ 'b09481badcc35acc5455b97545e87c706c5cb326e1b80237b2435d821c3c45002b44538095f3c5f3cfc720acf55bc27d97b0290e5cffa5acbdbaf0c2314f2d1b'
+ 'f8e9c086156c5539b1489de57dcd378496920a7db1f6286f8a9be5f925844e97d1f43e2e9398d85d0c661eebebfd46d3a287507e8c733e45cacd3947c59337b9'
+ 'fa4656885b40edf5cdb248297cddb5bb93c8c7c598a4a8dc2c658606f1814de45c32c621d3806cc65f724490779a270e156c2256e3a8df5a4aa9cc1aa4e1ab83'
+ 'fbcc7d4954a35d0c15a942f0fcb55d6423c3d2263b29a575f26a17d5e4acc75897bed46d89b2504934427078b8628691fbb4a872a2b6eb658192aa856eab9460'
+ '49299ae1f06c78746e6ef5768c1850a433ed0dcaac833ef8d060783d63d37022b4b6ada6630f7a2089a4c3a176408fce5237f79e1171a63593ce58c0c8a2228f'
+ '459d7b1f02983a3fd82b4aadaf753e2b23f634f1d1d8299f5067cd8edcda152d374f3b07be859e70bb293d62e74d7e6b65df1cf389be46318cfc4d4fd8e4d3af')
noextract=("${source[@]##*/}")
@@ -56,7 +68,7 @@ _package-bin() {
optdepends=('crda: to set the correct wireless channels of your country')
backup=("etc/mkinitcpio.d/$_kernel.preset")
provides=("linux=${pkgver}" "linux-rkbsp")
- conflicts=('linux' )
+ conflicts=('linux' 'libmali')
cd "$srcdir/debs"
local _version="$(<../version)"
@@ -76,6 +88,10 @@ _package-bin() {
# copy dtbs
mkdir -p "$pkgdir/boot/dtbs/$_kernel"
cp -raf "usr/lib/linux-image-${_version}/." "$pkgdir/boot/dtbs/$_kernel"
+
+ # move rockchip/overlay directory to rockchip/overlays which is the common place for git and bin package
+ mv "${pkgdir}/boot/dtbs/$_kernel/rockchip/overlay" "${pkgdir}/boot/dtbs/$_kernel/rockchip/overlays" | true
+
# install extlinux template
install -Dm755 ../extlinux.arch.template "$pkgdir/boot/extlinux/extlinux.arch.template"
@@ -98,6 +114,23 @@ _package-bin() {
# used by mkinitcpio to name the kernel
echo "$_kernel" | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules/$_version/pkgbase"
+
+ cd $srcdir
+ # install the firmware
+ install -Dm755 mali_csffw.bin $pkgdir/usr/lib/firmware/mali_csffw.bin
+
+ # install blob drivers
+ for d in x wayland; do
+ install -Dm755 libmali_g610_$d.so $pkgdir/usr/lib/libmali/libmali_g610_$d.so
+ install -dm755 $pkgdir/usr/lib/libmali/$d
+ for l in libEGL.so libEGL.so.1 libgbm.so.1 libGLESv2.so libGLESv2.so.2 libGLESv2_CM.so libOpenCL.so.1; do
+ ln -s ../libmali_g610_$d.so $pkgdir/usr/lib/libmali/$d/$l;
+ done
+ done
+
+ # install the helper scripts
+ install -Dm755 libmali $pkgdir/usr/bin/libmali
+ install -Dm755 libmaliw $pkgdir/usr/bin/libmaliw
}
_package-bin-headers() {
diff --git a/libmali b/libmali
new file mode 100755
index 000000000000..42c536bb19a0
--- /dev/null
+++ b/libmali
@@ -0,0 +1,19 @@
+#!/bin/bash
+APP=$(which $1)
+ARGS=${@:2}
+HASRPATH=$(chrpath -l $APP | grep -o /usr/lib)
+export LIBGL_DEEPBIND=0
+export LD_LIBRARY_PATH="/usr/lib/gl4es:/usr/lib/libmali/x:$LD_LIBRARY_PATH"
+export LD_PRELOAD="/usr/lib/libdri2to3.so:$LD_PRELOAD"
+# linux linker loads the shared libs in the order of 1. RPATH of the elf, then LD_LIBRARY_PATH
+# if a binary has RPATH pointed out to /usr/lib, then this causes system GL libraries to load
+# in such a case we load the app directly with linker ommitting the rpath of /usr/lib
+echo $HASRPATH
+if [ -z $HASRPATH ]
+then
+ echo "Running ${APP} on X with libmali"
+ exec $APP $ARGS
+else
+ echo "Running ${APP} on X with libmali using linker"
+ exec /lib/ld-linux-aarch64.so.1 --inhibit-rpath :/usr/lib $APP $ARGS
+fi
diff --git a/libmaliw b/libmaliw
new file mode 100755
index 000000000000..03f667ad50b6
--- /dev/null
+++ b/libmaliw
@@ -0,0 +1,18 @@
+#!/bin/bash
+APP=$(which $1)
+ARGS=${@:2}
+HASRPATH=$(chrpath -l $APP | grep -o /usr/lib)
+export LIBGL_DEEPBIND=0
+export LD_LIBRARY_PATH="/usr/lib/gl4es:/usr/lib/libmali/wayland:$LD_LIBRARY_PATH"
+# linux linker loads the shared libs in the order of 1. RPATH of the elf, then LD_LIBRARY_PATH
+# if a binary has RPATH pointed out to /usr/lib, then this causes system GL libraries to load
+# in such a case we load the app directly with linker ommitting the rpath of /usr/lib
+echo $HASRPATH
+if [ -z $HASRPATH ]
+then
+ echo "Running ${APP} on Wayland with libmali"
+ exec $APP $ARGS
+else
+ echo "Running ${APP} on Wayland with libmali using linker"
+ exec /lib/ld-linux-aarch64.so.1 --inhibit-rpath :/usr/lib $APP $ARGS
+fi