mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] rules/qemu: Add new package.
@ 2021-07-16 12:44 Christian Melki
  2021-07-16 13:04 ` Alexander Dahl
  2021-08-06  7:00 ` Michael Olbrich
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Melki @ 2021-07-16 12:44 UTC (permalink / raw)
  To: ptxdist

Work-in-progress. Add target-qemu package.
Usecases are among others:
Higher isolation (security) and target emulation (software longevity).

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/qemu.in   |  51 +++++++++
 rules/qemu.make | 274 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 325 insertions(+)
 create mode 100644 rules/qemu.in
 create mode 100644 rules/qemu.make

diff --git a/rules/qemu.in b/rules/qemu.in
new file mode 100644
index 000000000..d627f7a79
--- /dev/null
+++ b/rules/qemu.in
@@ -0,0 +1,51 @@
+## SECTION=emulators
+
+menuconfig QEMU
+	tristate
+	prompt "qemu                          "
+	select HOST_MESON
+	select HOST_NINJA
+	select HOST_SYSTEM_PYTHON3
+	select GLIB
+	select LIBCAP_NG
+	select ZLIB
+	select LIBUSB	if QEMU_SYS
+	select PIXMAN	if QEMU_SYS
+	help
+	  QEMU is a generic and open source machine emulator and
+	  virtualizer.  
+
+if QEMU
+
+config QEMU_TARGETS
+        string
+	prompt "QEMU targets"
+	default "i386 x86_64 arm aarch64"
+	help
+	  The list of QEMU user and system targets you want to build.
+	  Only use the prefixes.
+
+config QEMU_FDT
+       bool
+       prompt "Enable Device Tree generation."
+       default y
+       help
+         Say y to let QEMU construct FDTs and pass them
+	 to the VMs.
+
+config QEMU_TOOLS
+	bool
+	prompt "Enable tools"
+	default y
+	help
+	  Say y here to include tools.
+
+config QEMU_SYS
+	bool
+	prompt "system emulation"
+
+config QEMU_USR
+	bool
+	prompt "user-space emulation"
+
+endif
diff --git a/rules/qemu.make b/rules/qemu.make
new file mode 100644
index 000000000..0a276fbf6
--- /dev/null
+++ b/rules/qemu.make
@@ -0,0 +1,274 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_QEMU) += qemu
+
+#
+# Paths and names
+#
+QEMU_VERSION    := 6.0.0
+QEMU_MD5        := cce185dc0119546e395909e8a71a75bb
+QEMU		:= qemu-$(QEMU_VERSION)
+QEMU_SUFFIX	:= tar.xz
+QEMU_URL	:= https://download.qemu.org/$(QEMU).$(QEMU_SUFFIX)
+QEMU_SOURCE	:= $(SRCDIR)/$(QEMU).$(QEMU_SUFFIX)
+QEMU_DIR	:= $(BUILDDIR)/$(QEMU)
+QEMU_LICENSE	:= GPL-2.0-only AND GPL-2.0-or-later AND MIT AND BSD-1-Clause AND BSD-2-Clause AND BSD-3-Clause
+QEMU_BUILD_OOT	:= YES
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_ARCH_X86
+QEMU_ARCH       := i386
+ifdef PTXCONF_ARCH_X86_64
+QEMU_ARCH       := x86_64
+endif
+endif
+ifdef PTXCONF_ARCH_ARM
+QEMU_ARCH       := arm
+endif
+ifdef PTXCONF_ARCH_ARM64
+QEMU_ARCH       := aarch64
+endif
+
+#
+# autoconf
+#
+
+QEMU_MAKE_OPT	:= V=$(filter 1,$(PTXDIST_VERBOSE))
+
+QEMU_SYS_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-softmmu,$(target)))
+QEMU_USR_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-linux-user,$(target)))
+
+QEMU_PATH     := PATH=$(CROSS_PATH)
+
+QEMU_CONF_TOOL	:= autoconf
+# Note: not realy autoconf:
+# e.g. there is --enable-debug but not --disable-debug
+QEMU_CONF_OPT	:= \
+	--prefix=/usr \
+	--target-list=" \
+		$(call ptx/ifdef, PTXCONF_QEMU_SYS,$(QEMU_SYS_TARGETS),) \
+		$(call ptx/ifdef, PTXCONF_QEMU_USR,$(QEMU_USR_TARGETS),) \
+	" \
+	--meson=meson \
+	--ninja=ninja \
+	--cross-prefix=$(CROSS_COMPILE) \
+	--disable-sanitizers \
+	--disable-tsan \
+	--disable-strip \
+	--disable-werror \
+	--enable-stack-protector \
+	--audio-drv-list= \
+	--block-drv-rw-whitelist= \
+	--block-drv-ro-whitelist= \
+	--enable-trace-backends=nop \
+	--disable-tcg-interpreter \
+	--enable-malloc-trim \
+	--with-coroutine= \
+	--tls-priority=NORMAL \
+	--disable-plugins \
+	--disable-containers \
+	--$(call ptx/endis, PTXCONF_QEMU_SYS)-system \
+	--disable-user \
+	--$(call ptx/endis, PTXCONF_QEMU_USR)-linux-user \
+	--disable-bsd-user \
+	--disable-docs \
+	--disable-guest-agent \
+	--disable-guest-agent-msi \
+	--enable-pie \
+	--disable-modules \
+	--disable-module-upgrades \
+	--disable-debug-tcg \
+	--disable-debug-info \
+	--disable-lto \
+	--disable-sparse \
+	--disable-safe-stack \
+	--disable-cfi \
+	--disable-gnutls \
+	--disable-nettle \
+	--disable-gcrypt \
+	--disable-auth-pam \
+	--disable-sdl \
+	--disable-sdl-image \
+	--disable-gtk \
+	--disable-vte \
+	--disable-curses \
+	--enable-iconv \
+	--disable-vnc \
+	--disable-vnc-sasl \
+	--disable-vnc-jpeg \
+	--disable-vnc-png \
+	--disable-cocoa \
+	--enable-virtfs \
+	--disable-virtiofsd \
+	--disable-libudev \
+	--disable-mpath \
+	--disable-xen \
+	--disable-xen-pci-passthrough \
+	--disable-brlapi \
+	--disable-curl \
+	--enable-membarrier \
+	--$(call ptx/endis, PTXCONF_QEMU_FDT)-fdt \
+	--enable-kvm \
+	--disable-hax \
+	--disable-hvf \
+	--disable-whpx \
+	--disable-rdma \
+	--disable-pvrdma \
+	--disable-netmap \
+	--disable-linux-aio \
+	--disable-linux-io-uring \
+	--enable-cap-ng \
+	--enable-attr \
+	--enable-vhost-net \
+	--enable-vhost-vsock \
+	--enable-vhost-scsi \
+	--disable-vhost-crypto \
+	--enable-vhost-kernel \
+	--disable-vhost-user \
+	--disable-vhost-user-blk-server \
+	--disable-vhost-vdpa \
+	--disable-spice \
+	--disable-rbd \
+	--disable-libiscsi \
+	--disable-libnfs \
+	--disable-smartcard \
+	--disable-u2f \
+	--$(call ptx/endis, PTXCONF_QEMU_SYS)-libusb \
+	--disable-live-block-migration \
+	--disable-usb-redir \
+	--disable-lzo \
+	--disable-snappy \
+	--disable-bzip2 \
+	--disable-lzfse \
+	--disable-zstd \
+	--disable-seccomp \
+	--enable-coroutine-pool \
+	--disable-glusterfs \
+	--disable-tpm \
+	--disable-libssh \
+	--disable-numa \
+	--disable-libxml2 \
+	--disable-tcmalloc \
+	--disable-jemalloc \
+	--enable-replication \
+	--disable-opengl \
+	--disable-virglrenderer \
+	--disable-xfsctl \
+	--disable-qom-cast-debug \
+	--$(call ptx/endis, PTXCONF_QEMU_TOOLS)-tools \
+	--disable-bochs \
+	--disable-cloop \
+	--disable-dmg \
+	--disable-qcow1 \
+	--disable-vdi \
+	--disable-vvfat \
+	--disable-qed \
+	--disable-parallels \
+	--disable-sheepdog \
+	--disable-crypto-afalg \
+	--disable-capstone \
+	--disable-debug-mutex \
+	--disable-libpmem \
+	--disable-xkbcommon \
+	--disable-rng-none \
+	--disable-libdaxctl \
+	--disable-fuse \
+	--enable-multiprocess \
+	--disable-gio \
+	\
+	--disable-fuzzing \
+	--disable-keyring
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/qemu.install:
+	@$(call targetinfo)
+	@$(call world/install, QEMU)
+ifdef PTXCONF_QEMU_SYS
+#	# necessary for qemu to find its ROM files
+	@ln -vsf usr/share/qemu $(QEMU_PKGDIR)/pc-bios
+endif
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/qemu.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, qemu)
+	@$(call install_fixup, qemu,PRIORITY,optional)
+	@$(call install_fixup, qemu,SECTION,base)
+	@$(call install_fixup, qemu,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, qemu,DESCRIPTION,missing)
+
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-edid)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-img)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-io)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-pr-helper)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-storage-daemon)
+ifdef PTXCONF_QEMU_SYS
+	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \
+		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
+endif
+ifdef PTXCONF_QEMU_USER
+	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \
+		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
+endif
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/qemu-bridge-helper)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/virtfs-proxy-helper)
+
+	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-256k.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-microvm.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-aarch64-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-vars.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-secure-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-vars.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-secure-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000e.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-eepro100.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-virtio.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-e1000.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-eepro100.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-virtio.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pvh.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/kvmvapic.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-ati.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-cirrus.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-stdvga.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-virtio.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-vmware.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios.bin)
+
+	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/firmware)
+	@$(call install_glob, qemu, 0, 0, -, /usr/share/qemu/firmware,, *.json)
+
+	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/keymaps)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/share/qemu/keymaps/en-us)
+
+	@$(call install_finish, qemu)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] rules/qemu: Add new package.
  2021-07-16 12:44 [ptxdist] [PATCH] rules/qemu: Add new package Christian Melki
@ 2021-07-16 13:04 ` Alexander Dahl
  2021-08-06  7:00 ` Michael Olbrich
  1 sibling, 0 replies; 4+ messages in thread
From: Alexander Dahl @ 2021-07-16 13:04 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 12525 bytes --]

Hello Christian,

On Fri, Jul 16, 2021 at 02:44:23PM +0200, Christian Melki wrote:
> Work-in-progress. Add target-qemu package.

You can prefix the subject with "WIP:" or use `git format-patch --rfc`
to clearly show the intention, if something is not yet ready for
merging. ;-)

Greets
Alex

> Usecases are among others:
> Higher isolation (security) and target emulation (software longevity).
> 
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>  rules/qemu.in   |  51 +++++++++
>  rules/qemu.make | 274 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 325 insertions(+)
>  create mode 100644 rules/qemu.in
>  create mode 100644 rules/qemu.make
> 
> diff --git a/rules/qemu.in b/rules/qemu.in
> new file mode 100644
> index 000000000..d627f7a79
> --- /dev/null
> +++ b/rules/qemu.in
> @@ -0,0 +1,51 @@
> +## SECTION=emulators
> +
> +menuconfig QEMU
> +	tristate
> +	prompt "qemu                          "
> +	select HOST_MESON
> +	select HOST_NINJA
> +	select HOST_SYSTEM_PYTHON3
> +	select GLIB
> +	select LIBCAP_NG
> +	select ZLIB
> +	select LIBUSB	if QEMU_SYS
> +	select PIXMAN	if QEMU_SYS
> +	help
> +	  QEMU is a generic and open source machine emulator and
> +	  virtualizer.  
> +
> +if QEMU
> +
> +config QEMU_TARGETS
> +        string
> +	prompt "QEMU targets"
> +	default "i386 x86_64 arm aarch64"
> +	help
> +	  The list of QEMU user and system targets you want to build.
> +	  Only use the prefixes.
> +
> +config QEMU_FDT
> +       bool
> +       prompt "Enable Device Tree generation."
> +       default y
> +       help
> +         Say y to let QEMU construct FDTs and pass them
> +	 to the VMs.
> +
> +config QEMU_TOOLS
> +	bool
> +	prompt "Enable tools"
> +	default y
> +	help
> +	  Say y here to include tools.
> +
> +config QEMU_SYS
> +	bool
> +	prompt "system emulation"
> +
> +config QEMU_USR
> +	bool
> +	prompt "user-space emulation"
> +
> +endif
> diff --git a/rules/qemu.make b/rules/qemu.make
> new file mode 100644
> index 000000000..0a276fbf6
> --- /dev/null
> +++ b/rules/qemu.make
> @@ -0,0 +1,274 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_QEMU) += qemu
> +
> +#
> +# Paths and names
> +#
> +QEMU_VERSION    := 6.0.0
> +QEMU_MD5        := cce185dc0119546e395909e8a71a75bb
> +QEMU		:= qemu-$(QEMU_VERSION)
> +QEMU_SUFFIX	:= tar.xz
> +QEMU_URL	:= https://download.qemu.org/$(QEMU).$(QEMU_SUFFIX)
> +QEMU_SOURCE	:= $(SRCDIR)/$(QEMU).$(QEMU_SUFFIX)
> +QEMU_DIR	:= $(BUILDDIR)/$(QEMU)
> +QEMU_LICENSE	:= GPL-2.0-only AND GPL-2.0-or-later AND MIT AND BSD-1-Clause AND BSD-2-Clause AND BSD-3-Clause
> +QEMU_BUILD_OOT	:= YES
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +ifdef PTXCONF_ARCH_X86
> +QEMU_ARCH       := i386
> +ifdef PTXCONF_ARCH_X86_64
> +QEMU_ARCH       := x86_64
> +endif
> +endif
> +ifdef PTXCONF_ARCH_ARM
> +QEMU_ARCH       := arm
> +endif
> +ifdef PTXCONF_ARCH_ARM64
> +QEMU_ARCH       := aarch64
> +endif
> +
> +#
> +# autoconf
> +#
> +
> +QEMU_MAKE_OPT	:= V=$(filter 1,$(PTXDIST_VERBOSE))
> +
> +QEMU_SYS_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-softmmu,$(target)))
> +QEMU_USR_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-linux-user,$(target)))
> +
> +QEMU_PATH     := PATH=$(CROSS_PATH)
> +
> +QEMU_CONF_TOOL	:= autoconf
> +# Note: not realy autoconf:
> +# e.g. there is --enable-debug but not --disable-debug
> +QEMU_CONF_OPT	:= \
> +	--prefix=/usr \
> +	--target-list=" \
> +		$(call ptx/ifdef, PTXCONF_QEMU_SYS,$(QEMU_SYS_TARGETS),) \
> +		$(call ptx/ifdef, PTXCONF_QEMU_USR,$(QEMU_USR_TARGETS),) \
> +	" \
> +	--meson=meson \
> +	--ninja=ninja \
> +	--cross-prefix=$(CROSS_COMPILE) \
> +	--disable-sanitizers \
> +	--disable-tsan \
> +	--disable-strip \
> +	--disable-werror \
> +	--enable-stack-protector \
> +	--audio-drv-list= \
> +	--block-drv-rw-whitelist= \
> +	--block-drv-ro-whitelist= \
> +	--enable-trace-backends=nop \
> +	--disable-tcg-interpreter \
> +	--enable-malloc-trim \
> +	--with-coroutine= \
> +	--tls-priority=NORMAL \
> +	--disable-plugins \
> +	--disable-containers \
> +	--$(call ptx/endis, PTXCONF_QEMU_SYS)-system \
> +	--disable-user \
> +	--$(call ptx/endis, PTXCONF_QEMU_USR)-linux-user \
> +	--disable-bsd-user \
> +	--disable-docs \
> +	--disable-guest-agent \
> +	--disable-guest-agent-msi \
> +	--enable-pie \
> +	--disable-modules \
> +	--disable-module-upgrades \
> +	--disable-debug-tcg \
> +	--disable-debug-info \
> +	--disable-lto \
> +	--disable-sparse \
> +	--disable-safe-stack \
> +	--disable-cfi \
> +	--disable-gnutls \
> +	--disable-nettle \
> +	--disable-gcrypt \
> +	--disable-auth-pam \
> +	--disable-sdl \
> +	--disable-sdl-image \
> +	--disable-gtk \
> +	--disable-vte \
> +	--disable-curses \
> +	--enable-iconv \
> +	--disable-vnc \
> +	--disable-vnc-sasl \
> +	--disable-vnc-jpeg \
> +	--disable-vnc-png \
> +	--disable-cocoa \
> +	--enable-virtfs \
> +	--disable-virtiofsd \
> +	--disable-libudev \
> +	--disable-mpath \
> +	--disable-xen \
> +	--disable-xen-pci-passthrough \
> +	--disable-brlapi \
> +	--disable-curl \
> +	--enable-membarrier \
> +	--$(call ptx/endis, PTXCONF_QEMU_FDT)-fdt \
> +	--enable-kvm \
> +	--disable-hax \
> +	--disable-hvf \
> +	--disable-whpx \
> +	--disable-rdma \
> +	--disable-pvrdma \
> +	--disable-netmap \
> +	--disable-linux-aio \
> +	--disable-linux-io-uring \
> +	--enable-cap-ng \
> +	--enable-attr \
> +	--enable-vhost-net \
> +	--enable-vhost-vsock \
> +	--enable-vhost-scsi \
> +	--disable-vhost-crypto \
> +	--enable-vhost-kernel \
> +	--disable-vhost-user \
> +	--disable-vhost-user-blk-server \
> +	--disable-vhost-vdpa \
> +	--disable-spice \
> +	--disable-rbd \
> +	--disable-libiscsi \
> +	--disable-libnfs \
> +	--disable-smartcard \
> +	--disable-u2f \
> +	--$(call ptx/endis, PTXCONF_QEMU_SYS)-libusb \
> +	--disable-live-block-migration \
> +	--disable-usb-redir \
> +	--disable-lzo \
> +	--disable-snappy \
> +	--disable-bzip2 \
> +	--disable-lzfse \
> +	--disable-zstd \
> +	--disable-seccomp \
> +	--enable-coroutine-pool \
> +	--disable-glusterfs \
> +	--disable-tpm \
> +	--disable-libssh \
> +	--disable-numa \
> +	--disable-libxml2 \
> +	--disable-tcmalloc \
> +	--disable-jemalloc \
> +	--enable-replication \
> +	--disable-opengl \
> +	--disable-virglrenderer \
> +	--disable-xfsctl \
> +	--disable-qom-cast-debug \
> +	--$(call ptx/endis, PTXCONF_QEMU_TOOLS)-tools \
> +	--disable-bochs \
> +	--disable-cloop \
> +	--disable-dmg \
> +	--disable-qcow1 \
> +	--disable-vdi \
> +	--disable-vvfat \
> +	--disable-qed \
> +	--disable-parallels \
> +	--disable-sheepdog \
> +	--disable-crypto-afalg \
> +	--disable-capstone \
> +	--disable-debug-mutex \
> +	--disable-libpmem \
> +	--disable-xkbcommon \
> +	--disable-rng-none \
> +	--disable-libdaxctl \
> +	--disable-fuse \
> +	--enable-multiprocess \
> +	--disable-gio \
> +	\
> +	--disable-fuzzing \
> +	--disable-keyring
> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/qemu.install:
> +	@$(call targetinfo)
> +	@$(call world/install, QEMU)
> +ifdef PTXCONF_QEMU_SYS
> +#	# necessary for qemu to find its ROM files
> +	@ln -vsf usr/share/qemu $(QEMU_PKGDIR)/pc-bios
> +endif
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/qemu.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, qemu)
> +	@$(call install_fixup, qemu,PRIORITY,optional)
> +	@$(call install_fixup, qemu,SECTION,base)
> +	@$(call install_fixup, qemu,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
> +	@$(call install_fixup, qemu,DESCRIPTION,missing)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-edid)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-img)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-io)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-pr-helper)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-storage-daemon)
> +ifdef PTXCONF_QEMU_SYS
> +	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \
> +		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
> +endif
> +ifdef PTXCONF_QEMU_USER
> +	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \
> +		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
> +endif
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/qemu-bridge-helper)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/virtfs-proxy-helper)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-256k.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-microvm.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-aarch64-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-vars.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-secure-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-vars.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-secure-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000e.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-eepro100.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-virtio.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-e1000.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-eepro100.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-virtio.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pvh.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/kvmvapic.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-ati.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-cirrus.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-stdvga.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-virtio.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-vmware.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios.bin)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/firmware)
> +	@$(call install_glob, qemu, 0, 0, -, /usr/share/qemu/firmware,, *.json)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/keymaps)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/share/qemu/keymaps/en-us)
> +
> +	@$(call install_finish, qemu)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.32.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN     | speech censured, the first thought forbidden, the
 X  AGAINST      | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 181 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] rules/qemu: Add new package.
  2021-07-16 12:44 [ptxdist] [PATCH] rules/qemu: Add new package Christian Melki
  2021-07-16 13:04 ` Alexander Dahl
@ 2021-08-06  7:00 ` Michael Olbrich
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2021-08-06  7:00 UTC (permalink / raw)
  To: Christian Melki; +Cc: ptxdist

On Fri, Jul 16, 2021 at 02:44:23PM +0200, Christian Melki wrote:
> Work-in-progress. Add target-qemu package.
> Usecases are among others:
> Higher isolation (security) and target emulation (software longevity).
> 
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>  rules/qemu.in   |  51 +++++++++
>  rules/qemu.make | 274 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 325 insertions(+)
>  create mode 100644 rules/qemu.in
>  create mode 100644 rules/qemu.make
> 
> diff --git a/rules/qemu.in b/rules/qemu.in
> new file mode 100644
> index 000000000..d627f7a79
> --- /dev/null
> +++ b/rules/qemu.in
> @@ -0,0 +1,51 @@
> +## SECTION=emulators
> +
> +menuconfig QEMU
> +	tristate
> +	prompt "qemu                          "
> +	select HOST_MESON
> +	select HOST_NINJA
> +	select HOST_SYSTEM_PYTHON3
> +	select GLIB
> +	select LIBCAP_NG
> +	select ZLIB
> +	select LIBUSB	if QEMU_SYS
> +	select PIXMAN	if QEMU_SYS
> +	help
> +	  QEMU is a generic and open source machine emulator and
> +	  virtualizer.  

Remove trailing whitespaces

> +
> +if QEMU
> +
> +config QEMU_TARGETS
> +        string

intent with tab.

> +	prompt "QEMU targets"
> +	default "i386 x86_64 arm aarch64"
> +	help
> +	  The list of QEMU user and system targets you want to build.
> +	  Only use the prefixes.
> +
> +config QEMU_FDT
> +       bool
> +       prompt "Enable Device Tree generation."
> +       default y
> +       help
> +         Say y to let QEMU construct FDTs and pass them

indention

> +	 to the VMs.

Why make this optional? I don't think the overhead is that big, so maybe
just enable it unconditionally.

> +
> +config QEMU_TOOLS
> +	bool
> +	prompt "Enable tools"
> +	default y
> +	help
> +	  Say y here to include tools.

Hmmm, this is used for configure, but not in the targetinstall stage. That
looks suspicious.

> +
> +config QEMU_SYS
> +	bool
> +	prompt "system emulation"
> +
> +config QEMU_USR
> +	bool
> +	prompt "user-space emulation"
> +
> +endif
> diff --git a/rules/qemu.make b/rules/qemu.make
> new file mode 100644
> index 000000000..0a276fbf6
> --- /dev/null
> +++ b/rules/qemu.make
> @@ -0,0 +1,274 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_QEMU) += qemu
> +
> +#
> +# Paths and names
> +#
> +QEMU_VERSION    := 6.0.0
> +QEMU_MD5        := cce185dc0119546e395909e8a71a75bb
> +QEMU		:= qemu-$(QEMU_VERSION)
> +QEMU_SUFFIX	:= tar.xz
> +QEMU_URL	:= https://download.qemu.org/$(QEMU).$(QEMU_SUFFIX)
> +QEMU_SOURCE	:= $(SRCDIR)/$(QEMU).$(QEMU_SUFFIX)
> +QEMU_DIR	:= $(BUILDDIR)/$(QEMU)
> +QEMU_LICENSE	:= GPL-2.0-only AND GPL-2.0-or-later AND MIT AND BSD-1-Clause AND BSD-2-Clause AND BSD-3-Clause
> +QEMU_BUILD_OOT	:= YES

Please remove the corresponding lines in host-qemu.in. It will then default
to this here.

> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +ifdef PTXCONF_ARCH_X86
> +QEMU_ARCH       := i386
> +ifdef PTXCONF_ARCH_X86_64
> +QEMU_ARCH       := x86_64
> +endif
> +endif
> +ifdef PTXCONF_ARCH_ARM
> +QEMU_ARCH       := arm
> +endif
> +ifdef PTXCONF_ARCH_ARM64
> +QEMU_ARCH       := aarch64
> +endif

Unused?

> +
> +#
> +# autoconf
> +#
> +
> +QEMU_MAKE_OPT	:= V=$(filter 1,$(PTXDIST_VERBOSE))
> +
> +QEMU_SYS_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-softmmu,$(target)))
> +QEMU_USR_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-linux-user,$(target)))
> +
> +QEMU_PATH     := PATH=$(CROSS_PATH)
> +
> +QEMU_CONF_TOOL	:= autoconf
> +# Note: not realy autoconf:
> +# e.g. there is --enable-debug but not --disable-debug
> +QEMU_CONF_OPT	:= \
> +	--prefix=/usr \
> +	--target-list=" \
> +		$(call ptx/ifdef, PTXCONF_QEMU_SYS,$(QEMU_SYS_TARGETS),) \
> +		$(call ptx/ifdef, PTXCONF_QEMU_USR,$(QEMU_USR_TARGETS),) \
> +	" \
> +	--meson=meson \
> +	--ninja=ninja \
> +	--cross-prefix=$(CROSS_COMPILE) \
> +	--disable-sanitizers \
> +	--disable-tsan \
> +	--disable-strip \
> +	--disable-werror \
> +	--enable-stack-protector \
> +	--audio-drv-list= \
> +	--block-drv-rw-whitelist= \
> +	--block-drv-ro-whitelist= \
> +	--enable-trace-backends=nop \
> +	--disable-tcg-interpreter \
> +	--enable-malloc-trim \
> +	--with-coroutine= \
> +	--tls-priority=NORMAL \
> +	--disable-plugins \
> +	--disable-containers \
> +	--$(call ptx/endis, PTXCONF_QEMU_SYS)-system \
> +	--disable-user \
> +	--$(call ptx/endis, PTXCONF_QEMU_USR)-linux-user \
> +	--disable-bsd-user \
> +	--disable-docs \
> +	--disable-guest-agent \
> +	--disable-guest-agent-msi \
> +	--enable-pie \
> +	--disable-modules \
> +	--disable-module-upgrades \
> +	--disable-debug-tcg \
> +	--disable-debug-info \
> +	--disable-lto \
> +	--disable-sparse \
> +	--disable-safe-stack \
> +	--disable-cfi \
> +	--disable-gnutls \
> +	--disable-nettle \
> +	--disable-gcrypt \
> +	--disable-auth-pam \
> +	--disable-sdl \
> +	--disable-sdl-image \
> +	--disable-gtk \
> +	--disable-vte \
> +	--disable-curses \
> +	--enable-iconv \
> +	--disable-vnc \
> +	--disable-vnc-sasl \
> +	--disable-vnc-jpeg \
> +	--disable-vnc-png \
> +	--disable-cocoa \
> +	--enable-virtfs \

Check with the latest changes of host-qemu. This breaks without
qemu-system.

> +	--disable-virtiofsd \
> +	--disable-libudev \
> +	--disable-mpath \
> +	--disable-xen \
> +	--disable-xen-pci-passthrough \
> +	--disable-brlapi \
> +	--disable-curl \
> +	--enable-membarrier \
> +	--$(call ptx/endis, PTXCONF_QEMU_FDT)-fdt \
> +	--enable-kvm \
> +	--disable-hax \
> +	--disable-hvf \
> +	--disable-whpx \
> +	--disable-rdma \
> +	--disable-pvrdma \
> +	--disable-netmap \
> +	--disable-linux-aio \
> +	--disable-linux-io-uring \
> +	--enable-cap-ng \
> +	--enable-attr \
> +	--enable-vhost-net \
> +	--enable-vhost-vsock \
> +	--enable-vhost-scsi \
> +	--disable-vhost-crypto \
> +	--enable-vhost-kernel \
> +	--disable-vhost-user \
> +	--disable-vhost-user-blk-server \
> +	--disable-vhost-vdpa \
> +	--disable-spice \
> +	--disable-rbd \
> +	--disable-libiscsi \
> +	--disable-libnfs \
> +	--disable-smartcard \
> +	--disable-u2f \
> +	--$(call ptx/endis, PTXCONF_QEMU_SYS)-libusb \
> +	--disable-live-block-migration \
> +	--disable-usb-redir \
> +	--disable-lzo \
> +	--disable-snappy \
> +	--disable-bzip2 \
> +	--disable-lzfse \
> +	--disable-zstd \
> +	--disable-seccomp \
> +	--enable-coroutine-pool \
> +	--disable-glusterfs \
> +	--disable-tpm \
> +	--disable-libssh \
> +	--disable-numa \
> +	--disable-libxml2 \
> +	--disable-tcmalloc \
> +	--disable-jemalloc \
> +	--enable-replication \
> +	--disable-opengl \
> +	--disable-virglrenderer \
> +	--disable-xfsctl \
> +	--disable-qom-cast-debug \
> +	--$(call ptx/endis, PTXCONF_QEMU_TOOLS)-tools \
> +	--disable-bochs \
> +	--disable-cloop \
> +	--disable-dmg \
> +	--disable-qcow1 \
> +	--disable-vdi \
> +	--disable-vvfat \
> +	--disable-qed \
> +	--disable-parallels \
> +	--disable-sheepdog \
> +	--disable-crypto-afalg \
> +	--disable-capstone \
> +	--disable-debug-mutex \
> +	--disable-libpmem \
> +	--disable-xkbcommon \
> +	--disable-rng-none \
> +	--disable-libdaxctl \
> +	--disable-fuse \
> +	--enable-multiprocess \
> +	--disable-gio \
> +	\
> +	--disable-fuzzing \
> +	--disable-keyring
> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/qemu.install:
> +	@$(call targetinfo)
> +	@$(call world/install, QEMU)
> +ifdef PTXCONF_QEMU_SYS
> +#	# necessary for qemu to find its ROM files
> +	@ln -vsf usr/share/qemu $(QEMU_PKGDIR)/pc-bios
> +endif
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/qemu.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, qemu)
> +	@$(call install_fixup, qemu,PRIORITY,optional)
> +	@$(call install_fixup, qemu,SECTION,base)
> +	@$(call install_fixup, qemu,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
> +	@$(call install_fixup, qemu,DESCRIPTION,missing)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-edid)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-img)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-io)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-pr-helper)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-storage-daemon)
> +ifdef PTXCONF_QEMU_SYS
> +	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \

QEMU_TARGETS := $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)

somewhere above and use it here

> +		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
> +endif
> +ifdef PTXCONF_QEMU_USER
> +	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \

and here.

> +		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
> +endif
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/qemu-bridge-helper)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/virtfs-proxy-helper)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-256k.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-microvm.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-aarch64-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-vars.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-secure-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-vars.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-secure-code.fd)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000e.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-eepro100.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-virtio.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-e1000.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-eepro100.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-virtio.rom)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pvh.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/kvmvapic.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-ati.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-cirrus.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-stdvga.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-virtio.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-vmware.bin)
> +	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios.bin)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/firmware)
> +	@$(call install_glob, qemu, 0, 0, -, /usr/share/qemu/firmware,, *.json)
> +
> +	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/keymaps)
> +	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/share/qemu/keymaps/en-us)

I think this stuff is only used for qemu-system. And a lot of it is
architecture dependent so add some:

ifneq ($(filter i386 x86_64,$(QEMU_TARGETS),)
ifneq ($(filter aarch64,$(QEMU_TARGETS),)

and stuff like that.

Michael

> +
> +	@$(call install_finish, qemu)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.32.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ptxdist] [PATCH] rules/qemu: Add new package.
@ 2021-07-16 10:27 Christian Melki
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Melki @ 2021-07-16 10:27 UTC (permalink / raw)
  To: ptxdist

Work-in-progress. Add target-qemu package.
Usecases are among others:
Higher isolation (security) and target emulation (software longevity).

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/qemu.in   |  51 +++++++++
 rules/qemu.make | 274 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 325 insertions(+)
 create mode 100644 rules/qemu.in
 create mode 100644 rules/qemu.make

diff --git a/rules/qemu.in b/rules/qemu.in
new file mode 100644
index 000000000..d627f7a79
--- /dev/null
+++ b/rules/qemu.in
@@ -0,0 +1,51 @@
+## SECTION=emulators
+
+menuconfig QEMU
+	tristate
+	prompt "qemu                          "
+	select HOST_MESON
+	select HOST_NINJA
+	select HOST_SYSTEM_PYTHON3
+	select GLIB
+	select LIBCAP_NG
+	select ZLIB
+	select LIBUSB	if QEMU_SYS
+	select PIXMAN	if QEMU_SYS
+	help
+	  QEMU is a generic and open source machine emulator and
+	  virtualizer.  
+
+if QEMU
+
+config QEMU_TARGETS
+        string
+	prompt "QEMU targets"
+	default "i386 x86_64 arm aarch64"
+	help
+	  The list of QEMU user and system targets you want to build.
+	  Only use the prefixes.
+
+config QEMU_FDT
+       bool
+       prompt "Enable Device Tree generation."
+       default y
+       help
+         Say y to let QEMU construct FDTs and pass them
+	 to the VMs.
+
+config QEMU_TOOLS
+	bool
+	prompt "Enable tools"
+	default y
+	help
+	  Say y here to include tools.
+
+config QEMU_SYS
+	bool
+	prompt "system emulation"
+
+config QEMU_USR
+	bool
+	prompt "user-space emulation"
+
+endif
diff --git a/rules/qemu.make b/rules/qemu.make
new file mode 100644
index 000000000..0a276fbf6
--- /dev/null
+++ b/rules/qemu.make
@@ -0,0 +1,274 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_QEMU) += qemu
+
+#
+# Paths and names
+#
+QEMU_VERSION    := 6.0.0
+QEMU_MD5        := cce185dc0119546e395909e8a71a75bb
+QEMU		:= qemu-$(QEMU_VERSION)
+QEMU_SUFFIX	:= tar.xz
+QEMU_URL	:= https://download.qemu.org/$(QEMU).$(QEMU_SUFFIX)
+QEMU_SOURCE	:= $(SRCDIR)/$(QEMU).$(QEMU_SUFFIX)
+QEMU_DIR	:= $(BUILDDIR)/$(QEMU)
+QEMU_LICENSE	:= GPL-2.0-only AND GPL-2.0-or-later AND MIT AND BSD-1-Clause AND BSD-2-Clause AND BSD-3-Clause
+QEMU_BUILD_OOT	:= YES
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_ARCH_X86
+QEMU_ARCH       := i386
+ifdef PTXCONF_ARCH_X86_64
+QEMU_ARCH       := x86_64
+endif
+endif
+ifdef PTXCONF_ARCH_ARM
+QEMU_ARCH       := arm
+endif
+ifdef PTXCONF_ARCH_ARM64
+QEMU_ARCH       := aarch64
+endif
+
+#
+# autoconf
+#
+
+QEMU_MAKE_OPT	:= V=$(filter 1,$(PTXDIST_VERBOSE))
+
+QEMU_SYS_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-softmmu,$(target)))
+QEMU_USR_TARGETS	:= $(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), $(patsubst %,%-linux-user,$(target)))
+
+QEMU_PATH     := PATH=$(CROSS_PATH)
+
+QEMU_CONF_TOOL	:= autoconf
+# Note: not realy autoconf:
+# e.g. there is --enable-debug but not --disable-debug
+QEMU_CONF_OPT	:= \
+	--prefix=/usr \
+	--target-list=" \
+		$(call ptx/ifdef, PTXCONF_QEMU_SYS,$(QEMU_SYS_TARGETS),) \
+		$(call ptx/ifdef, PTXCONF_QEMU_USR,$(QEMU_USR_TARGETS),) \
+	" \
+	--meson=meson \
+	--ninja=ninja \
+	--cross-prefix=$(CROSS_COMPILE) \
+	--disable-sanitizers \
+	--disable-tsan \
+	--disable-strip \
+	--disable-werror \
+	--enable-stack-protector \
+	--audio-drv-list= \
+	--block-drv-rw-whitelist= \
+	--block-drv-ro-whitelist= \
+	--enable-trace-backends=nop \
+	--disable-tcg-interpreter \
+	--enable-malloc-trim \
+	--with-coroutine= \
+	--tls-priority=NORMAL \
+	--disable-plugins \
+	--disable-containers \
+	--$(call ptx/endis, PTXCONF_QEMU_SYS)-system \
+	--disable-user \
+	--$(call ptx/endis, PTXCONF_QEMU_USR)-linux-user \
+	--disable-bsd-user \
+	--disable-docs \
+	--disable-guest-agent \
+	--disable-guest-agent-msi \
+	--enable-pie \
+	--disable-modules \
+	--disable-module-upgrades \
+	--disable-debug-tcg \
+	--disable-debug-info \
+	--disable-lto \
+	--disable-sparse \
+	--disable-safe-stack \
+	--disable-cfi \
+	--disable-gnutls \
+	--disable-nettle \
+	--disable-gcrypt \
+	--disable-auth-pam \
+	--disable-sdl \
+	--disable-sdl-image \
+	--disable-gtk \
+	--disable-vte \
+	--disable-curses \
+	--enable-iconv \
+	--disable-vnc \
+	--disable-vnc-sasl \
+	--disable-vnc-jpeg \
+	--disable-vnc-png \
+	--disable-cocoa \
+	--enable-virtfs \
+	--disable-virtiofsd \
+	--disable-libudev \
+	--disable-mpath \
+	--disable-xen \
+	--disable-xen-pci-passthrough \
+	--disable-brlapi \
+	--disable-curl \
+	--enable-membarrier \
+	--$(call ptx/endis, PTXCONF_QEMU_FDT)-fdt \
+	--enable-kvm \
+	--disable-hax \
+	--disable-hvf \
+	--disable-whpx \
+	--disable-rdma \
+	--disable-pvrdma \
+	--disable-netmap \
+	--disable-linux-aio \
+	--disable-linux-io-uring \
+	--enable-cap-ng \
+	--enable-attr \
+	--enable-vhost-net \
+	--enable-vhost-vsock \
+	--enable-vhost-scsi \
+	--disable-vhost-crypto \
+	--enable-vhost-kernel \
+	--disable-vhost-user \
+	--disable-vhost-user-blk-server \
+	--disable-vhost-vdpa \
+	--disable-spice \
+	--disable-rbd \
+	--disable-libiscsi \
+	--disable-libnfs \
+	--disable-smartcard \
+	--disable-u2f \
+	--$(call ptx/endis, PTXCONF_QEMU_SYS)-libusb \
+	--disable-live-block-migration \
+	--disable-usb-redir \
+	--disable-lzo \
+	--disable-snappy \
+	--disable-bzip2 \
+	--disable-lzfse \
+	--disable-zstd \
+	--disable-seccomp \
+	--enable-coroutine-pool \
+	--disable-glusterfs \
+	--disable-tpm \
+	--disable-libssh \
+	--disable-numa \
+	--disable-libxml2 \
+	--disable-tcmalloc \
+	--disable-jemalloc \
+	--enable-replication \
+	--disable-opengl \
+	--disable-virglrenderer \
+	--disable-xfsctl \
+	--disable-qom-cast-debug \
+	--$(call ptx/endis, PTXCONF_QEMU_TOOLS)-tools \
+	--disable-bochs \
+	--disable-cloop \
+	--disable-dmg \
+	--disable-qcow1 \
+	--disable-vdi \
+	--disable-vvfat \
+	--disable-qed \
+	--disable-parallels \
+	--disable-sheepdog \
+	--disable-crypto-afalg \
+	--disable-capstone \
+	--disable-debug-mutex \
+	--disable-libpmem \
+	--disable-xkbcommon \
+	--disable-rng-none \
+	--disable-libdaxctl \
+	--disable-fuse \
+	--enable-multiprocess \
+	--disable-gio \
+	\
+	--disable-fuzzing \
+	--disable-keyring
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/qemu.install:
+	@$(call targetinfo)
+	@$(call world/install, QEMU)
+ifdef PTXCONF_QEMU_SYS
+#	# necessary for qemu to find its ROM files
+	@ln -vsf usr/share/qemu $(QEMU_PKGDIR)/pc-bios
+endif
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/qemu.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, qemu)
+	@$(call install_fixup, qemu,PRIORITY,optional)
+	@$(call install_fixup, qemu,SECTION,base)
+	@$(call install_fixup, qemu,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, qemu,DESCRIPTION,missing)
+
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-edid)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-img)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-io)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-pr-helper)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-storage-daemon)
+ifdef PTXCONF_QEMU_SYS
+	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \
+		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
+endif
+ifdef PTXCONF_QEMU_USER
+	@$(foreach target, $(call remove_quotes,$(PTXCONF_QEMU_TARGETS)), \
+		@$(call install_copy, qemu, 0, 0, 0755, -, /usr/bin/qemu-system-$(target))$(ptx/nl))
+endif
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/qemu-bridge-helper)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/libexec/virtfs-proxy-helper)
+
+	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-256k.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios-microvm.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-aarch64-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-arm-vars.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-secure-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-i386-vars.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/edk2-x86_64-secure-code.fd)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-e1000e.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-eepro100.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/efi-virtio.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-e1000.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-eepro100.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pxe-virtio.rom)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/pvh.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/kvmvapic.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-ati.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-cirrus.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-stdvga.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-virtio.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios-vmware.bin)
+	@$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/vgabios.bin)
+
+	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/firmware)
+	@$(call install_glob, qemu, 0, 0, -, /usr/share/qemu/firmware,, *.json)
+
+	@$(call install_copy, qemu, 0, 0, 0755, /usr/share/qemu/keymaps)
+	@$(call install_copy, qemu, 0, 0, 0755, -, /usr/share/qemu/keymaps/en-us)
+
+	@$(call install_finish, qemu)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-06  7:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 12:44 [ptxdist] [PATCH] rules/qemu: Add new package Christian Melki
2021-07-16 13:04 ` Alexander Dahl
2021-08-06  7:00 ` Michael Olbrich
  -- strict thread matches above, loose matches on Subject: below --
2021-07-16 10:27 Christian Melki

mailarchive of the ptxdist mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.ptxdist.org/ptxdist/0 ptxdist/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ptxdist ptxdist/ https://lore.ptxdist.org/ptxdist \
		ptxdist@pengutronix.de
	public-inbox-index ptxdist

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git