mkosi: fix UKI addons test

The test hasn't been working for a while, since there's no /efi or /boot
in $DESTDIR.

Resolves: #31618
This commit is contained in:
Frantisek Sumsal
2024-03-05 11:49:30 +01:00
parent 7360be92ad
commit 374fa8e853
6 changed files with 14 additions and 13 deletions

View File

@@ -169,15 +169,3 @@ if [ "$WITH_TESTS" = 1 ]; then
fi
( set -x; meson install -C "$BUILDDIR" --quiet --no-rebuild --only-changed )
# Ensure that side-loaded PE addons are loaded if signed, and ignored if not
if [ -d "${DESTDIR}/boot/loader" ]; then
addons_dir="${DESTDIR}/boot/loader/addons"
elif [ -d "${DESTDIR}/efi/loader" ]; then
addons_dir="${DESTDIR}/efi/loader/addons"
fi
if [ -n "${addons_dir}" ]; then
mkdir -p "${addons_dir}"
ukify --secureboot-private-key mkosi.secure-boot.key --secureboot-certificate mkosi.secure-boot.crt --cmdline this_should_be_here -o "${addons_dir}/good.addon.efi"
ukify --cmdline this_should_not_be_here -o "${addons_dir}/bad.addon.efi"
fi

View File

@@ -23,5 +23,6 @@ Packages=
python-pytest
python3
quota-tools
sbsigntools
shadow
vim

View File

@@ -19,6 +19,7 @@ Packages=
netcat-openbsd
openssh-server
openssh-client
sbsigntool
passwd
policykit-1
procps

View File

@@ -9,3 +9,4 @@ Packages=
compsize
f2fs-tools
glibc-langpack-en
sbsigntools

View File

@@ -20,5 +20,6 @@ Packages=
python3-psutil
python3-pytest
quota
sbsigntools
shadow
vim

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
@@ -100,3 +100,12 @@ mkdir -p /usr/lib/tmpfiles.d
cat >/usr/lib/tmpfiles.d/testuser.conf <<EOF
q /home/testuser 0700 4711 4711
EOF
# sbsign is not available on CentOS Stream
if command -v sbsign &>/dev/null; then
# Ensure that side-loaded PE addons are loaded if signed, and ignored if not
addons_dir=/efi/loader/addons
mkdir -p "$addons_dir"
ukify build --secureboot-private-key mkosi.key --secureboot-certificate mkosi.crt --cmdline this_should_be_here -o "$addons_dir/good.addon.efi"
ukify build --cmdline this_should_not_be_here -o "$addons_dir/bad.addon.efi"
fi