summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-26 01:08:31 +0000
committerRaphaƫl Hertzog <raphael@offensive-security.com>2020-04-23 09:59:56 +0200
commit24658ce5428d5ea0acd22973d79b015ad871f6ee (patch)
treeb264d7ffc120d8c916b0da9994e1fa37d7fd0273
parent81adab855557a99d17110d9ffe5325cf774350d9 (diff)
downloadvyos-live-build-24658ce5428d5ea0acd22973d79b015ad871f6ee.tar.gz
vyos-live-build-24658ce5428d5ea0acd22973d79b015ad871f6ee.zip
syslinux: overwrite default files with user ones
as just done for grub2|loopback the primary benefit here is that it means that user configs do not have to carry copies of all files; they just carry the ones they want to replace (or add). Gbp-Dch: Short
-rwxr-xr-xscripts/build/binary_syslinux25
1 files changed, 13 insertions, 12 deletions
diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux
index 357267d14..52a92f191 100755
--- a/scripts/build/binary_syslinux
+++ b/scripts/build/binary_syslinux
@@ -78,25 +78,20 @@ case "${LIVE_IMAGE_TYPE}" in
;;
esac
-if [ -e "config/bootloaders/${_BOOTLOADER}" ]
-then
- # Internal local copy
- _SOURCE="config/bootloaders/${_BOOTLOADER}"
+# User config replacement/additional files
+_SOURCE_USER="config/bootloaders/${_BOOTLOADER}"
+
+if [ -n "${LIVE_BUILD}" ]; then
+ _SOURCE="${LIVE_BUILD}/share/bootloaders/${_BOOTLOADER}"
else
- # Internal system copy
- if [ -n "${LIVE_BUILD}" ]
- then
- _SOURCE="${LIVE_BUILD}/share/bootloaders/${_BOOTLOADER}"
- else
- _SOURCE="/usr/share/live/build/bootloaders/${_BOOTLOADER}"
- fi
+ _SOURCE="/usr/share/live/build/bootloaders/${_BOOTLOADER}"
fi
# Checking depends
Check_package chroot /usr/lib/$(echo ${_BOOTLOADER} | tr [a-z] [A-Z]) ${_BOOTLOADER}
Check_package chroot /usr/lib/syslinux syslinux-common
-if ls "${_SOURCE}"/*.svg* > /dev/null 2>&1
+if ls "${_SOURCE}"/*.svg* > /dev/null 2>&1 || ls "${_SOURCE_USER}"/*.svg* > /dev/null 2>&1
then
Check_package chroot /usr/bin/rsvg-convert librsvg2-bin
fi
@@ -114,6 +109,9 @@ case "${LB_BUILD_WITH_CHROOT}" in
# Copy in two steps since the theme can have absolute symlinks and would therefore not be dereferenced correctly
cp -a ${_SOURCE} chroot/root
+ if [ -e "${_SOURCE_USER}" ]; then
+ cp -af ${_SOURCE_USER} chroot/root
+ fi
Chroot chroot cp -aL /root/${_BOOTLOADER} /root/${_BOOTLOADER}.tmp > /dev/null 2>&1 || true
cp -a chroot/root/${_BOOTLOADER}.tmp/* ${_TARGET}
rm -rf chroot/root/${_BOOTLOADER} chroot/root/${_BOOTLOADER}.tmp
@@ -123,6 +121,9 @@ case "${LB_BUILD_WITH_CHROOT}" in
mkdir -p ${_TARGET}
cp -aL ${_SOURCE}/* ${_TARGET} > /dev/null 2>&1 || true
+ if [ -e "${_SOURCE_USER}" ]; then
+ cp -aLf ${_SOURCE_USER}/* ${_TARGET} > /dev/null 2>&1 || true
+ fi
;;
esac