main/postmarketos-boot-hwtest: new aport (!617)

This commit is contained in:
Martijn Braam 2019-09-09 13:54:27 +02:00 committed by Oliver Smith
parent d041549b58
commit 0a512b8435
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,20 @@
# Contributor: Martijn Braam
pkgname=postmarketos-boot-hwtest
pkgver=0.1
pkgrel=0
pkgdesc="Boot into a TTY running hwtest"
url="https://gitlab.com/MartijnBraam/hwtest"
arch="all"
license="MIT"
depends="hwtest ofono dbus-x11"
install="$pkgname.post-install"
source="launch_hwtest.sh"
options="!check"
package() {
mkdir -p $pkgdir
install -D -m755 "$srcdir"/launch_hwtest.sh \
"$pkgdir"/etc/profile.d/99-hwtest.sh
}
sha512sums="2fca42f44918af02ee706e84d00c876630b53605c13daf4c79b097a3ae1d7b323ff658964516c0c9bd098d6c61bebaba0e95e48e416490959f75fa88b7fc943e launch_hwtest.sh"

View file

@ -0,0 +1,9 @@
#!/bin/sh
if [ "$(id -u)" = "10000" ] && [ $(tty) = "/dev/tty1" ]; then
if [ -f /usr/share/hwtest.ini ]; then
dbus-launch hwtest --verify /usr/share/hwtest.ini --export ~/hwtest.ini --formatter ColoredTTY
else
dbus-launch hwtest --formatter ColoredTTY --export ~/hwtest.ini
fi
fi

View file

@ -0,0 +1,13 @@
#!/bin/sh
# Enable ofono
rc-update add ofono default
# Autologin on tty1, let busybox autoconfigure 2-6
autologin="$(getent passwd 10000 | cut -d ":" -f 1)"
for i in 1 2 3 4 5 6; do
old="^tty$i::respawn:/sbin/getty 38400 tty$i"
new="# tty$i::respawn:/sbin/getty 38400 tty$i"
[ "$i" == "1" ] && new="tty1::respawn:/bin/login -f $autologin"
sed -i -e "s.$old.$new.g" /etc/inittab
done