mirror of
https://github.com/tuxbox-neutrino/buildenv.git
synced 2025-08-26 23:13:18 +02:00
init: use own directory for config backups
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,6 +9,7 @@ build-neutrino
|
|||||||
local.conf.common.inc
|
local.conf.common.inc
|
||||||
dist/*
|
dist/*
|
||||||
build*
|
build*
|
||||||
|
backups*
|
||||||
*.orig
|
*.orig
|
||||||
*.log
|
*.log
|
||||||
local build increment
|
local build increment
|
||||||
|
14
init.sh
14
init.sh
@@ -32,6 +32,9 @@ HINT_IMAGE_VERSIONS="$IMAGE_VERSION"
|
|||||||
LOG_PATH=$BASEPATH/log
|
LOG_PATH=$BASEPATH/log
|
||||||
mkdir -p $LOG_PATH
|
mkdir -p $LOG_PATH
|
||||||
|
|
||||||
|
BACKUP_PATH=$BASEPATH/backups
|
||||||
|
mkdir -p $BACKUP_PATH
|
||||||
|
|
||||||
LOGFILE_NAME="$0_$TIMESTAMP.log"
|
LOGFILE_NAME="$0_$TIMESTAMP.log"
|
||||||
LOGFILE=$LOG_PATH/$LOGFILE_NAME
|
LOGFILE=$LOG_PATH/$LOGFILE_NAME
|
||||||
TMP_LOGFILE=$LOG_PATH/.tmp.log
|
TMP_LOGFILE=$LOG_PATH/.tmp.log
|
||||||
@@ -335,10 +338,15 @@ function set_file_entry () {
|
|||||||
# function to create configuration for box types
|
# function to create configuration for box types
|
||||||
function create_local_config () {
|
function create_local_config () {
|
||||||
CLC_ARG1=$1
|
CLC_ARG1=$1
|
||||||
|
|
||||||
if [ "$CLC_ARG1" != "all" ]; then
|
if [ "$CLC_ARG1" != "all" ]; then
|
||||||
|
|
||||||
MACHINE_BUILD_DIR=$BUILD_ROOT/$CLC_ARG1
|
MACHINE_BUILD_DIR=$BUILD_ROOT/$CLC_ARG1
|
||||||
mkdir -p $BUILD_ROOT
|
mkdir -p $BUILD_ROOT
|
||||||
|
|
||||||
|
BACKUP_CONFIG_DIR="$BACKUP_PATH/$CLC_ARG1/conf"
|
||||||
|
mkdir -p $BACKUP_CONFIG_DIR
|
||||||
|
|
||||||
if test -d $BUILD_ROOT_DIR/$CLC_ARG1; then
|
if test -d $BUILD_ROOT_DIR/$CLC_ARG1; then
|
||||||
if test ! -L $BUILD_ROOT_DIR/$CLC_ARG1; then
|
if test ! -L $BUILD_ROOT_DIR/$CLC_ARG1; then
|
||||||
# generate build/config symlinks for compatibility
|
# generate build/config symlinks for compatibility
|
||||||
@@ -363,7 +371,7 @@ function create_local_config () {
|
|||||||
echo -e "\tcreate configuration for $CLC_ARG1 ... "
|
echo -e "\tcreate configuration for $CLC_ARG1 ... "
|
||||||
|
|
||||||
if test -f $LOCAL_CONFIG_FILE_PATH; then
|
if test -f $LOCAL_CONFIG_FILE_PATH; then
|
||||||
do_exec "mv -v $LOCAL_CONFIG_FILE_PATH $LOCAL_CONFIG_FILE_PATH.$TIMESTAMP.$BACKUP_SUFFIX"
|
do_exec "cp -v $LOCAL_CONFIG_FILE_PATH $BACKUP_CONFIG_DIR/local.conf.$TIMESTAMP.$BACKUP_SUFFIX"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_file_entry $LOCAL_CONFIG_FILE_PATH "generated" "# auto generated entries by init script"
|
set_file_entry $LOCAL_CONFIG_FILE_PATH "generated" "# auto generated entries by init script"
|
||||||
@@ -387,7 +395,9 @@ function create_local_config () {
|
|||||||
BBLAYER_CONF_FILE="$MACHINE_BUILD_DIR/conf/bblayers.conf"
|
BBLAYER_CONF_FILE="$MACHINE_BUILD_DIR/conf/bblayers.conf"
|
||||||
|
|
||||||
# craete backup for bblayer.conf
|
# craete backup for bblayer.conf
|
||||||
do_exec "cp -v $BBLAYER_CONF_FILE $BBLAYER_CONF_FILE.$TIMESTAMP.$BACKUP_SUFFIX"
|
if test -f $BBLAYER_CONF_FILE; then
|
||||||
|
do_exec "cp -v $BBLAYER_CONF_FILE $BACKUP_CONFIG_DIR/bblayer.conf.$TIMESTAMP.$BACKUP_SUFFIX"
|
||||||
|
fi
|
||||||
|
|
||||||
META_MACHINE_LAYER=meta-`get_metaname $CLC_ARG1`
|
META_MACHINE_LAYER=meta-`get_metaname $CLC_ARG1`
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user