From 164b5948086ad324572a7e10fd62ef922175bf71 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Mon, 21 Nov 2011 14:28:34 +0100 Subject: [PATCH] Use addon files from chroot if present This way - if a flavour installs all required packages -, we always get the addon file from the packages the flavour installs. Makes source compliance a ton easier and we don't accidentally miss addons on GRML_FULL. --- grml-live | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/grml-live b/grml-live index 910ce2e..351854d 100755 --- a/grml-live +++ b/grml-live @@ -215,26 +215,39 @@ extend_string_end() { echo -ne "\n" } -# Copy addonfile $1 from the TEMPLATE_DIRECTORY/compat (if exists), -# or from $2 (the system path), or warn about the missing file. +# Copy addonfile $1 from either +# * the chroot (via $2, the system path), +# * or from TEMPLATE_DIRECTORY/compat (if exists), +# * or from the host system (again, using $2), +# or warn about the missing file. +# # This is because: +# * We assume that the chroot always has a "good" version of +# the file. Also it makes sources handling easier. # * On unstable, we Recommend the Debian packages containing # these files. The user can override them by putting his -# "better" version into TEMPLATE_DIRECTORY/compat. +# "better" version into the chroot. # * On stable, the Debian packages are probably not available, # or outdated, so we look in TEMPLATE_DIRECTORY/compat first, where # our grml-live-compat package installs current file versions. copy_addon_file() { - if [ ! -d "${BUILD_OUTPUT}/boot/$3/" ]; then - mkdir -p "${BUILD_OUTPUT}/boot/$3" + DEST="${BUILD_OUTPUT}/boot/$3" + if [ ! -d "${DEST}/" ]; then + mkdir -p "${DEST}" + fi + if [ -e "$CHROOT_OUTPUT/$2/$1" ]; then + log "Copying $1 from chroot" + cp "$CHROOT_OUTPUT/$2/$1" "${DEST}/" + return $? fi if [ -e "${TEMPLATE_DIRECTORY}/compat/$3/$1" ]; then - cp "${TEMPLATE_DIRECTORY}/compat/$3/$1" "${BUILD_OUTPUT}/boot/$3/" + log "Copying $1 from grml-live-compat" + cp "${TEMPLATE_DIRECTORY}/compat/$3/$1" "${DEST}/" return $? fi if [ -e "$2/$1" ]; then log "Copying $1 from system" - cp "$2/$1" "${BUILD_OUTPUT}/boot/$3/" + cp "$2/$1" "${DEST}/" return $? fi -- 2.1.4