From patchwork Fri Jan 14 10:42:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: smooky X-Patchwork-Id: 4963 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 4JZyYP1nKtz3wjq for ; Fri, 14 Jan 2022 10:42:33 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4JZyYM3WqNz17d; Fri, 14 Jan 2022 10:42:31 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4JZyYM2Bgnz2ygN; Fri, 14 Jan 2022 10:42:31 +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 4JZyYL3Q99z2xlJ for ; Fri, 14 Jan 2022 10:42:30 +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 4JZyYK2b7VzNw for ; Fri, 14 Jan 2022 10:42:29 +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 A4C5FEC1FFD; Fri, 14 Jan 2022 11:42:27 +0100 (CET) From: smooky@v16.de To: development@lists.ipfire.org Subject: [PATCH] New Addon: qemu-ga 6.0.1 Date: Fri, 14 Jan 2022 11:42:25 +0100 Message-Id: <20220114104225.26164-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=1642156949; a=rsa-sha256; cv=none; b=jAVLO+AMXcyrYM6ol/lDUq5ncoLcCHos5cFHyUokbOYtsNxMvtCnZqiln7zJnEqQCH+mEa KKJzWboV17igOF7RbPkhefITL9aP5zmxU2uCvbBvi7rjCYY25ruC0mDrfovBDxxtpOXL0m jWFxDkXDgt1HPGHNvDFOYUIz/m4GKQT9MvKyvwi56culzy5jPb8k6ao3IeUus3TaIdl3Cj LB3X0QRtJoCmHSp4V8bpLIMeNA5ITB3Epvbbmx9e9LyQEbBLbEj/BJVXtrxxhZzJsrPYtx syhrCHWkf5YoFExzTDFQhEjPQDw5YQuABwmVrYuIeoPVOzoHXpRMX20/Ro6lrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1642156949; 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=sMQabAk+ynLtzR35CP6JcsbZuRTlK01aWlBXHGFVRFo=; b=R7KQBJUdG1ZbBQq5P+xoO/zDE8kVLoUBIDv1pk/7+g0i/pvgjbE8O+z58voNZa/4VrkNYw I2Jf06TRDpTpcWujo3niQQyUouVMZEya7s3ABdGXpLOyo+y8xjgVEyuh+1alSQRUwIL+i/ DZ4JDYsIPAp1Lp4n3Th7BKu9HEjKn2eSaNk7vxWsaopo0/2t0FF40TVbdjmlxEbWjx05uk JEw1qnMkeK5R1rUmd6vPhdNO5fRsH28WY3xOYLI0hAF7Y5mMQLcfuZIkLNdmQSdku+Gt2D kbbRZR595WAhVwn60ZZTRNYrjkloUCtQhU4Mq8EtNdJE3aBTKwsJf1E2Q218Bw== X-Spamd-Result: default: False [-0.61 / 11.00]; BAYES_HAM(-3.00)[99.99%]; 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: 4JZyYK2b7VzNw 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. Signed-off-by: Marcel Follert (Smooky) --- config/qemu-ga/qemu-ga.init | 38 ++++++++++ config/rootfiles/packages/qemu-ga | 2 + lfs/qemu-ga | 114 ++++++++++++++++++++++++++++++ make.sh | 1 + src/paks/qemu-ga/install.sh | 34 +++++++++ src/paks/qemu-ga/uninstall.sh | 32 +++++++++ src/paks/qemu-ga/update.sh | 27 +++++++ 7 files changed, 248 insertions(+) create mode 100755 config/qemu-ga/qemu-ga.init create mode 100644 config/rootfiles/packages/qemu-ga create mode 100644 lfs/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/qemu-ga/qemu-ga.init b/config/qemu-ga/qemu-ga.init new file mode 100755 index 000000000..c87ce86e8 --- /dev/null +++ b/config/qemu-ga/qemu-ga.init @@ -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/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..71bf61cbe --- /dev/null +++ b/lfs/qemu-ga @@ -0,0 +1,114 @@ +############################################################################### +# # +# 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 = i586 x86_64 +PROG = qemu-ga +PAK_VER = 1 + +DEPS = + +TARGETS = \ + i386-linux-user \ + x86_64-linux-user \ + arm-linux-user \ + riscv64-linux-user \ + i386-softmmu \ + x86_64-softmmu \ + arm-softmmu \ + riscv64-softmmu + +############################################################################### +# 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 \ + --target-list="$(TARGETS)" \ + --extra-cflags="$(CFLAGS)" \ + --enable-spice \ + --enable-usb-redir \ + --enable-seccomp \ + --disable-docs \ + --disable-sdl + + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && cp build/qga/qemu-ga /usr/bin + +# Install init file for 'qemu-ga' + install -v -m 755 $(DIR_SRC)/config/qemu-ga/qemu-ga.init \ + /etc/rc.d/init.d/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/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