From 24c2b3e119ef1b22539736ddaae1f42818c09f02 Mon Sep 17 00:00:00 2001 From: jnqnfe Date: Tue, 3 Feb 2015 18:52:30 +0000 Subject: syslinux: deduplicate common files there are several files of which identical duplicate copies are held in: - share/bootloaders/extlinux - share/bootloaders/pxelinux - share/bootloaders/isolinux - share/bootloaders/syslinux it is a pain to maintain this from a development standpoint, having to copy modified config files into the other directories each time changes are made and mistakes have been made before due to this. this creates a new folder share/bootloaders/syslinux_common and moves them to this new directory. it also expands the binary_syslinux stage to use it, with it now constructing the installed set of bootloader files as follows: 1. copy {LB_DIR}/bootloaders/syslinux_common 2. copy {LB_DIR}/bootloaders/{syslinux|isolinux|extlinux|pxelinux} on top 3. copy config/bootloaders/syslinux_common on top 4. copy config/bootloaders/{syslinux|isolinux|extlinux|pxelinux} on top note, to explain part of the binary_syslinux change, instead of just copying the correct bootloader folder full of the files, we now make the target bootloader specific directory, then copy the contents of source directories into it. Gbp-Dch: Short --- scripts/build/binary_syslinux | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'scripts/build/binary_syslinux') diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux index 3df40d0d5..72ca2e7e1 100755 --- a/scripts/build/binary_syslinux +++ b/scripts/build/binary_syslinux @@ -80,18 +80,22 @@ esac # User config replacement/additional files _SOURCE_USER="config/bootloaders/${_BOOTLOADER}" +_SOURCE_USER_COMMON="config/bootloaders/syslinux_common" if [ -n "${LIVE_BUILD}" ]; then _SOURCE="${LIVE_BUILD}/share/bootloaders/${_BOOTLOADER}" + _SOURCE_COMMON="${LIVE_BUILD}/share/bootloaders/syslinux_common" else _SOURCE="/usr/share/live/build/bootloaders/${_BOOTLOADER}" + _SOURCE_COMMON="/usr/share/live/build/bootloaders/syslinux_common" 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 || ls "${_SOURCE_USER}"/*.svg* > /dev/null 2>&1 +if ls "${_SOURCE}"/*.svg* > /dev/null 2>&1 || ls "${_SOURCE_COMMON}"/*.svg* > /dev/null 2>&1 || + ls "${_SOURCE_USER}"/*.svg* > /dev/null 2>&1 || ls "${_SOURCE_USER_COMMON}"/*.svg* > /dev/null 2>&1 then Check_package chroot /usr/bin/rsvg-convert librsvg2-bin fi @@ -106,11 +110,16 @@ Install_package case "${LB_BUILD_WITH_CHROOT}" in true) mkdir -p ${_TARGET} + mkdir -p chroot/root/${_BOOTLOADER} # Copy in two steps since the theme can have absolute symlinks and would therefore not be dereferenced correctly - cp -a ${_SOURCE} chroot/root + cp -a ${_SOURCE_COMMON}/* chroot/root/${_BOOTLOADER}/ + cp -af ${_SOURCE}/* chroot/root/${_BOOTLOADER}/ + if [ -e "${_SOURCE_USER_COMMON}" ]; then + cp -af ${_SOURCE_USER_COMMON}/* chroot/root/${_BOOTLOADER}/ + fi if [ -e "${_SOURCE_USER}" ]; then - cp -af ${_SOURCE_USER} chroot/root + cp -af ${_SOURCE_USER}/* chroot/root/${_BOOTLOADER}/ fi Chroot chroot cp -aL /root/${_BOOTLOADER} /root/${_BOOTLOADER}.tmp > /dev/null 2>&1 || true cp -a chroot/root/${_BOOTLOADER}.tmp/* ${_TARGET} @@ -120,7 +129,11 @@ case "${LB_BUILD_WITH_CHROOT}" in false) mkdir -p ${_TARGET} - cp -aL ${_SOURCE}/* ${_TARGET} > /dev/null 2>&1 || true + cp -aL ${_SOURCE_COMMON}/* ${_TARGET} > /dev/null 2>&1 || true + cp -aLf ${_SOURCE}/* ${_TARGET} > /dev/null 2>&1 || true + if [ -e "${_SOURCE_USER_COMMON}" ]; then + cp -aLf ${_SOURCE_USER_COMMON}/* ${_TARGET} > /dev/null 2>&1 || true + fi if [ -e "${_SOURCE_USER}" ]; then cp -aLf ${_SOURCE_USER}/* ${_TARGET} > /dev/null 2>&1 || true fi -- cgit v1.2.3