From: Jan Janssen Date: Thu, 20 Jan 2022 10:59:49 +0000 (+0100) Subject: meson: Remove test-efi-create-disk.sh X-Git-Tag: v251-rc1~454^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2ba8511e6eaf1fb28207492e9ff306679bbe9ff;p=thirdparty%2Fsystemd.git meson: Remove test-efi-create-disk.sh 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. --- diff --git a/meson.build b/meson.build index a3548a02785..9faa6583a07 100644 --- a/meson.build +++ b/meson.build @@ -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. diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index b6bf6af21b9..20b0c4bf7c0 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -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 index 27247f7a22b..00000000000 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 index 46062e46e70..00000000000 --- a/test/test-efi-create-disk.sh +++ /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"