From 83109b6bc4ecd3a60aa62ab3d6f38dbaf608e5c7 Mon Sep 17 00:00:00 2001 From: Anton Midyukov Date: Wed, 10 Feb 2021 00:19:20 +0700 Subject: [PATCH] syslinux: Add grub-pc compatibility Directory syslinux can exist if using memtest feature. --- .../syslinux/scripts.d/20-propagator-ramdisk-syslinux | 8 ++++++-- .../syslinux/scripts.d/20-propagator-rescue-hash-syslinux | 8 ++++++-- features.in/syslinux/stage1/scripts.d/02-gfxboot | 6 +++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/features.in/syslinux/scripts.d/20-propagator-ramdisk-syslinux b/features.in/syslinux/scripts.d/20-propagator-ramdisk-syslinux index d8f16749..81a8e767 100755 --- a/features.in/syslinux/scripts.d/20-propagator-ramdisk-syslinux +++ b/features.in/syslinux/scripts.d/20-propagator-ramdisk-syslinux @@ -3,9 +3,13 @@ # when the image sizes are finally known # NB: install2_size, live_size, rescue_size get defined here -cd "$WORKDIR" +# validate just in case (see also stage1 Makefile) +if [ -z "$(find $WORKDIR/syslinux/*.cfg)" ]; then + echo "Warning: syslinux/*.cfg not found" + exit 0 +fi -[ -d "syslinux" ] || exit 0 +cd "$WORKDIR" # apply size census while looking for potential squashfs images find -maxdepth 1 -type f -size +1M \ diff --git a/features.in/syslinux/scripts.d/20-propagator-rescue-hash-syslinux b/features.in/syslinux/scripts.d/20-propagator-rescue-hash-syslinux index 98d0cedb..74ee3751 100755 --- a/features.in/syslinux/scripts.d/20-propagator-rescue-hash-syslinux +++ b/features.in/syslinux/scripts.d/20-propagator-rescue-hash-syslinux @@ -3,9 +3,13 @@ # to add rescue image hash, if any # (for propagator in forensic mode) -cd "$WORKDIR" +# validate just in case (see also stage1 Makefile) +if [ -z "$(find $WORKDIR/syslinux/*.cfg)" ]; then + echo "Warning: syslinux/*.cfg not found" + exit 0 +fi -[ -d "syslinux" ] || exit 0 +cd "$WORKDIR" grep -qs "@rescue_hash@" syslinux/*.cfg || exit 0 diff --git a/features.in/syslinux/stage1/scripts.d/02-gfxboot b/features.in/syslinux/stage1/scripts.d/02-gfxboot index 9deb6cdd..f4bde1dd 100755 --- a/features.in/syslinux/stage1/scripts.d/02-gfxboot +++ b/features.in/syslinux/stage1/scripts.d/02-gfxboot @@ -1,6 +1,10 @@ #!/bin/sh -[ -d "$WORKDIR/syslinux" ] || exit 0 +# validate just in case (see also stage1 Makefile) +if [ ! -f "$WORKDIR/syslinux/$GLOBAL_BOOTLOADER.cfg" ]; then + echo "Warning: syslinux/*.cfg not found" + exit 0 +fi gfxboot_datadir=/usr/share/gfxboot