Package: osk-sdl
Version: 0.67-2
Severity: normal
Tags: patch
X-Debbugs-Cc: drati...@gmail.com

Dear Maintainer,

In the past days, I have found two systems where osk-sdl didn't include the
correct DRI library in the initramfs. (A Steam Deck, which needs
radeonsi_drm.so and an Asus T100TA Bay Trail tablet, which needs crocus_drm.so)

So instead of trying to maintain a list of all the possible DRI libraries that
might be needed, I propose we just include them all. This is reasonable,
because they are already hardlinks of the same file.

I have checked that in Debian main, files ending in "_dri.so" only come from
libgl1-mesa-dri, and that on amd64 and on the Pinephone, all of those files are
hardlinks.

On my Steam Deck, I have checked that my patch changes the size of the initrd
from 120600 to 120601 kB, and that it works. I haven't yet tested it on any
other devices.


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 5.18.0-4-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages osk-sdl depends on:
ii  cryptsetup             2:2.5.0-2
ii  cryptsetup-initramfs   2:2.5.0-2
ii  debconf [debconf-2.0]  1.5.79
ii  fonts-dejavu-core      2.37-2
ii  libc6                  2.34-3
ii  libcryptsetup12        2:2.5.0-2
ii  libegl1                1.4.0-1
ii  libgcc-s1              12.1.0-8
ii  libgl1                 1.4.0-1
ii  libgles2               1.4.0-1
ii  libsdl2-2.0-0          2.0.22+dfsg-6
ii  libsdl2-ttf-2.0-0      2.20.0+dfsg-1
ii  libstdc++6             12.1.0-8

osk-sdl recommends no packages.

osk-sdl suggests no packages.

-- debconf information excluded
>From 848e446a00efb3ce5ffb07832659caa5e7a4688f Mon Sep 17 00:00:00 2001
From: Balint Kovacs <drati...@gmail.com>
Date: Sat, 27 Aug 2022 01:32:26 +0100
Subject: [PATCH] Include every possible DRI driver

---
 debian/initramfs/hooks/osk-sdl | 37 ++++++++++++----------------------
 1 file changed, 13 insertions(+), 24 deletions(-)

diff --git a/debian/initramfs/hooks/osk-sdl b/debian/initramfs/hooks/osk-sdl
index 2b65692..1f59fb9 100755
--- a/debian/initramfs/hooks/osk-sdl
+++ b/debian/initramfs/hooks/osk-sdl
@@ -18,52 +18,41 @@ esac
 
 # Many dri modules are kmsro, use a symlink there
 dri_inst() {
-    so_src="${libdir}/dri/$1"
-    shift
-    sos=$@
-    so_sum=$(md5sum "${so_src}" | awk '{ print $1 }')
-
-    copy_exec "${so_src}"
-    for so in $sos; do
-        if [ "$(md5sum "${libdir}/dri/${so}" | awk '{ print $1 }')" = 
"${so_sum}" ]; then
-          ln -s "$(basename "${so_src}")" "${DESTDIR}/${libdir}/dri/${so}"
+    for so in "${libdir}/dri/"*_dri.so; do
+        current_so_sum="$(md5sum "${so}" | awk '{ print $1 }')"
+        if [ "x${current_so_sum}" = "x${so_sum}" ]; then
+            ln -s "$(basename "${so_src}")" "${DESTDIR}/${so}"
         else
-          copy_exec "${libdir}/dri/${so}"
+            copy_exec "${so}"
+            so_sum="${current_so_sum}"
+            so_src="${so}"
         fi
     done
 }
 
-IMX_KMSRO="etnaviv_dri.so imx-drm_dri.so imx-dcss_dri.so mxsfb-drm_dri.so"
-
 case "$DPKG_ARCH" in
     arm64)
         libdir=/usr/lib/aarch64-linux-gnu
+        dri_inst
+        copy_exec "$libdir/libGLESv2.so.2"
+
         # Pinephone
         if grep -q "allwinner" /proc/device-tree/compatible 2>/dev/null; then
-            copy_exec "$libdir/dri/sun4i-drm_dri.so"
-            copy_exec "$libdir/libGLESv2.so.2"
             manual_add_modules goodix goodix_ts
         # Librem 5 and Librem 5 Devkit
         elif grep -q "imx" /proc/device-tree/compatible 2>/dev/null; then
-            dri_inst ${IMX_KMSRO}
-            copy_exec "$libdir/libGLESv2.so.2"
             manual_add_modules edt-ft5x06 goodix pwm_vibra goodix_ts
-       # PinePhone Pro
-       elif grep -q "PinePhonePro" /proc/device-tree/model 2>/dev/null; then
-            dri_inst ${IMX_KMSRO} panfrost_dri.so rockchip_dri.so
-            copy_exec "$libdir/libGLESv2.so.2"
+        # PinePhone Pro
+        elif grep -q "PinePhonePro" /proc/device-tree/model 2>/dev/null; then
             manual_add_modules goodix pwm_vibra goodix_ts
         # Generic / Installer (needs to include all of the above)
         else
-            dri_inst ${IMX_KMSRO} sun4i-drm_dri.so panfrost_dri.so 
rockchip_dri.so
-            copy_exec "$libdir/libGLESv2.so.2"
             manual_add_modules edt-ft5x06 goodix pwm_vibra goodix_ts
         fi
         ;;
     amd64)
         libdir=/usr/lib/x86_64-linux-gnu
-        AMD64_KMSRO="vmwgfx_dri.so virtio_gpu_dri.so i965_dri.so iris_dri.so 
kms_swrast_dri.so"
-        dri_inst ${AMD64_KMSRO}
+        dri_inst
         copy_exec "$libdir/libGLESv2.so.2"
         ;;
     *)
-- 
2.37.2

Reply via email to