From 37a9e0289c7e87471e34b3aff1a15cd9920a23fa Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 13 Aug 2023 23:34:21 -0400 Subject: [PATCH] qubes-vm-utils: initial import from user-aports --- qubes-vm-utils/APKBUILD | 63 ++++++++++++++++++++++ qubes-vm-utils/qubes-meminfo-writer.openrc | 17 ++++++ 2 files changed, 80 insertions(+) create mode 100644 qubes-vm-utils/APKBUILD create mode 100644 qubes-vm-utils/qubes-meminfo-writer.openrc diff --git a/qubes-vm-utils/APKBUILD b/qubes-vm-utils/APKBUILD new file mode 100644 index 0000000..b90507a --- /dev/null +++ b/qubes-vm-utils/APKBUILD @@ -0,0 +1,63 @@ +# Maintainer: Antoine Martin (ayakael) +# Contributor: Antoine Martin (ayakael) + +pkgname=qubes-vm-utils +subpackages=" + qubes-vm-kernel-support:support:noarch + $pkgname-openrc + " +pkgver=4.1.19 +pkgrel=0 +_gittag="v$pkgver" +pkgdesc="Common Linux files for Qubes VM." +arch="x86_64" +url="https://github.com/QubesOS/qubes-linux-utils" +license='GPL' +depends=" + imagemagick + py3-pillow + py3-numpy + " +makedepends=" + gcc + make + pkgconfig + py3-setuptools + qubes-libvchan-xen-dev + xen-dev + " +source=" + $pkgname-$_gittag.tar.gz::https://github.com/QubesOS/qubes-linux-utils/archive/refs/tags/$_gittag.tar.gz + qubes-meminfo-writer.openrc + " +options="!check" # No testsuite +builddir="$srcdir"/${pkgname/vm/linux}-${_gittag/v} + +build() { + export BACKEND_VMM=xen + make all +} + +package() { + make install DESTDIR="$pkgdir" LIBDIR=/usr/lib SYSLIBDIR=/lib SBINDIR=/sbin + install -Dm 755 "$srcdir"/qubes-meminfo-writer.openrc "$pkgdir"/etc/init.d/qubes-meminfo-writer +} + +support() { + depends=" + mkinitcpio + dkms + grub + " + cd "$builddir" + mkdir -p "$subpkgdir"/usr/lib/initcpio/install/ + mkdir -p "$subpkgdir"/usr/lib/initcpio/hooks/ + mkdir -p "$subpkgdir"/usr/lib/qubes/ + mkdir -p "$subpkgdir"/usr/bin/ + + install -m 755 "$builddir"/dracut/full-dmroot/qubes_cow_setup.sh "$subpkgdir"/usr/lib/qubes/qubes_cow_setup.sh +} +sha512sums=" +adfa6190af80e8ff92b899056370b8e820820154dcbad2d141debc72a6f122d94894eb0ffd5f56715db8ff7c3166c63b8832a78f70c35d86d42af071297b7d35 qubes-vm-utils-v4.1.19.tar.gz +aebc606faa95948be77766f164fc40e4be66e4398e7f56ad52ba9de4c8f7de4ec0c4b48b23a3a6dd083d6f19ae1a591f3ae0caf2c696fd061cd8fea4bdf7d4f3 qubes-meminfo-writer.openrc +" diff --git a/qubes-vm-utils/qubes-meminfo-writer.openrc b/qubes-vm-utils/qubes-meminfo-writer.openrc new file mode 100644 index 0000000..9e8acdc --- /dev/null +++ b/qubes-vm-utils/qubes-meminfo-writer.openrc @@ -0,0 +1,17 @@ +#!/sbin/openrc-run + +name=$RC_SVCNAME +cfgfile="/etc/qubes/$RC_SVCNAME.conf" +pidfile="/var/run/meminfo-writer.pid" +command="/sbin/meminfo-writer" +command_args="30000 100000 $pidfile" +command_user="root" +start_stop_daemon_args="" +command_background="yes" +output_log="/var/log/qubes/$RC_SVCNAME.log" +error_log="/var/log/qubes/$RC_SVCNAME.err" + +start_pre() { + checkpath --directory --owner $command_user:qubes --mode 0775 \ + /var/log/qubes +}