From patchwork Fri Jan 14 20:41:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: smooky X-Patchwork-Id: 4967 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4JbCrl4Mz6z3wjq for ; Fri, 14 Jan 2022 20:41:43 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4JbCrh5WqMz17d; Fri, 14 Jan 2022 20:41:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4JbCrh15Dkz2yf4; Fri, 14 Jan 2022 20:41:40 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4JbCrd6jsmz2xlJ for ; Fri, 14 Jan 2022 20:41:37 +0000 (UTC) Received: from malta2912.startdedicated.de (v16.de [85.93.91.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4JbCrc2Xlrz8j for ; Fri, 14 Jan 2022 20:41:36 +0000 (UTC) Received: from router.home.v16.de (ip1f10b1e3.dynamic.kabel-deutschland.de [31.16.177.227]) (Authenticated sender: smooky.v16) by malta2912.startdedicated.de (Postfix) with ESMTPA id 66C34EC1D85; Fri, 14 Jan 2022 21:41:35 +0100 (CET) From: smooky@v16.de To: development@lists.ipfire.org Subject: [PATCH] New Addons: qemu-ga 6.0.1 second try Date: Fri, 14 Jan 2022 21:41:32 +0100 Message-Id: <20220114204132.29347-1-smooky@v16.de> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=none (mail01.ipfire.org: domain of smooky@v16.de has no SPF policy when checking 85.93.91.151) smtp.mailfrom=smooky@v16.de; dmarc=none ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1642192896; a=rsa-sha256; cv=none; b=aGTeX3zJzTTDaPxEkDC5U4OWN27TX9xTiJ6DXjV5VMVbxGAcM7mrku/ZNuYqsYS5HVgsWd 04HPSwXOMSUxdgbgLmlcF7HdQbegqxEZDhe1rOMLBVSALQ7SEd7ZzhW9KTp/qhfZlpXlR9 xCBlkPPkVEQDmQYxbIIA8f6r5vRdQhY4nIgumBRtw92f4I+mDzFR7VB5KJ8xY7p+tfTGHe 1PumWHsCc4B4Pj+R/6sb7D3x+Kq9dUUz3tM5wskEdOsYcGXFJZJDBV6RzM46w7JusI4uK0 NywN61GyWsr0xT51SdFWzmseAmGurWYwNtcrJgmPZPH1yNsI6iM6v09dOyufMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1642192896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sC5tZix39PLg8I7vgVMQt5J9odDZP+34L7GH+CpRY8o=; b=h2SomLjiv5YYgjFWvqDN8n481DQE7Nvp4Gx1tFUHww+TF3x10VCy8I07oOkJ8lOuWT7kll JbbmhjPrQiWds4TWus2cdekeOIDZpdBN4uiJT8T3kp7C8cQJq+BvZgSeNBfeHp9GDLHjGn aKJBJiENW6AxNSf9ownirWgLAHF5KBt9LTK1+7XVJENiTv0Q4DzNWqWMqFC7pUJNaVA55N /4of5VBfRjYY8DsfXhsv2usVC0hORHq1WhRkZTCXklcpZ0uUf/qc9lMVnaLQpPgLh1mIeB w9vhsKsQB92YgB+hWFeecFS0ZLeB6GFVEF/ZITn8JicMmP0lkuXbio559pnvBw== X-Spamd-Result: default: False [-0.61 / 11.00]; BAYES_HAM(-3.00)[99.98%]; AUTH_NA(1.00)[]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; IP_REPUTATION_HAM(-0.01)[asn: 8972(0.00), country: DE(-0.01), ip: 85.93.91.151(0.00)]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8972, ipnet:85.93.91.0/24, country:DE]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_NO_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; DMARC_NA(0.00)[v16.de]; RECEIVED_SPAMHAUS_PBL(0.00)[31.16.177.227:received] Authentication-Results: mail01.ipfire.org; dkim=none; spf=none (mail01.ipfire.org: domain of smooky@v16.de has no SPF policy when checking 85.93.91.151) smtp.mailfrom=smooky@v16.de; dmarc=none X-Rspamd-Queue-Id: 4JbCrc2Xlrz8j X-Rspamd-Server: mail01.haj.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" >>> https://www.qemu.org/ <<< source = https://download.qemu.org/qemu-6.0.1.tar.xz Hi @ all I have the addon qemu-ga for people who virtualize IPFire and to read the status without having to install the whole qemu package. Modified following Michael's suggestions. Signed-off-by: Marcel Follert (Smooky) Reviewed-by: Michael Tremer --- config/rootfiles/packages/qemu-ga | 2 + lfs/qemu-ga | 103 ++++++++++++++++++++++++++++++ make.sh | 1 + src/initscripts/packages/qemu-ga | 38 +++++++++++ src/paks/qemu-ga/install.sh | 34 ++++++++++ src/paks/qemu-ga/uninstall.sh | 32 ++++++++++ src/paks/qemu-ga/update.sh | 27 ++++++++ 7 files changed, 237 insertions(+) create mode 100644 config/rootfiles/packages/qemu-ga create mode 100644 lfs/qemu-ga create mode 100755 src/initscripts/packages/qemu-ga create mode 100644 src/paks/qemu-ga/install.sh create mode 100644 src/paks/qemu-ga/uninstall.sh create mode 100644 src/paks/qemu-ga/update.sh diff --git a/config/rootfiles/packages/qemu-ga b/config/rootfiles/packages/qemu-ga new file mode 100644 index 000000000..78f368862 --- /dev/null +++ b/config/rootfiles/packages/qemu-ga @@ -0,0 +1,2 @@ +usr/bin/qemu-ga +etc/rc.d/init.d/qemu-ga diff --git a/lfs/qemu-ga b/lfs/qemu-ga new file mode 100644 index 000000000..791c5b4c1 --- /dev/null +++ b/lfs/qemu-ga @@ -0,0 +1,103 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2022 IPFire Team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 6.0.1 + +THISAPP = qemu-$(VER) +DL_FILE = $(THISAPP).tar.xz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +SUP_ARCH = x86_64 aarch64 +PROG = qemu-ga +PAK_VER = 1 + +DEPS = + +TARGETS = + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 10c651469e07844523995e2c980a4fdb + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --enable-kvm \ + --disable-attr \ + --extra-cflags="$(CFLAGS)" \ + --enable-spice \ + --enable-usb-redir \ + --enable-seccomp \ + --disable-docs \ + --disable-sdl + + cd $(DIR_APP) && make qemu-ga $(MAKETUNING) + cd $(DIR_APP) && cp build/qga/qemu-ga /usr/bin + + #install initscripts + $(call INSTALL_INITSCRIPT,qemu-ga) + + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index e6f948ba0..fe6dc123c 100755 --- a/make.sh +++ b/make.sh @@ -1615,6 +1615,7 @@ buildipfire() { lfsmake2 libcdada lfsmake2 pmacct lfsmake2 squid-asnbl + lfsmake2 qemu-ga } buildinstaller() { diff --git a/src/initscripts/packages/qemu-ga b/src/initscripts/packages/qemu-ga new file mode 100755 index 000000000..68863f86f --- /dev/null +++ b/src/initscripts/packages/qemu-ga @@ -0,0 +1,38 @@ +#!/bin/sh +# Begin $rc_base/init.d/qemu-guest-agent + + +. /etc/sysconfig/rc +. $rc_functions + +case "$1" in + start) + boot_mesg "Starting QEMU Guest Agent..." + /usr/bin/qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 -f /run/qemu-ga.pid -d + evaluate_retval + ;; + + stop) + boot_mesg "Stopping QEMU Guest Agent..." + killproc /usr/bin/qemu-ga + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + + status) + statusproc /usr/bin/qemu-ga + ;; + + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + + +# End $rc_base/init.d/qemu-guest-agent diff --git a/src/paks/qemu-ga/install.sh b/src/paks/qemu-ga/install.sh new file mode 100644 index 000000000..6980820ba --- /dev/null +++ b/src/paks/qemu-ga/install.sh @@ -0,0 +1,34 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2022 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} + +# add symlinks for qemu-ga + +ln -s /etc/rc.d/init.d/qemu-ga /etc/rc.d/rc0.d/K00qemu-ga +ln -s /etc/rc.d/init.d/qemu-ga /etc/rc.d/rc3.d/S99qemu-ga +ln -s /etc/rc.d/init.d/qemu-ga /etc/rc.d/rc6.d/K00qemu-ga + +start_service --background ${NAME} diff --git a/src/paks/qemu-ga/uninstall.sh b/src/paks/qemu-ga/uninstall.sh new file mode 100644 index 000000000..cc1115b99 --- /dev/null +++ b/src/paks/qemu-ga/uninstall.sh @@ -0,0 +1,32 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2022 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +stop_service ${NAME} +make_backup ${NAME} + +# remove symlinks + +rm -f /etc/rc.d/rc0.d/K00qemu-ga /etc/rc.d/rc3.d/S99qemu-ga /etc/rc.d/rc6.d/K00qemu-ga + +remove_files diff --git a/src/paks/qemu-ga/update.sh b/src/paks/qemu-ga/update.sh new file mode 100644 index 000000000..ea2505f2a --- /dev/null +++ b/src/paks/qemu-ga/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2022 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh +./install.sh