From aa50907d83947091117e869fbf98bca1747637bd Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 18 Aug 2024 14:25:20 +0200 Subject: [PATCH] package/systemd: account for arch dependency of vmspawn support Since upstream commit 5c57a8650630304d8434a348283b6b643fbc676b ("vmspawn: add support for -D/--directory"), src/vmspawn/vmspawn-util.h defines a QEMU_MACHINE_TYPE based on the architecture, and not all architectures are supported. This commit first appeared in systemd v256. Due to this, the unsupported architectures fail with: In file included from ../src/vmspawn/vmspawn-util.c:27: ../src/vmspawn/vmspawn-util.h:46:4: error: #error "No qemu machine defined for this architecture" 46 | # error "No qemu machine defined for this architecture" | ^~~~~ So let's add a BR2_PACKAGE_SYSTEMD_VMSPAWN_ARCH_SUPPORTS and use it to ensure vmspawn support is only used on architectures that are supported. Even though no-one selects BR2_PACKAGE_SYSTEMD_VMSPAWN (and would therefore need to inherit the BR2_PACKAGE_SYSTEMD_VMSPAWN_ARCH_SUPPORTS dependency), we nevertheless introduce BR2_PACKAGE_SYSTEMD_VMSPAWN_ARCH_SUPPORTS to make the depency list prettier than a long "depends on A || B || C || D || ...". Fixes: http://autobuild.buildroot.net/results/0e614375f731f7bfe3c6041c6e89a09c31898053/ Signed-off-by: Thomas Petazzoni Signed-off-by: Yann E. MORIN --- package/systemd/Config.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/systemd/Config.in b/package/systemd/Config.in index 6708adce9b..113a8093c4 100644 --- a/package/systemd/Config.in +++ b/package/systemd/Config.in @@ -599,8 +599,22 @@ config BR2_PACKAGE_SYSTEMD_VCONSOLE_DEFAULT_KEYMAP Default keymap for the system. Leave empty to not set a default keymap. +# See for which architectures QEMU_MACHINE_TYPE is defined in +# src/vmspawn/vmspawn-util.h +config BR2_PACKAGE_SYSTEMD_VMSPAWN_ARCH_SUPPORTS + bool + default y if BR2_aarch64 || BR2_aarch64_be + default y if BR2_arm || BR2_armeb + default y if BR2_i386 + default y if BR2_mips || BR2_mips64 || BR2_mipsel || BR2_mips64el + default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le + default y if BR2_riscv + default y if BR2_s390x + default y if BR2_x86_64 + config BR2_PACKAGE_SYSTEMD_VMSPAWN bool "enable vmspawn" + depends on BR2_PACKAGE_SYSTEMD_VMSPAWN_ARCH_SUPPORTS help systemd-vmspawn may be used to start a virtual machine from an OS image. In many ways it is similar to