postmarketos-mkinitfs: fix charging-sdl for kmsdrm devices (MR 2098)

This fix was pending since before charging-sdl was deprecated and still
provides value should anyone wish to pickup and improve charging-sdl
again.

charging-sdl currently does not check for devices using mesa, even
though it supports it in the same way as osk-sdl. Check for msa support
and set SDL_VIDEODRIVER in that case.

Also fix the font path, as it was reading both keyboard-font and
keyboard-font-size from osk.conf.
This commit is contained in:
Caleb Connolly 2021-04-06 18:59:14 +01:00 committed by Alexey Minnekhanov
parent 0a4645eaec
commit 34623c4a0a
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
2 changed files with 10 additions and 3 deletions

View file

@ -1,6 +1,6 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org> # Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=postmarketos-mkinitfs pkgname=postmarketos-mkinitfs
pkgver=0.31 pkgver=0.32
pkgrel=0 pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS" pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org" url="https://postmarketos.org"
@ -54,7 +54,7 @@ check() {
sha512sums=" sha512sums="
4717bf24bd13fd4d90f3ab000ab43f7d61529515de224ebc86458ae709ebe0b5065655457e34f5952126bac6ab45143a91cddb09a8ad2d0a55c5cecd564a0135 00-default.modules 4717bf24bd13fd4d90f3ab000ab43f7d61529515de224ebc86458ae709ebe0b5065655457e34f5952126bac6ab45143a91cddb09a8ad2d0a55c5cecd564a0135 00-default.modules
4d718fca3b6a8c2d362003e7d57f9fa29510c05c27b372d21b8278fe76b2096ae098aa9f9a266a029f82956d165fd764e406ddaf36cec2e4f3bd30c6022d07a7 init.sh.in 4d718fca3b6a8c2d362003e7d57f9fa29510c05c27b372d21b8278fe76b2096ae098aa9f9a266a029f82956d165fd764e406ddaf36cec2e4f3bd30c6022d07a7 init.sh.in
a415707cbeea0612846dff3dc26ac9b2b4815fc4a59e05a1f2065010d1b004b96fd4c20ed8c171c9d614703c86b7c3354fd9aef267025182be731c35864ef831 init_functions.sh 563dfbd8e1ff1d3f42cd8f9615144fde83d0e1107fa1d6751eb7e049628cded12c0f1762d4ce498f741802b5f8449ef7cf1959fec22ea975fefeaa8050c171ec init_functions.sh
5590087d67cf8cae0e4f2b9a0d3f055a01282ace53abe586a0117a9701287cf60a88230ba5817e77886b9496098139c025c6221c4b7404e36faac7df63adc1ee mkinitfs.sh 5590087d67cf8cae0e4f2b9a0d3f055a01282ace53abe586a0117a9701287cf60a88230ba5817e77886b9496098139c025c6221c4b7404e36faac7df63adc1ee mkinitfs.sh
879223b6b608f3b26993c3536b4e6b37728f774d6e4da891ae87ef26e38603a15b09918b69963c4f65aa4551b721815fd3578a1ec598b7b9d418aa677520d55f mkinitfs_functions.sh 879223b6b608f3b26993c3536b4e6b37728f774d6e4da891ae87ef26e38603a15b09918b69963c4f65aa4551b721815fd3578a1ec598b7b9d418aa677520d55f mkinitfs_functions.sh
c7a3c33daeb12b33ac72207191941c4d634f15c22958273b52af381a70ebaba1d3a9299483f0c447d9e66c560151fe7b9588bb4bbef2c8914f83185984ee4622 mkinitfs_test.sh c7a3c33daeb12b33ac72207191941c4d634f15c22958273b52af381a70ebaba1d3a9299483f0c447d9e66c560151fe7b9588bb4bbef2c8914f83185984ee4622 mkinitfs_test.sh

View file

@ -552,11 +552,18 @@ start_charging_mode() {
lpcharge=1 lpcharge=1
androidboot.bootchg=true androidboot.bootchg=true
" "
# Support devices using KMS
# shellcheck disable=SC2154
if [ -n "$deviceinfo_mesa_driver" ]; then
export SDL_VIDEODRIVER="kmsdrm"
fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
grep -Eq "$(echo $chargingmodes | tr ' ' '|')" /proc/cmdline || return grep -Eq "$(echo $chargingmodes | tr ' ' '|')" /proc/cmdline || return
setup_directfb_tslib setup_directfb_tslib
# Get the font from osk-sdl config # Get the font from osk-sdl config
fontpath=$(awk '/^keyboard-font/{print $3}' /etc/osk.conf) fontpath=$(awk '/^keyboard-font\s=/{print $3}' /etc/osk.conf)
# Set up triggerhappy config # Set up triggerhappy config
{ {
echo "KEY_POWER 1 pgrep -x charging-sdl || charging-sdl -pcf $fontpath" echo "KEY_POWER 1 pgrep -x charging-sdl || charging-sdl -pcf $fontpath"