From 3b7df9f4cbcb387f4a55e24dafecf9c4cd5312c5 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 13 Nov 2015 15:27:31 +0100 Subject: [rfs-s31] reworked config.tgz unpacking/merging for a better support of the old style config.tgz format, now common files should be stored in config.tgz:/ directly and for local configuration it needs to be in a subfolder of config.tgz:/openslx-configs/ e.g openslx-configs/rz During the boot, it read SLX_LOCAL_CONFIG from /opt/openslx/config and if the corresponding directory resides in config.tgz:/openslx-configs/$SLX_LOCAL_CONFIG, it will get merged with the common configuration files and copied to the future root Recap, sample config.tgz structure: /openslx-configs/ / --- .../rootfs-stage31/data/inc/activate_sysconfig | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'remote/rootfs') diff --git a/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig b/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig index 3295a92d..fc6b6ba0 100644 --- a/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig +++ b/remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig @@ -63,18 +63,17 @@ 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}" - # 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" + # first we look for local config.tgz files, which we merge with the common + # config.tgz files + local LOCAL_CONFIG_DIR="openslx-configs/${SLX_LOCAL_CONFIG}" + if [ -d "${LOCAL_CONFIG_DIR}" ]; then + tarcopy "${LOCAL_CONFIG_DIR}" "${TEMP_EXTRACT_DIR}" + echo "Merged local configuration files for '${SLX_LOCAL_CONFIG}'" fi + # purge openslx-configs/* + rm -rf -- "openslx-configs/" + # now just tarcopy them to future root + tarcopy "${TEMP_EXTRACT_DIR}" "${FUTURE_ROOT}" # cleanup the downloaded stuff cd / rm -rf -- "${TEMP_EXTRACT_DIR}" -- cgit v1.2.3-55-g7522