From 0337bb4b35d45e21e438559facc0787f1dea007b Mon Sep 17 00:00:00 2001 From: exkc Date: Sun, 2 Feb 2025 05:30:09 +0800 Subject: [PATCH] main/postmarketos-ui-buffyboard: new aport (MR 6127) [ci:skip-build] Already built fine in the CI once --- main/postmarketos-ui-buffyboard/APKBUILD | 43 +++++++++++++++++++ .../buffyboard.init | 25 +++++++++++ .../buffyboard.service | 16 +++++++ ...marketos-ui-buffyboard-openrc.post-install | 4 ++ ...marketos-ui-buffyboard-openrc.post-upgrade | 4 ++ ...arketos-ui-buffyboard-openrc.pre-deinstall | 3 ++ ...arketos-ui-buffyboard-systemd.post-install | 10 +++++ ...rketos-ui-buffyboard-systemd.pre-deinstall | 10 +++++ 8 files changed, 115 insertions(+) create mode 100644 main/postmarketos-ui-buffyboard/APKBUILD create mode 100644 main/postmarketos-ui-buffyboard/buffyboard.init create mode 100644 main/postmarketos-ui-buffyboard/buffyboard.service create mode 100644 main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-install create mode 100644 main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-upgrade create mode 100644 main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.pre-deinstall create mode 100644 main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.post-install create mode 100644 main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.pre-deinstall diff --git a/main/postmarketos-ui-buffyboard/APKBUILD b/main/postmarketos-ui-buffyboard/APKBUILD new file mode 100644 index 000000000..8b58a267d --- /dev/null +++ b/main/postmarketos-ui-buffyboard/APKBUILD @@ -0,0 +1,43 @@ +# Reference: https://postmarketos.org/uipkg +# Based On: postmarketos-ui-fbkeyboard +pkgname=postmarketos-ui-buffyboard +pkgver=1 +pkgrel=0 +pkgdesc="Plain framebuffer console with modern touchscreen keyboard support" +url="https://gitlab.postmarketos.org/postmarketOS/buffybox" +arch="all" +license="GPL-3.0-or-later" +depends=" + dnsmasq + buffyboard + postmarketos-base-ui + postmarketos-base-ui-networkmanager + " +subpackages="$pkgname-openrc $pkgname-systemd" +source="buffyboard.init buffyboard.service" +options="!check" # No tests + +package() { + install -Dm755 "$srcdir"/buffyboard.init "$pkgdir"/etc/init.d/buffyboard + install -Dm644 "$srcdir"/buffyboard.service -t "$pkgdir"/usr/lib/systemd/system +} + +openrc() { + install_if="$pkgname=$pkgver-r$pkgrel openrc" + install="$subpkgname.post-install $subpkgname.pre-deinstall $subpkgname.post-upgrade" + depends=" + networkmanager-openrc + " + + mkdir -p "$subpkgdir" +} + +systemd() { + install="$subpkgname.post-install $subpkgname.pre-deinstall" + default_systemd +} + +sha512sums=" +81178d6f86dbe24c8ddfd0c1c29504f12941232f11124d21aedde54d2a82c34e03fba8e82e5bbc285d94e216e812763291787e086b51e8eb258562714e4dadcd buffyboard.init +0bf529465d5d882e64f1804c0a809bc38c1fbadaf52b276848708c761d53014c8d302c2573200d2f831090d6833abc6da6f89f28e9b309dc63f9ca10d148b4b2 buffyboard.service +" diff --git a/main/postmarketos-ui-buffyboard/buffyboard.init b/main/postmarketos-ui-buffyboard/buffyboard.init new file mode 100644 index 000000000..b3841cd94 --- /dev/null +++ b/main/postmarketos-ui-buffyboard/buffyboard.init @@ -0,0 +1,25 @@ +#!/sbin/openrc-run + +name="buffyboard" +command="/usr/bin/buffyboard" +pidfile="/var/run/buffyboard.pid" +command_background=true + +depend() +{ + after consolefont + keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu +} + +start_pre() +{ + # Setup kernel support for user level drivers (input subsystem) + if [ ! -e /dev/uinput ]; then + if ! modprobe -q uinput; then + eerror "The uinput module needs to be loaded by " \ + "the buffyboard service or built in." + fi + fi + # save energy + echo 0 >/sys/class/graphics/fbcon/cursor_blink +} diff --git a/main/postmarketos-ui-buffyboard/buffyboard.service b/main/postmarketos-ui-buffyboard/buffyboard.service new file mode 100644 index 000000000..aa1dd02e2 --- /dev/null +++ b/main/postmarketos-ui-buffyboard/buffyboard.service @@ -0,0 +1,16 @@ +[Unit] +Description=Buffyboard UI service +ConditionPathExists=/dev/tty0 +After=getty@tty1.service + +[Service] +Type=exec +ExecStart=/usr/bin/buffyboard +ExecStartPre=-modprobe uinput +ExecStartPre=-/bin/sh -c "echo 0 > /sys/class/graphics/fbcon/cursor_blink" +Restart=always +RestartSec=1s +PIDFile=/run/buffyboard.pid + +[Install] +WantedBy=multi-user.target diff --git a/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-install b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-install new file mode 100644 index 000000000..a545c082e --- /dev/null +++ b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-install @@ -0,0 +1,4 @@ +#!/bin/sh + +rc-update add buffyboard default +rc-update add networkmanager default diff --git a/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-upgrade b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-upgrade new file mode 100644 index 000000000..a545c082e --- /dev/null +++ b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.post-upgrade @@ -0,0 +1,4 @@ +#!/bin/sh + +rc-update add buffyboard default +rc-update add networkmanager default diff --git a/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.pre-deinstall b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.pre-deinstall new file mode 100644 index 000000000..af62141fa --- /dev/null +++ b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-openrc.pre-deinstall @@ -0,0 +1,3 @@ +#!/bin/sh + +rc-update del buffyboard diff --git a/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.post-install b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.post-install new file mode 100644 index 000000000..94ba57e9f --- /dev/null +++ b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.post-install @@ -0,0 +1,10 @@ +#!/bin/sh + +# This file is forcefully included into CI shellcheck by: +# $(find . -path './main/postmarketos-ui-*/*.post-install') +# in .ci/shellcheck.sh. Silence it here to avoid error: +# SC1091 (info): Not following: /usr/lib/systemd/systemd-apk-macros.sh: +# openBinaryFile: does not exist (No such file or directory) +# shellcheck disable=SC1091 +. /usr/lib/systemd/systemd-apk-macros.sh +systemd_service_post_install system buffyboard diff --git a/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.pre-deinstall b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.pre-deinstall new file mode 100644 index 000000000..79ffb7171 --- /dev/null +++ b/main/postmarketos-ui-buffyboard/postmarketos-ui-buffyboard-systemd.pre-deinstall @@ -0,0 +1,10 @@ +#!/bin/sh + +# This file is forcefully included into CI shellcheck by: +# $(find . -path './main/postmarketos-ui-*/*.pre-deinstall') +# in .ci/shellcheck.sh. Silence it here to avoid error: +# SC1091 (info): Not following: /usr/lib/systemd/systemd-apk-macros.sh: +# openBinaryFile: does not exist (No such file or directory) +# shellcheck disable=SC1091 +. /usr/lib/systemd/systemd-apk-macros.sh +systemd_service_pre_deinstall system buffyboard