From 6527d175cda8c2e1feceb26eb7e3ec111ddc6ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Nov 2023 18:54:38 +0100 Subject: [PATCH 1/4] vmspawn: shorted --help output to fit in 80 columns I think that "SB" is good enough here, the option name shows the unabbreviated name. --- src/vmspawn/vmspawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index ab137df0a71..00166b2f7a4 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -68,7 +68,7 @@ static int help(void) { " --qemu-mem=MEM Configure guest's RAM size\n" " --qemu-kvm= Configure whether to use KVM or not\n" " --qemu-gui Start QEMU in graphical mode\n" - " --secure-boot= Configure whether to search for firmware which supports Secure Boot\n\n" + " --secure-boot= Configure searching for firmware with SB support\n\n" "%3$sCredentials:%4$s\n" " --set-credential=ID:VALUE\n" " Pass a credential with literal value to container.\n" From 30247ea76e72ed89a5d86ec9b78ca8f89a989258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Nov 2023 21:36:46 +0100 Subject: [PATCH 2/4] man: many fixes systemd-vmspawn(1) - version information - indentation and missing tags - mkosi and qemu don't need root --- man/systemctl.xml | 8 +-- man/systemd-vmspawn.xml | 118 +++++++++++++++++++++++----------------- 2 files changed, 72 insertions(+), 54 deletions(-) diff --git a/man/systemctl.xml b/man/systemctl.xml index 2204bee9172..1d791b44fd3 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -2736,15 +2736,15 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err When used with bind, creates a read-only bind mount. - + + NAME - - When used with edit, use NAME as the drop-in - file name instead of override.conf. + When used with edit, use NAME as the + drop-in file name instead of override.conf. diff --git a/man/systemd-vmspawn.xml b/man/systemd-vmspawn.xml index bf3aaf028ea..4ca6f1a74fd 100644 --- a/man/systemd-vmspawn.xml +++ b/man/systemd-vmspawn.xml @@ -44,59 +44,73 @@ The following options are understood: - Image Options + Image Options - - - - + + + + - Root file system disk image (or device node) for the virtual machine. - - + Root file system disk image (or device node) for the virtual machine. + + + + + - Host Configuration + Host Configuration - - - SMP + + + SMP - Configures the number of CPUs to start the virtual machine with. - Defaults to 1. - + Configures the number of CPUs to start the virtual machine with. + Defaults to 1. - - MEM + + + - Configures the amount of memory to start the virtual machine with. - Defaults to 2G. - + + MEM - - + Configures the amount of memory to start the virtual machine with. + Defaults to 2G. - Configure whether to use KVM. - If the option is not specified KVM support will be detected automatically. - If yes is specified KVM is always used, and vice versa if no is set KVM is never used. - + + + - - + + - Start QEMU in graphical mode. - + Configures whether to use KVM. If the option is not specified KVM support will be + detected automatically. If true, KVM is always used, and if false, KVM is never used. - - + + - Configure whether to search for firmware which supports secure boot. - If the option is not specified the first firmware which is detected will be used. - If the option is set to yes then the first firmware with secure boot support will be selected. - If no is specified then the first firmware without secure boot will be selected. - - + + + + Start QEMU in graphical mode. + + + + + + + + Configures whether to search for firmware which supports secure boot. If the option + is not specified, the first firmware which is detected will be used. If true, then the first + firmware with secure boot support will be selected. If false, then the first firmware without + secure boot will be selected. + + + + @@ -116,19 +130,21 @@ use C-style escaping (i.e. \n to embed a newline, or \x00 to embed a NUL byte). Note that the invoking shell might already apply unescaping once, hence this might require double escaping!. - + + - - Other + + + Other - - - - - - + + + + + + @@ -139,8 +155,10 @@ Run an Arch Linux VM image generated by mkosi - # mkosi -d arch -p systemd -p linux --autologin -o image.raw -f build - # systemd-vmspawn --image=image.raw + +$ mkosi -d arch -p systemd -p linux --autologin -o image.raw -f build +$ systemd-vmspawn --image=image.raw + @@ -155,7 +173,7 @@ See Also systemd1, - mkosi1, + mkosi1 From 2b84d62869e61b5944e26246137fd07bdbda1340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Nov 2023 21:51:40 +0100 Subject: [PATCH 3/4] meson: enable vmspawn by default in developer mode This should also implicitly enabled vmspawn in CI. It wasn't passing even the basic tests, which we didn't see, because it needs to be explicitly enabled. --- meson.build | 5 ++++- meson_options.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 3e68f43ea63..32a181e50d2 100644 --- a/meson.build +++ b/meson.build @@ -33,6 +33,7 @@ conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer', description : 'tailor build to development or release builds') + feature = get_option('log-message-verification') if feature.auto() have = conf.get('BUILD_MODE_DEVELOPER') == 1 @@ -1569,6 +1570,9 @@ endif have = feature.allowed() and (have_deps[0] or have_deps[1]) conf.set10('ENABLE_REMOTE', have) +feature = get_option('vmspawn').disable_auto_if(conf.get('BUILD_MODE_DEVELOPER') == 0) +conf.set10('ENABLE_VMSPAWN', feature.allowed()) + foreach term : ['analyze', 'backlight', 'binfmt', @@ -1610,7 +1614,6 @@ foreach term : ['analyze', 'userdb', 'utmp', 'vconsole', - 'vmspawn', 'xdg-autostart'] have = get_option(term) name = 'ENABLE_' + term.underscorify().to_upper() diff --git a/meson_options.txt b/meson_options.txt index abefa284586..e9283dc37e9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -156,7 +156,7 @@ option('backlight', type : 'boolean', description : 'support for restoring backlight state') option('vconsole', type : 'boolean', description : 'support for vconsole configuration') -option('vmspawn', type : 'boolean', value: false, +option('vmspawn', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' }, description : 'install the systemd-vmspawn tool') option('quotacheck', type : 'boolean', description : 'support for the quotacheck tools') From 0919dbebb0d6b7f2f6aff5a67bf11f0b93df1f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Nov 2023 22:50:37 +0100 Subject: [PATCH 4/4] vmspawn: add missing include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../src/src/vmspawn/vmspawn-util.c:33:13: error: implicit declaration of function ‘access’; did you mean ‘accept’? [-Werror=implicit-function-declaration] --- src/vmspawn/vmspawn-util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vmspawn/vmspawn-util.c b/src/vmspawn/vmspawn-util.c index 852a81d0715..95c05643d82 100644 --- a/src/vmspawn/vmspawn-util.c +++ b/src/vmspawn/vmspawn-util.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include +#include #include "alloc-util.h" #include "architecture.h"