diff options
-rw-r--r-- | remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig | 16 | ||||
-rw-r--r-- | remote/rootfs/rootfs-stage31/data/inc/functions | 8 |
2 files changed, 22 insertions, 2 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig b/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig index 858102d2..3295a92d 100644 --- a/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig +++ b/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig @@ -63,7 +63,19 @@ HEREEND tar xf "${CONFIG}.tgz" -C "${TEMP_EXTRACT_DIR}" || { echo "Could not untar ${CONFIG}.tgz to ${TEMP_EXTRACT_DIR}"; return 1; } chown -R 0:0 "${TEMP_EXTRACT_DIR}" 2>/dev/null cd "${TEMP_EXTRACT_DIR}" - tar -cp * | tar -xp -C "${FUTURE_ROOT}" + # first extract the common config files found in config.tgz:common/ + if [ -d "common" ]; then + tarcopy "common" "${FUTURE_ROOT}" + echo "Extracted common configuration files." + fi + # now extract the localized part of the config + # this should be under config.tgz:$SLX_LOCAL_CONFIG + # e.g. config.tgz:rzpool + if [ -d "${SLX_LOCAL_CONFIG}" ]; then + tarcopy "${SLX_LOCAL_CONFIG}" "${FUTURE_ROOT}" + echo "Extracted local configuration files for: $SLX_LOCAL_CONFIG" + fi + # cleanup the downloaded stuff cd / rm -rf -- "${TEMP_EXTRACT_DIR}" [ $DEBUG -eq 0 ] && rm -f -- "${CONFIG}.tgz" @@ -74,7 +86,7 @@ HEREEND ######################################################################### # -# MAIN PART +# MAIN PART # fetch_sysconfig diff --git a/remote/rootfs/rootfs-stage31/data/inc/functions b/remote/rootfs/rootfs-stage31/data/inc/functions index 5cc56dd7..ee2f0c25 100644 --- a/remote/rootfs/rootfs-stage31/data/inc/functions +++ b/remote/rootfs/rootfs-stage31/data/inc/functions @@ -73,3 +73,11 @@ bench_event() { " } +# mini tarcopy <3 +# tarcopy <source_dir> <target_dir> +tarcopy() { + [ -d "$1" -a -d "$2" ] || return 1 + cd "$1" + tar -cp * | tar -xp -C "$2" + cd - &>/dev/null +} |