summaryrefslogtreecommitdiffstats
path: root/remote/rootfs
diff options
context:
space:
mode:
authorJonathan Bauer2015-11-13 15:27:31 +0100
committerJonathan Bauer2015-11-13 15:27:31 +0100
commit3b7df9f4cbcb387f4a55e24dafecf9c4cd5312c5 (patch)
tree508885d5df3660068d88d6770fd5604851bee5ab /remote/rootfs
parent[rfs-s31] support for SLX_LOCAL_CONFIG (diff)
downloadtm-scripts-3b7df9f4cbcb387f4a55e24dafecf9c4cd5312c5.tar.gz
tm-scripts-3b7df9f4cbcb387f4a55e24dafecf9c4cd5312c5.tar.xz
tm-scripts-3b7df9f4cbcb387f4a55e24dafecf9c4cd5312c5.zip
[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/<local_config_folder> /<common_files>
Diffstat (limited to 'remote/rootfs')
-rw-r--r--remote/rootfs/rootfs-stage31/data/inc/activate_sysconfig21
1 files changed, 10 insertions, 11 deletions
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}"