diff --git a/modem/unisoc-timesync-daemon/90-unisoc-timesync-daemon.preset b/modem/unisoc-timesync-daemon/90-unisoc-timesync-daemon.preset new file mode 100644 index 000000000..99f1fbc43 --- /dev/null +++ b/modem/unisoc-timesync-daemon/90-unisoc-timesync-daemon.preset @@ -0,0 +1 @@ +enable unisoc-timesync-daemon.service diff --git a/modem/unisoc-timesync-daemon/APKBUILD b/modem/unisoc-timesync-daemon/APKBUILD new file mode 100644 index 000000000..163e49bf9 --- /dev/null +++ b/modem/unisoc-timesync-daemon/APKBUILD @@ -0,0 +1,47 @@ +# Maintainer: Affe Null +pkgname=unisoc-timesync-daemon +pkgver=0_git20250619 +_commit="5b137db011231e0f9dfa3d3d23aebadb30700806" +pkgrel=0 +pkgdesc="NV item daemon for Unisoc modems" +url="https://git.abscue.de/linux-mainlining/unisoc-timesync-daemon" +arch="aarch64" +license="BSD-3-Clause" +subpackages="$pkgname-openrc $pkgname-systemd" +source="$url/-/archive/$_commit/unisoc-timesync-daemon-$_commit.tar.gz + unisoc-timesync-daemon.initd + 90-unisoc-timesync-daemon.preset + " +options="!check" # no tests +builddir="$srcdir/unisoc-timesync-daemon-$_commit" + +build() { + gcc -o unisoc-timesync-daemon unisoc-timesync-daemon.c +} + +package() { + install -Dm755 unisoc-timesync-daemon -t "$pkgdir"/usr/sbin + + install -Dm755 "$srcdir"/unisoc-timesync-daemon.initd \ + "$pkgdir"/etc/init.d/unisoc-timesync-daemon +} + +openrc() { + install="$subpkgname.post-install" + default_openrc +} + +systemd() { + install_if="$pkgname=$pkgver-r$pkgrel systemd" + + install -Dm644 "$builddir"/unisoc-timesync-daemon.service \ + -t "$subpkgdir"/usr/lib/systemd/system + install -Dm644 90-unisoc-timesync-daemon.preset \ + -t "$subpkgdir"/usr/lib/systemd/system-preset +} + +sha512sums=" +be4297461d482fd3acf739804c1fe5a7cef840c3b329cf11bf691f434b2a4d8ebdc4093934cb1eed3e781ce65861f0b103258a76c46816a211fa78a8aaae3a37 unisoc-timesync-daemon-5b137db011231e0f9dfa3d3d23aebadb30700806.tar.gz +492fe8d8da7b9578bd0cd552a2cdbaf219590770cacbe42acff967a534be150957252f96a5b5cc93995ebade25f233ccb214b285ff2f3740f901d4bea9aa94bb unisoc-timesync-daemon.initd +c85fa86de3499ee3144c6e18e8c88a359a99a9c5d7e1c5104c23c9daab375306130d55858cfe8a70e7d2da317eb4eee6ac09ea3c5b07a7cef63cb3b5d7158fc2 90-unisoc-timesync-daemon.preset +" diff --git a/modem/unisoc-timesync-daemon/unisoc-timesync-daemon-openrc.post-install b/modem/unisoc-timesync-daemon/unisoc-timesync-daemon-openrc.post-install new file mode 100644 index 000000000..0e613f2be --- /dev/null +++ b/modem/unisoc-timesync-daemon/unisoc-timesync-daemon-openrc.post-install @@ -0,0 +1,3 @@ +#!/bin/sh +# We should start before the modem boots to be available immediately +rc-update add unisoc-timesync-daemon sysinit diff --git a/modem/unisoc-timesync-daemon/unisoc-timesync-daemon.initd b/modem/unisoc-timesync-daemon/unisoc-timesync-daemon.initd new file mode 100644 index 000000000..cb6230ed8 --- /dev/null +++ b/modem/unisoc-timesync-daemon/unisoc-timesync-daemon.initd @@ -0,0 +1,8 @@ +#!/sbin/openrc-run +supervisor=supervise-daemon + +name="unisoc-timesync-daemon" +description="Unisoc time sync daemon" + +command="/usr/sbin/unisoc-timesync-daemon" +command_args="/dev/wwan0sprdtime0"