From: Daan De Meyer Date: Fri, 26 May 2023 15:38:23 +0000 (+0200) Subject: mkosi: Use proper check to detect whether we're in a VM X-Git-Tag: v254-rc1~329^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4dfb458f42decbfe463ee9bba0a10b0d284f302f;p=thirdparty%2Fsystemd.git mkosi: Use proper check to detect whether we're in a VM --- diff --git a/mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh b/mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh index ae1385b98b0..9624bc486c6 100755 --- a/mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh +++ b/mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/mkosi-check-and-shutdown.sh @@ -4,7 +4,7 @@ systemctl --failed --no-legend | tee /failed-services # Check that secure boot keys were properly enrolled. -if [[ -d /sys/firmware/efi/efivars/ ]]; then +if ! systemd-detect-virt --container; then cmp /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c <(printf '\6\0\0\0\1') cmp /sys/firmware/efi/efivars/SetupMode-8be4df61-93ca-11d2-aa0d-00e098032b8c <(printf '\6\0\0\0\0') grep -q this_should_be_here /proc/cmdline