main/postmarketos-mkinitfs: support unl0kr (MR 2687)

[ci:skip-build] already built successfully in CI
This commit is contained in:
Johannes Marbach 2022-01-22 19:15:41 +01:00 committed by Clayton Craft
parent 4f3ed7f70e
commit 26c2085d81
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
2 changed files with 12 additions and 55 deletions

View file

@ -2,7 +2,7 @@
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-mkinitfs
pkgver=1.4.1
pkgrel=0
pkgrel=1
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
@ -71,5 +71,5 @@ sha512sums="
f827acb0a10c0e5c1631f1b712e91fde7eb4ade0f1174eb2ef1754018bf4518ea1ad3229fd335c25fb0c6fe46ae20890f5cf43e58c8143ae17b5ab9bb36f0199 postmarketos-mkinitfs-1.4.1.tar.gz
08a3e79c6fa7d3839d43515b8da7817cb36f4ab014552fd0164957c232bb16fde337e57c47c9734d396a5fca3328fbf49ebabe4728c6071c80b04dad14886bba 00-default.modules
0c6d2c749952ff027f1c435a7a3b2861fb632b81c16b6d69a92b47457da4af8cb80e50168b93f92b316377c8c1f5243029fca22ac49fef0940eb5ad6c3dff6ec init.sh
201cd1112f8e5427d8570d87ff260ab492ea74863a1a8c46377438dfb31582c78ad20088168e36972100db1fc5729e9e625fb4d6c4c6bffe5c8ed33cba3ee1d8 init_functions.sh
ddf1d545413cbf4bdd910c8bbd457ce46b1d0afe4c32ec204f3fee933386b08bc27af9f2907b0734b53d929b38352c5c8744d5828d60ffbc68f2a724b854d267 init_functions.sh
"

View file

@ -62,6 +62,13 @@ setup_firmware_path() {
setup_mdev() {
echo /sbin/mdev >/proc/sys/kernel/hotplug
mdev -s
if command -v udevadm > /dev/null; then
# Initialise input devices for libinput / unl0kr
for i in /dev/input/event*; do
udevadm test "/sys/class/input/${i##/dev/input/}"
done
fi
}
get_uptime_seconds() {
@ -296,8 +303,10 @@ resize_root_partition() {
unlock_root_partition() {
partition="$(find_root_partition)"
if cryptsetup isLuks "$partition"; then
tried=0
until cryptsetup status root | grep -qwi active; do
start_onscreen_keyboard
fde-unlock "$partition" "$tried"
tried=$((tried + 1))
done
ROOT_PARTITION_UNLOCKED=1
# Show again the loading splashscreen
@ -493,58 +502,6 @@ start_unudhcpd() {
) &
}
# $1: SDL_VIDEODRIVER value (e.g. 'kmsdrm', 'directfb')
run_osk_sdl() {
unset ETNA_MESA_DEBUG
unset SDL_VIDEODRIVER
unset DFBARGS
unset TSLIB_TSDEVICE
unset OSK_EXTRA_ARGS
case "$1" in
"kmsdrm")
# Set up SDL and Mesa env to use kmsdrm backend
export SDL_VIDEODRIVER="kmsdrm"
# needed for librem 5
export ETNA_MESA_DEBUG="no_supertile"
;;
"directfb")
# Set up directfb and tslib
# Note: linux_input module is disabled since it will try to take over
# the touchscreen device from tslib (e.g. on the N900)
# Note: ps2mouse module is disabled because it causes
# jerky/inconsistent touch input on some devices
export DFBARGS="system=fbdev,no-cursor,disable-module=linux_input,disable-module=ps2mouse"
export SDL_VIDEODRIVER="directfb"
# SDL/directfb tries to use gles even though it's not
# actually available, so disable it in osk-sdl
export OSK_EXTRA_ARGS="--no-gles"
# shellcheck disable=SC2154
if [ -n "$deviceinfo_dev_touchscreen" ]; then
export TSLIB_TSDEVICE="$deviceinfo_dev_touchscreen"
fi
;;
esac
# osk-sdl needs evdev for input and doesn't launch without it, so
# make sure the module isn't missed
modprobe evdev
osk-sdl $OSK_EXTRA_ARGS -n root -d "$partition" -c /etc/osk.conf \
-o /boot/osk.conf -v > /osk-sdl.log 2>&1
}
start_onscreen_keyboard() {
# shellcheck disable=SC2154
if [ -n "$deviceinfo_mesa_driver" ]; then
# try to run osk-sdl with kmsdrm driver, then fallback to
# directfb if that fails
if ! run_osk_sdl "kmsdrm"; then
run_osk_sdl "directfb"
fi
else
run_osk_sdl "directfb"
fi
}
start_charging_mode() {
# NOTE: To reenable charging-sdl, revert the whole commit,
# including the APKBUILD and mkinitfs changes!