From 8b8e82850dc8818b97f8bafc3ccc7982142f1cea Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sat, 18 Apr 2020 14:28:23 -0500 Subject: app-emulation/qemu-guest-agent: fix shutdown command Closes: https://bugs.gentoo.org/681874 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Matthias Maier --- .../qemu-guest-agent-4.2.0-fix-shutdown.patch | 11 +++ .../qemu-guest-agent-4.2.0-r1.ebuild | 83 ++++++++++++++++++++++ .../qemu-guest-agent/qemu-guest-agent-4.2.0.ebuild | 82 --------------------- 3 files changed, 94 insertions(+), 82 deletions(-) create mode 100644 app-emulation/qemu-guest-agent/files/qemu-guest-agent-4.2.0-fix-shutdown.patch create mode 100644 app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0-r1.ebuild delete mode 100644 app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0.ebuild (limited to 'app-emulation') diff --git a/app-emulation/qemu-guest-agent/files/qemu-guest-agent-4.2.0-fix-shutdown.patch b/app-emulation/qemu-guest-agent/files/qemu-guest-agent-4.2.0-fix-shutdown.patch new file mode 100644 index 000000000000..f69781694f1d --- /dev/null +++ b/app-emulation/qemu-guest-agent/files/qemu-guest-agent-4.2.0-fix-shutdown.patch @@ -0,0 +1,11 @@ +--- qemu-4.2.0/qga/commands-posix.c.orig 2020-03-23 11:15:05.972610989 +0300 ++++ qemu-4.2.0/qga/commands-posix.c 2020-03-23 11:15:39.676015087 +0300 +@@ -108,7 +108,7 @@ + reopen_fd_to_null(1); + reopen_fd_to_null(2); + +- execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0", ++ execle("/sbin/shutdown", "shutdown", "-h", "now", shutdown_flag, "+0", + "hypervisor initiated shutdown", (char*)NULL, environ); + _exit(EXIT_FAILURE); + } else if (pid < 0) { diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0-r1.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0-r1.ebuild new file mode 100644 index 000000000000..c290b1251ca0 --- /dev/null +++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0-r1.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +PYTHON_COMPAT=( python3_6 ) + +inherit eutils systemd toolchain-funcs udev python-any-r1 + +MY_PN="qemu" +MY_P="${MY_PN}-${PV}" + +SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.xz" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" + +DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM" +HOMEPAGE="https://wiki.qemu.org/Features/GuestAgent" + +LICENSE="GPL-2 BSD-2" +SLOT="0" +IUSE="" + +RDEPEND="dev-libs/glib" + +DEPEND="${RDEPEND} + ${PYTHON_DEPS}" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}"/${PN}-4.2.0-sysmacros.patch #580924 + "${FILESDIR}"/${PN}-4.2.0-fix-shutdown.patch #681874 +) + +src_configure() { + tc-export AR LD OBJCOPY + + local myconf=( + --prefix=/usr + --sysconfdir=/etc + --libdir="/usr/$(get_libdir)" + --localstatedir=/ + --disable-bsd-user + --disable-linux-user + --disable-system + --disable-strip + --disable-tools + --disable-werror + --enable-guest-agent + --python="${PYTHON}" + --cc="$(tc-getCC)" + --cxx="$(tc-getCXX)" + --host-cc="$(tc-getBUILD_CC)" + ) + echo "./configure ${myconf[*]}" + ./configure "${myconf[@]}" || die +} + +src_compile() { + emake V=1 qemu-ga +} + +src_install() { + dobin qemu-ga + + # Normal init stuff + newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent + newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent + + insinto /etc/logrotate.d + newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent + + # systemd stuff + udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules + + systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \ + qemu-guest-agent.service +} + +pkg_postinst() { + elog "You should add 'qemu-guest-agent' to the default runlevel." + elog "e.g. rc-update add qemu-guest-agent default" +} diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0.ebuild deleted file mode 100644 index 27782cf6ca5a..000000000000 --- a/app-emulation/qemu-guest-agent/qemu-guest-agent-4.2.0.ebuild +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_6 ) - -inherit eutils systemd toolchain-funcs udev python-any-r1 - -MY_PN="qemu" -MY_P="${MY_PN}-${PV}" - -SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.xz" -KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" - -DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM" -HOMEPAGE="https://wiki.qemu.org/Features/GuestAgent" - -LICENSE="GPL-2 BSD-2" -SLOT="0" -IUSE="" - -RDEPEND="dev-libs/glib" - -DEPEND="${RDEPEND} - ${PYTHON_DEPS}" - -S="${WORKDIR}/${MY_P}" - -PATCHES=( - "${FILESDIR}"/${PN}-4.2.0-sysmacros.patch #580924 -) - -src_configure() { - tc-export AR LD OBJCOPY - - local myconf=( - --prefix=/usr - --sysconfdir=/etc - --libdir="/usr/$(get_libdir)" - --localstatedir=/ - --disable-bsd-user - --disable-linux-user - --disable-system - --disable-strip - --disable-tools - --disable-werror - --enable-guest-agent - --python="${PYTHON}" - --cc="$(tc-getCC)" - --cxx="$(tc-getCXX)" - --host-cc="$(tc-getBUILD_CC)" - ) - echo "./configure ${myconf[*]}" - ./configure "${myconf[@]}" || die -} - -src_compile() { - emake V=1 qemu-ga -} - -src_install() { - dobin qemu-ga - - # Normal init stuff - newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent - newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent - - insinto /etc/logrotate.d - newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent - - # systemd stuff - udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules - - systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \ - qemu-guest-agent.service -} - -pkg_postinst() { - elog "You should add 'qemu-guest-agent' to the default runlevel." - elog "e.g. rc-update add qemu-guest-agent default" -} -- cgit v1.2.3-65-gdbad