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
This commit is contained in:
Lyndon Brown 2020-03-26 01:08:31 +00:00 committed by Raphaël Hertzog
parent 81adab8555
commit 24658ce542
1 changed files with 13 additions and 12 deletions

View File

@ -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