query-machine-capabilities: add systemd service file

Add a systemd service that runs the query-machine-capabilities binary
at boot time to ensure that the machine capabilities are stored in the
host-hw-capabilities.json file.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
This commit is contained in:
Markus Frank 2024-11-18 12:16:56 +01:00 committed by Thomas Lamprecht
parent dabf4600ba
commit 88abf3643e
2 changed files with 15 additions and 0 deletions

View File

@ -1,6 +1,7 @@
DESTDIR=
PREFIX=/usr
BINDIR=${PREFIX}/libexec/qemu-server
SERVICEDIR=/lib/systemd/system
CC ?= gcc
CFLAGS += -O2 -fanalyzer -Werror -Wall -Wextra -Wpedantic -Wtype-limits -Wl,-z,relro -std=gnu11
@ -12,6 +13,7 @@ query-machine-capabilities: query-machine-capabilities.c
install: query-machine-capabilities
install -d ${DESTDIR}/${BINDIR}
install -m 0755 query-machine-capabilities ${DESTDIR}${BINDIR}
install -m 0644 query-machine-capabilities.service ${DESTDIR}${SERVICEDIR}
.PHONY: clean
clean:

View File

@ -0,0 +1,13 @@
[Unit]
Description=PVE Query Machine Capabilities
RequiresMountsFor=/run
Before=pve-ha-lrm.service
Before=pve-guests.service
[Service]
ExecStart=/usr/libexec/qemu-server/query-machine-capabilities
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target