Add msm-fb-refresher package and initfs config (#587)

* Add msm-fb-refresher package and initfs config
* Bump version for pmos-mkinitfs
* Create msm-fb-refresher openrc service
* kill refresher when initfs is done
This commit is contained in:
clayton craft 2017-09-18 12:17:30 -07:00 committed by Oliver Smith
parent 4890b9a935
commit 1bef78c6df
8 changed files with 84 additions and 7 deletions

View file

@ -0,0 +1,28 @@
pkgname=msm-fb-refresher
pkgver=0.1
pkgrel=0
pkgdesc="Display refresher for Qualcomm devices"
arch="all"
url="https://github.com/AsteroidOS/msm-fb-refresher"
license="GPL2"
makedepends="linux-headers"
source="
${pkgname}-${pkgver}.tar.gz::https://github.com/AsteroidOS/msm-fb-refresher/archive/v${pkgver}.tar.gz
msm-fb-refresher.init
"
builddir="${srcdir}/${pkgname}-${pkgver}"
build() {
gcc refresher.c -o refresher.o -c
gcc refresher.o -o msm-fb-refresher
}
package() {
install -Dm755 "${builddir}/msm-fb-refresher" \
"${pkgdir}/usr/sbin/msm-fb-refresher"
install -Dm755 "${srcdir}/msm-fb-refresher.init" \
"${pkgdir}/etc/init.d/msm-fb-refresher"
}
sha512sums="6c39f2a2eccf5c4b4dc89e91b69385ad89cfd3fdef3121d32e88f2811b3a6df1ca15c5f8df8df7eced7133e99abdf54034bc82e9d871f40bfc4271b9a0474e15 msm-fb-refresher-0.1.tar.gz
5820e02dcb1cd927bcd6c8548307936a12f0dde1b92f15a931134b8d4a41f4b5e8811c6969d9b11a6a31d40da218b24ee274614936f6e50bcd6e794346f99c13 msm-fb-refresher.init"

View file

@ -0,0 +1,27 @@
#!/sbin/openrc-run
cmd=/usr/sbin/msm-fb-refresher
cmd_args="--loop"
pid=/run/msm-fb-refresher.pid
depend() {
after bootmisc
}
start() {
ebegin "Starting msm-fb-refresher"
start-stop-daemon --start --exec $cmd --background \
--pidfile $pid --make-pidfile -- $cmd_args
eend $?
}
stop() {
ebegin "Stopping msm-fb-refresher"
start-stop-daemon --stop --exec $cmd
eend $?
}
restart() {
stop
start
}

View file

@ -1,6 +1,6 @@
pkgname=postmarketos-base
pkgver=2
pkgrel=7
pkgrel=9
pkgdesc="Meta package for minimal postmarketos base"
url="https://github.com/postmarketOS"
arch="noarch"
@ -25,4 +25,4 @@ package() {
sha512sums="c6de3b44bc45b9f9c641a7e34c69a481ee39b99ac0251cd28f2b3aae49c1a8d1ca448f4936b7942b1a8b8f7c18a5415c938098765ed8cf08456543800160e64b sudoers
38dc75c0ed32b76dccd3d8e7e8173e8b7d91847cf2b07123f376b95af46b4f89798b24f45302a0726fdc1cf253aecaac140f431735ac5c6511553f790badd0af firmwareload.sh
0b098828080055d3646ea54891cb0e1b578cbc30f5e16f7284f2814c08192f18079a38fb686d192715ae6a3d2cd6625d9e3cf99f234a6f0d94088bb0cb2ce43d 50-firmware.rules
5ad5ed61c43f366b1802201ecafd8c756aff0dabeb63ad171fe96ec773360722b314eeb120528507fa72b57b54da82d9d64f887c91b59fbf485ba52a2f3e7bbf postmarketos-base.post-install"
b3bf756c5100cc49260d38014faada287bbbba3da4d404f08b76db1b925adc0d30a37e1c37e318f4f698ca353790d715b825cf18fe1bb81a6988976b051530b2 postmarketos-base.post-install"

View file

@ -15,6 +15,9 @@ done
for service in mount-ro killprocs savecache; do
rc-update -q add $service shutdown
done
if [ "${deviceinfo_msm_refresher}" = "true" ]; then
rc-update -q add msm-fb-refresher boot
fi
# Add user account
adduser -u 1000 -D -h /home/user -G users user 2>/dev/null

View file

@ -1,5 +1,5 @@
pkgname=postmarketos-mkinitfs
pkgver=0.3.4
pkgver=0.3.5
pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://github.com/postmarketOS"
@ -25,6 +25,6 @@ package() {
"$pkgdir/sbin/mkinitfs"
mkdir -p "$pkgdir/etc/postmarketos-mkinitfs/hooks/"
}
sha512sums="3d0215d61a34e846c6c3e4ff1911742a620cd1c6ff1de3cf26eaa4cb7643467da72bf9abc6a53992cc750bb76340be820149b25b806152b70fc0d40e0f8aa310 init.sh.in
a47398cdbb5e68a34086038cf6d72df91f6e58dcae7ff1ea8a375cd44f21e4573a944122ca5a32dda7b002bb14ec5826435edd2512c3db198dc9c0c3756e3cbe init_functions.sh
ef1481ef45e786486fb8e9939f756afb1d873a92546468d3dda3065ef46404be7e9847ab1f630fa6cf3e4ab99bdb116401093bbb1bbc882ea85ea824cdf7e389 mkinitfs.sh"
sha512sums="91860e61cc42b77c02522ab273cf4793b78ee595a75c026c057522a5e6d1fdcc7ec868cbdaea5912c90dea61483468dc609dc69144a6d8e68ef47c9d1459fdb6 init.sh.in
8823d0685c40f4a21936a3a371914a9af39f12ad48371ccdaea88379e2109bdd13728252ce774cc53f6053cecd51334ee3b7a3d559ba4b77e45d0e233714d930 init_functions.sh
6408f8b3302d965b7eb335ce617b28e8159420a9ec137243844f6ccf1f13055556b999c4f32385a4249aa8e9cce33898153a45dd53499a73a39d61dff18f3291 mkinitfs.sh"

View file

@ -15,6 +15,9 @@ setup_log
setup_mdev
mount_subpartitions
# Start msm-fb-refresher workaround for qualcomm devices
start_msm_refresher
# Hooks
for hook in /etc/postmarketos-mkinitfs/hooks/*.sh; do
[ -e "$hook" ] || continue
@ -38,7 +41,7 @@ resize_root_filesystem
mount_root_partition
# Switch root
killall telnetd mdev 2>/dev/null
killall telnetd mdev msm-fb-refresher 2>/dev/null
umount /boot
umount /proc
umount /sys

View file

@ -299,6 +299,13 @@ echo_connect_ssh_message() {
echo "ssh user@$IP"
}
start_msm_refresher() {
# shellcheck disable=SC2154,SC2086
if [ "${deviceinfo_msm_refresher}" = "true" ]; then
/usr/sbin/msm-fb-refresher --loop &
fi
}
loop_forever() {
while true; do
sleep 1

View file

@ -97,6 +97,9 @@ get_modules()
get_binaries()
{
BINARIES="/bin/busybox /bin/busybox-extras /usr/sbin/telnetd /sbin/kpartx"
if [ "${deviceinfo_msm_refresher}" == "true" ]; then
BINARIES="${BINARIES} /usr/sbin/msm-fb-refresher"
fi
lddtree -l $BINARIES | sort -u
}
@ -243,6 +246,12 @@ parse_commandline "$1" "$2" "$3"
echo "==> initramfs: creating $outfile"
tmpdir=$(mktemp -d /tmp/mkinitfs.XXXXXX)
if [ "${deviceinfo_msm_refresher}" == "true" ] && ! [ -e /usr/sbin/msm-fb-refresher ]; then
echo "ERROR: Please add msm-fb-refresher as dependency to your device package,"
echo "or set msm_refresher to false in your deviceinfo!"
exit 1
fi
# set up initfs in temp folder
create_folders
copy_files "$(get_modules)" "$tmpdir"