From e5b2b56c7c9372c601216206fbfca9d023103e8c Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Wed, 25 Mar 2020 02:34:45 +0000 Subject: [PATCH] grub2|loopback: overwrite default files with user ones ...rather than choosing between the default set and a user provided set 1. ensures backwards compatibility after we switch from generation of certain content to that content being in pre-prepared config files, and thus no longer writing that config out to existing files. 2. 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_loopback_cfg | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg index ac5d0d90e..1eccbd70f 100755 --- a/scripts/build/binary_loopback_cfg +++ b/scripts/build/binary_loopback_cfg @@ -126,18 +126,13 @@ menuentry "Memory Diagnostic Tool ($LB_MEMTEST)" --hotkey=m { END } -if [ -e "config/bootloaders/grub-pc" ] -then - # Internal local copy - _SOURCE="config/bootloaders/grub-pc" +# User config replacement/additional files +_SOURCE_USER="config/bootloaders/grub-pc" + +if [ -n "${LIVE_BUILD}" ]; then + _SOURCE="${LIVE_BUILD}/share/bootloaders/grub-pc" else - # Internal system copy - if [ -n "${LIVE_BUILD}" ] - then - _SOURCE="${LIVE_BUILD}/share/bootloaders/grub-pc" - else - _SOURCE="/usr/share/live/build/bootloaders/grub-pc" - fi + _SOURCE="/usr/share/live/build/bootloaders/grub-pc" fi case "${LB_INITRAMFS}" in @@ -277,6 +272,9 @@ fi # Copying templates mkdir -p binary/boot/grub cp -a "${_SOURCE}"/* binary/boot/grub/ +if [ -e "${_SOURCE_USER}" ]; then + cp -af "${_SOURCE_USER}"/* binary/boot/grub/ +fi escape_for_sed() { echo -n "$1" | perl -npe 's/\n/\\n/gm'