From 24658ce5428d5ea0acd22973d79b015ad871f6ee Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Thu, 26 Mar 2020 01:08:31 +0000 Subject: 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 --- scripts/build/binary_syslinux | 25 +++++++++++++------------ 1 file 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 -- cgit v1.2.3