Skip to content

Commit

Permalink
qemu: Split qemu-guest-agent into separate package
Browse files Browse the repository at this point in the history
Also adds service files & preset to run guest agent

Tested in my SerpentVM, guest agent details show up
on my Proxmox host.
  • Loading branch information
tarkah authored and ikeycode committed Sep 22, 2024
1 parent d74dfcf commit 1ebae5a
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 4 deletions.
Binary file modified q/qemu/manifest.x86_64.bin
Binary file not shown.
65 changes: 62 additions & 3 deletions q/qemu/manifest.x86_64.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"files": [
"/usr/bin/elf2dmp",
"/usr/bin/qemu-edid",
"/usr/bin/qemu-ga",
"/usr/bin/qemu-i386",
"/usr/bin/qemu-img",
"/usr/bin/qemu-io",
Expand Down Expand Up @@ -225,7 +224,6 @@
"provides": [
"binary(elf2dmp)",
"binary(qemu-edid)",
"binary(qemu-ga)",
"binary(qemu-i386)",
"binary(qemu-img)",
"binary(qemu-io)",
Expand Down Expand Up @@ -288,9 +286,70 @@
"/usr/include/qemu-plugin.h"
],
"name": "qemu-devel"
},
"qemu-guest-agent": {
"build-depends": [
"binary(bzip2)",
"binary(meson)",
"binary(ninja)",
"binary(nm)",
"binary(python3)",
"pkgconfig(SDL2_image)",
"pkgconfig(alsa)",
"pkgconfig(epoxy)",
"pkgconfig(fuse3)",
"pkgconfig(gbm)",
"pkgconfig(gio-2.0)",
"pkgconfig(glib-2.0)",
"pkgconfig(gmp)",
"pkgconfig(gtk+-3.0)",
"pkgconfig(gtk+-x11-3.0)",
"pkgconfig(libcurl)",
"pkgconfig(libdw)",
"pkgconfig(libfdt)",
"pkgconfig(libgcrypt)",
"pkgconfig(libjpeg)",
"pkgconfig(libpipewire-0.3)",
"pkgconfig(libpng)",
"pkgconfig(libpulse)",
"pkgconfig(libseccomp)",
"pkgconfig(libssh)",
"pkgconfig(libtasn1)",
"pkgconfig(libudev)",
"pkgconfig(libusb-1.0)",
"pkgconfig(libzstd)",
"pkgconfig(pixman-1)",
"pkgconfig(sdl2)",
"pkgconfig(slirp)",
"pkgconfig(spice-protocol)",
"pkgconfig(spice-server)",
"pkgconfig(virglrenderer)",
"pkgconfig(x11)",
"pkgconfig(xkbcommon)",
"pkgconfig(zlib)",
"xkeyboard-config"
],
"depends": [
"interpreter(/usr/lib/ld-linux-x86-64.so.2(x86_64))",
"soname(libc.so.6(x86_64))",
"soname(libglib-2.0.so.0(x86_64))",
"soname(libm.so.6(x86_64))",
"soname(libudev.so.1(x86_64))"
],
"files": [
"/usr/bin/qemu-ga",
"/usr/lib/systemd/system-preset/99-qemu-guest-agent.preset",
"/usr/lib/systemd/system/qemu-guest-agent.service",
"/usr/lib/tmpfiles.d/qemu-guest-agent.conf",
"/usr/lib/udev/rules.d/99-qemu-guest-agent.rules"
],
"name": "qemu-guest-agent",
"provides": [
"binary(qemu-ga)"
]
}
},
"source-name": "qemu",
"source-release": "8",
"source-release": "9",
"source-version": "9.1.0"
}
2 changes: 2 additions & 0 deletions q/qemu/pkg/99-qemu-guest-agent.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", \
TAG+="systemd", ENV{SYSTEMD_WANTS}="qemu-guest-agent.service"
1 change: 1 addition & 0 deletions q/qemu/pkg/qemu-guest-agent.preset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable qemu-guest-agent.service
16 changes: 16 additions & 0 deletions q/qemu/pkg/qemu-guest-agent.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=QEMU Guest Agent
BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device
After=dev-virtio\x2dports-org.qemu.guest_agent.0.device
IgnoreOnIsolate=True

[Service]
UMask=0077
ExecStart=/usr/bin/qemu-ga \
--method=virtio-serial \
--path=/dev/virtio-ports/org.qemu.guest_agent.0
Restart=always
RestartSec=0

[Install]
WantedBy=dev-virtio\x2dports-org.qemu.guest_agent.0.device
18 changes: 17 additions & 1 deletion q/qemu/stone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
name : qemu
version : 9.1.0
release : 8
release : 9
homepage : http://www.qemu-project.org/
upstreams :
- https://download.qemu.org/qemu-9.1.0.tar.xz : 816b7022a8ba7c2ac30e2e0cf973e826f6bcc8505339603212c5ede8e94d7834
Expand Down Expand Up @@ -62,6 +62,22 @@ build : |
install : |
%make_install
%install_file %(pkgdir)/qemu-guest-agent.service -t %(installroot)/%(libdir)/systemd/system/
%install_file %(pkgdir)/qemu-guest-agent.preset %(installroot)/%(libdir)/systemd/system-preset/99-qemu-guest-agent.preset
%install_file %(pkgdir)/99-qemu-guest-agent.rules -t %(installroot)/%(libdir)/udev/rules.d/
# TODO: Enable name override in %%tmpfiles macro
mkdir -p %(installroot)%(tmpfilesdir)
echo "d /var/log/qemu-ga 0755 root root -" >> %(installroot)%(tmpfilesdir)/qemu-guest-agent.conf
# TODO: Stop boulder emitting dependencies for these guys
rm -v %(installroot)%(datadir)/qemu/s390*
rm -v %(installroot)%(datadir)/qemu/hppa*
packages :
- "qemu-guest-agent":
paths:
- /usr/bin/qemu-ga
- /usr/lib/systemd/system/qemu-guest-agent.service
- /usr/lib/systemd/system-preset/99-qemu-guest-agent.preset
- /usr/lib/udev/rules.d/99-qemu-guest-agent.rules
- /usr/lib/tmpfiles.d/qemu-guest-agent.conf

0 comments on commit 1ebae5a

Please sign in to comment.