mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-20 11:51:06 +02:00
app-emulation/qemu-guest-agent: Sync with Gentoo
It's from Gentoo commit 89291a1c3c00481aebdefcb84eb4c26761a7caf5. Signed-off-by: Flatcar Buildbot <buildbot@flatcar-linux.org>
This commit is contained in:
parent
966d28a5ca
commit
61cf3e765e
@ -1,24 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
start() {
|
||||
GA_METHOD=${GA_METHOD:-virtio-serial}
|
||||
GA_PATH=${GA_PATH:-/dev/virtio-ports/org.qemu.guest_agent.0}
|
||||
|
||||
ebegin "Starting QEMU Guest Agent"
|
||||
|
||||
start-stop-daemon --start --pidfile /run/qemu-ga.pid \
|
||||
--exec /usr/bin/qemu-ga -- -m ${GA_METHOD} -p ${GA_PATH} \
|
||||
-l /var/log/qemu-ga.log -d -f /run/qemu-ga.pid -t /run ${GA_OPTIONS}
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping QEMU Guest Agent"
|
||||
|
||||
start-stop-daemon --stop --pidfile /run/qemu-ga.pid
|
||||
|
||||
eend $?
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2024 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
GA_METHOD=${GA_METHOD:-virtio-serial}
|
||||
GA_PATH=${GA_PATH:-/dev/virtio-ports/org.qemu.guest_agent.0}
|
||||
|
||||
description="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
|
||||
command="/usr/bin/qemu-ga"
|
||||
pidfile="/run/qemu-ga.pid"
|
||||
command_args="-m ${GA_METHOD} -p ${GA_PATH} -l /var/log/qemu-ga.log -d -f ${pidfile} -t /run ${GA_OPTIONS}"
|
@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
@ -6,14 +6,14 @@ EAPI=8
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
PYTHON_REQ_USE="ensurepip(-),ncurses,readline"
|
||||
|
||||
inherit edo systemd toolchain-funcs python-any-r1 udev
|
||||
inherit edo linux-info python-any-r1 systemd toolchain-funcs udev
|
||||
|
||||
MY_PN="qemu"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
|
||||
DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
|
||||
HOMEPAGE="https://wiki.qemu.org/Features/GuestAgent"
|
||||
SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.xz"
|
||||
SRC_URI="https://download.qemu.org/${MY_P}.tar.xz"
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
LICENSE="GPL-2 BSD-2"
|
||||
@ -24,6 +24,9 @@ RDEPEND="dev-libs/glib"
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
$(python_gen_any_dep '
|
||||
dev-python/distlib[${PYTHON_USEDEP}]
|
||||
')
|
||||
dev-lang/perl
|
||||
app-alternatives/ninja
|
||||
"
|
||||
@ -32,6 +35,18 @@ PATCHES=(
|
||||
"${FILESDIR}"/qemu-8.1.0-find-sphinx.patch
|
||||
)
|
||||
|
||||
python_check_deps() {
|
||||
python_has_version "dev-python/distlib[${PYTHON_USEDEP}]"
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
# While qemu-ga supports multiple modes, virtio-serial is the
|
||||
# default. Make sure it's enabled in kernel.
|
||||
CONFIG_CHECK="~VIRTIO_CONSOLE"
|
||||
linux-info_pkg_setup
|
||||
python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export AR LD OBJCOPY RANLIB
|
||||
|
||||
@ -70,7 +85,7 @@ src_install() {
|
||||
dobin build/qga/qemu-ga
|
||||
|
||||
# Normal init stuff
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r2" qemu-guest-agent
|
||||
newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
|
||||
|
||||
insinto /etc/logrotate.d
|
||||
|
@ -6,14 +6,14 @@ EAPI=8
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
PYTHON_REQ_USE="ensurepip(-),ncurses,readline"
|
||||
|
||||
inherit edo systemd toolchain-funcs python-any-r1 udev
|
||||
inherit edo linux-info python-any-r1 systemd toolchain-funcs udev
|
||||
|
||||
MY_PN="qemu"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
|
||||
DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
|
||||
HOMEPAGE="https://wiki.qemu.org/Features/GuestAgent"
|
||||
SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.xz"
|
||||
SRC_URI="https://download.qemu.org/${MY_P}.tar.xz"
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
LICENSE="GPL-2 BSD-2"
|
||||
@ -24,6 +24,9 @@ RDEPEND="dev-libs/glib"
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
$(python_gen_any_dep '
|
||||
dev-python/distlib[${PYTHON_USEDEP}]
|
||||
')
|
||||
dev-lang/perl
|
||||
app-alternatives/ninja
|
||||
"
|
||||
@ -32,6 +35,18 @@ PATCHES=(
|
||||
"${FILESDIR}"/qemu-8.1.0-find-sphinx.patch
|
||||
)
|
||||
|
||||
python_check_deps() {
|
||||
python_has_version "dev-python/distlib[${PYTHON_USEDEP}]"
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
# While qemu-ga supports multiple modes, virtio-serial is the
|
||||
# default. Make sure it's enabled in kernel.
|
||||
CONFIG_CHECK="~VIRTIO_CONSOLE"
|
||||
linux-info_pkg_setup
|
||||
python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export AR LD OBJCOPY RANLIB
|
||||
|
||||
@ -70,7 +85,7 @@ src_install() {
|
||||
dobin build/qga/qemu-ga
|
||||
|
||||
# Normal init stuff
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
|
||||
newinitd "${FILESDIR}/qemu-ga.init-r2" qemu-guest-agent
|
||||
newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
|
||||
|
||||
insinto /etc/logrotate.d
|
||||
|
Loading…
x
Reference in New Issue
Block a user