]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Remove test-efi-create-disk.sh
authorJan Janssen <medhefgo@web.de>
Thu, 20 Jan 2022 10:59:49 +0000 (11:59 +0100)
committerJan Janssen <medhefgo@web.de>
Wed, 26 Jan 2022 13:40:51 +0000 (14:40 +0100)
The script was probably not used for a very long time. It is currently
passed systemd_boot.so as boot loader, which cannot work. The test
entries it creates are all pointing at non-existant efi/linux binaries,
which means they would not even show up in the menu if the created image
were actually booted. There is also nothing that actually tries to run
the image in the first place.

If we end up creating a proper systemd-boot test suite, it would be
better to start from scratch. In the meantime, mkosi already covers
the bare minimum with a simple bootup test.

meson.build
src/boot/efi/meson.build
test/splash.bmp [deleted file]
test/test-efi-create-disk.sh [deleted file]

index a3548a02785e5a744d01137f859d72fe20cd9638..9faa6583a077be448bd9dadc253b2be4814ce116 100644 (file)
@@ -599,10 +599,8 @@ env = find_program('env')
 perl = find_program('perl', required : false)
 rsync = find_program('rsync', required : false)
 meson_make_symlink = project_source_root + '/tools/meson-make-symlink.sh'
-test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
 
 mkdir_p = 'mkdir -p $DESTDIR/@0@'
-splash_bmp = files('test/splash.bmp')
 
 # If -Dxxx-path option is found, use that. Otherwise, check in $PATH,
 # /usr/sbin, /sbin, and fall back to the default from middle column.
index b6bf6af21b9ffaba689be459790ae0877089547a..20b0c4bf7c0dea74dc8b9c2fb191fc25f38889f2 100644 (file)
@@ -401,7 +401,6 @@ systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(efi_arch[0])
 stub_elf_name = 'linux@0@.elf.stub'.format(efi_arch[0])
 stub_efi_name = 'linux@0@.efi.stub'.format(efi_arch[0])
 
-efi_stubs = []
 foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects, false],
                  [stub_elf_name, stub_efi_name, stub_objects, true]]
         so = custom_target(
@@ -419,7 +418,7 @@ foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects
                 install : tuple[3],
                 install_dir : bootlibdir)
 
-        stub = custom_target(
+        custom_target(
                 tuple[1],
                 input : so,
                 output : tuple[1],
@@ -439,14 +438,4 @@ foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects
                            '@INPUT@', '@OUTPUT@'],
                 install : true,
                 install_dir : bootlibdir)
-
-        efi_stubs += [[so, stub]]
 endforeach
-
-############################################################
-
-test_efi_disk_img = custom_target(
-        'test-efi-disk.img',
-        input : [efi_stubs[0][0], efi_stubs[1][1]],
-        output : 'test-efi-disk.img',
-        command : [test_efi_create_disk_sh, '@OUTPUT@','@INPUT@', splash_bmp])
diff --git a/test/splash.bmp b/test/splash.bmp
deleted file mode 100644 (file)
index 27247f7..0000000
Binary files a/test/splash.bmp and /dev/null differ
diff --git a/test/test-efi-create-disk.sh b/test/test-efi-create-disk.sh
deleted file mode 100755 (executable)
index 46062e4..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -eo pipefail
-
-out="${1:?}"
-systemd_efi="${2:?}"
-boot_stub="${3:?}"
-splash_bmp="${4:?}"
-
-efi_dir="$(bootctl -p)"
-entry_dir="${efi_dir}/$(cat /etc/machine-id)/$(uname -r)"
-
-# create GPT table with EFI System Partition
-rm -f "$out"
-dd if=/dev/null of="$out" bs=1M seek=512 count=1 status=none
-parted --script "$out" "mklabel gpt" "mkpart ESP fat32 1MiB 511MiB" "set 1 boot on"
-
-# create FAT32 file system
-LOOP="$(losetup --show -f -P "$out")"
-mkfs.vfat -F32 "${LOOP}p1"
-mkdir -p mnt
-mount "${LOOP}p1" mnt
-
-mkdir -p mnt/EFI/{BOOT,systemd}
-cp "$systemd_efi" mnt/EFI/BOOT/BOOTX64.efi
-
-if [ -e /boot/shellx64.efi ]; then
-    cp /boot/shellx64.efi mnt/
-fi
-
-mkdir mnt/EFI/Linux
-echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" >mnt/cmdline.txt
-objcopy \
-    --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
-    --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \
-    --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \
-    --add-section .linux="${entry_dir}/linux" --change-section-vma .linux=0x2000000 \
-    --add-section .initrd="${entry_dir}/initrd" --change-section-vma .initrd=0x3000000 \
-    "$boot_stub" mnt/EFI/Linux/linux-test.efi
-
-# install entries
-mkdir -p mnt/loader/entries
-echo -e "timeout 3\n" > mnt/loader/loader.conf
-echo -e "title Test\nefi /test\n" > mnt/loader/entries/test.conf
-echo -e "title Test2\nlinux /test2\noptions option=yes word number=1000 more\n" > mnt/loader/entries/test2.conf
-echo -e "title Test3\nlinux /test3\n" > mnt/loader/entries/test3.conf
-echo -e "title Test4\nlinux /test4\n" > mnt/loader/entries/test4.conf
-echo -e "title Test5\nefi /test5\n" > mnt/loader/entries/test5.conf
-echo -e "title Test6\nlinux /test6\n" > mnt/loader/entries/test6.conf
-
-sync
-umount mnt
-rmdir mnt
-losetup -d "$LOOP"