[PATCH 16/20] syslinux: fixed for using BOOTLOADER not equal syslinux

Anton Midyukov antohami at altlinux.org
Mon Jan 6 19:26:52 MSK 2020


Do not create syslinux.cfg if EFI_BOOTLOADER is set to not equal grub-efi.
---
 features.in/syslinux/scripts.d/20-propagator-ramdisk   |  2 ++
 .../syslinux/scripts.d/20-propagator-rescue-hash       |  2 ++
 features.in/syslinux/stage1/scripts.d/01-syslinux      | 10 +++++-----
 features.in/syslinux/stage1/scripts.d/02-gfxboot       |  6 +++---
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/features.in/syslinux/scripts.d/20-propagator-ramdisk b/features.in/syslinux/scripts.d/20-propagator-ramdisk
index 525512a0e5..f4139321df 100755
--- a/features.in/syslinux/scripts.d/20-propagator-ramdisk
+++ b/features.in/syslinux/scripts.d/20-propagator-ramdisk
@@ -3,6 +3,8 @@
 # when the image sizes are finally known
 # NB: install2_size, live_size, rescue_size get defined here
 
+[ -d "$WORKDIR/syslinux" ] || exit 0
+
 cd "$WORKDIR"
 
 # apply size census while looking for potential squashfs images
diff --git a/features.in/syslinux/scripts.d/20-propagator-rescue-hash b/features.in/syslinux/scripts.d/20-propagator-rescue-hash
index c785b35442..72279a8a73 100755
--- a/features.in/syslinux/scripts.d/20-propagator-rescue-hash
+++ b/features.in/syslinux/scripts.d/20-propagator-rescue-hash
@@ -3,6 +3,8 @@
 # to add rescue image hash, if any
 # (for propagator in forensic mode)
 
+[ -d "$WORKDIR/syslinux" ] || exit 0
+
 cd "$WORKDIR"
 
 grep -qs "@rescue_hash@" syslinux/*.cfg || exit 0
diff --git a/features.in/syslinux/stage1/scripts.d/01-syslinux b/features.in/syslinux/stage1/scripts.d/01-syslinux
index e9390715aa..baec719f02 100755
--- a/features.in/syslinux/stage1/scripts.d/01-syslinux
+++ b/features.in/syslinux/stage1/scripts.d/01-syslinux
@@ -5,16 +5,16 @@
 MODDIR="/usr/lib/syslinux"
 CFG="$GLOBAL_BOOTLOADER.cfg"
 
-mkdir -p "$WORKDIR/syslinux"
-cd "$WORKDIR/syslinux"
-
 # validate just in case (see also stage1 Makefile)
 case "$GLOBAL_BOOTLOADER" in
 	isolinux|syslinux) ;;
-	*) echo "error: weird GLOBAL_BOOTLOADER: \`$GLOBAL_BOOTLOADER'" >&2;
-	   exit 1;;
+	*) echo "Warning: GLOBAL_BOOTLOADER not supported: \`$GLOBAL_BOOTLOADER'" >&2;
+	   rm -fr "$WORKDIR/syslinux"
+	   exit 0;;
 esac
 
+cd "$WORKDIR/syslinux"
+
 # copy extra files, if any
 SYSLINUX_FILES="$(cat .in/syslinux.list)"
 if [ -n "${SYSLINUX_FILES% }" ]; then
diff --git a/features.in/syslinux/stage1/scripts.d/02-gfxboot b/features.in/syslinux/stage1/scripts.d/02-gfxboot
index 221deb9aa8..9deb6cddd0 100755
--- a/features.in/syslinux/stage1/scripts.d/02-gfxboot
+++ b/features.in/syslinux/stage1/scripts.d/02-gfxboot
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+[ -d "$WORKDIR/syslinux" ] || exit 0
+
 gfxboot_datadir=/usr/share/gfxboot
 
 if [ ! -d "$gfxboot_datadir" ]; then
@@ -15,9 +17,7 @@ if [ ! -f "$bootlogo" ]; then
 	exit 0
 fi
 
-cd "$WORKDIR"
-mkdir -p syslinux
-cd syslinux
+cd "$WORKDIR/syslinux"
 
 # unpack
 cpio -iduV <"$bootlogo"
-- 
2.24.1


--------------57A0C61BE7D9EDE338E3E6C8
Content-Type: text/x-patch;
 name="0020-sub.in-stage1-call-copy-kernel-instead-of-copy-BOOTL.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0020-sub.in-stage1-call-copy-kernel-instead-of-copy-BOOTL.pa";
 filename*1="tch"



More information about the devel-distro mailing list