]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test/60-ukify: override stub location in tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 14 Apr 2023 16:45:24 +0000 (18:45 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 May 2023 16:42:37 +0000 (18:42 +0200)
Without this, build would fail if the stub is not available in /usr/lib/.

meson.build
src/boot/efi/meson.build
src/kernel-install/test-kernel-install.sh

index 910b55d3c07287119cb792721b98021540cae55c..28086b16e6167ca7f6511da2c808d92ece26ea1b 100644 (file)
@@ -2178,6 +2178,9 @@ public_programs = []
 # D-Bus introspection XML export
 dbus_programs = []
 
+# A list of boot stubs. Required for testing of ukify.
+boot_stubs = []
+
 basic_includes = include_directories(
         'src/basic',
         'src/fundamental',
@@ -4378,8 +4381,8 @@ endif
 
 if want_tests != 'false' and want_kernel_install
         args = [kernel_install.full_path(), loaderentry_install, uki_copy_install]
-        if want_ukify
-                args += [ukify.full_path(), ukify_install]
+        if want_ukify and boot_stubs.length() > 0
+                args += [ukify.full_path(), ukify_install, boot_stubs[0]]
         endif
 
         test('test-kernel-install',
index 67ce00838d4deaec604b63bf4555a0ef42c49a29..9a560cf1936e115ab378dbf55160ba37b0bdfbcf 100644 (file)
@@ -334,7 +334,7 @@ foreach efi_elf_binary : efi_elf_binaries
         # FIXME: Use build_tgt.name() with meson >= 0.54.0
         name = fs.name(efi_elf_binary.full_path()).split('.')[0]
         name += name.startswith('linux') ? '.efi.stub' : '.efi'
-        boot_targets += custom_target(
+        exe = custom_target(
                 name,
                 output : name,
                 input : efi_elf_binary,
@@ -351,6 +351,10 @@ foreach efi_elf_binary : efi_elf_binaries
                         '@INPUT@',
                         '@OUTPUT@',
                 ])
+        boot_targets += exe
+        if name.startswith('linux')
+                boot_stubs += exe
+        endif
 endforeach
 
 alias_target('systemd-boot', boot_targets)
index c9d73ff8e32944147ec5e9e59dc15b1e94773a47..4be877135973cf47dfa9cb08207c8e3214f8432f 100755 (executable)
@@ -11,6 +11,7 @@ loaderentry_install="${2:?}"
 uki_copy_install="${3:?}"
 ukify="${4:-}"
 ukify_install="${5:-}"
+boot_stub="${6:-}"
 if [[ -d "${PROJECT_BUILD_ROOT:-}" ]]; then
     bootctl="${PROJECT_BUILD_ROOT}/bootctl"
 else
@@ -45,6 +46,7 @@ export BOOT_ROOT="$D/boot"
 export BOOT_MNT="$D/boot"
 export MACHINE_ID='3e0484f3634a418b8e6a39e8828b03e3'
 export KERNEL_INSTALL_UKIFY="$ukify"
+export KERNEL_INSTALL_BOOT_STUB="$boot_stub"
 
 # Test type#1 installation
 "$kernel_install" -v add 1.1.1 "$D/sources/linux" "$D/sources/initrd"