summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2022-03-31 23:18:16 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2022-03-31 23:18:16 +0300
commit04474efccc672013a05cf5ecd6f5fa7e7221ecf2 (patch)
tree06fee22e3ecf851db70519fa7e34feb956e49450 /recipes-core
parent0233aa52d7f4abaa1bc04184d3b2b214ccd61ee4 (diff)
parentc2810d552b59048f620314b90a0e545078d3e4af (diff)
downloadmeta-mlinux-04474efccc672013a05cf5ecd6f5fa7e7221ecf2.tar.gz
meta-mlinux-04474efccc672013a05cf5ecd6f5fa7e7221ecf2.tar.bz2
meta-mlinux-04474efccc672013a05cf5ecd6f5fa7e7221ecf2.zip
Merge remote-tracking branch 'origin/6' into mpower-dev-nxp
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/multitech/config/config.init37
1 files changed, 20 insertions, 17 deletions
diff --git a/recipes-core/multitech/config/config.init b/recipes-core/multitech/config/config.init
index 2a1e0b5..f4611ab 100644
--- a/recipes-core/multitech/config/config.init
+++ b/recipes-core/multitech/config/config.init
@@ -1,5 +1,5 @@
#!/bin/sh
-
+set -x
CONFIG_DIR=/var/config
RUN_CONF_DIR=/run/config
@@ -163,7 +163,7 @@ function copydir {
links+=(${f})
continue
fi
- if ! [[ -f "$to/$f" ]] ; then
+ if ! [[ -f "$to/${newdir}/$f" ]] ; then
cp -a "${f}" "$to/${newdir}/${f}"
fi
done
@@ -222,14 +222,13 @@ case $1 in
# Create links in /etc
for file in $FILES; do
if ! [[ -L /etc/$file ]] && ! [[ -d /etc/$file ]] ; then
- rm -rf /etc/$file
- ln -sf ${CONFIG_DIR}/$file /etc/$file
- elif [[ -d /etc/$file ]] ; then
- # JAK create links in directory.
- linkdir "${CONFIG_DIR}/${file}" "/etc/${file}"
+ rm -rf /etc/$file
+ ln -sf ${CONFIG_DIR}/$file /etc/$file
+ elif [[ -d /etc/$file ]] ; then
+ linkdir "${CONFIG_DIR}/${file}" "/etc/${file}"
fi
done
-
+
# Move bluetooth wifi stuff to config directory.
# We don't have factory defaults.
((dobackup=1))
@@ -248,19 +247,21 @@ case $1 in
# We must copy individual files and create symlinks instead.
for file in ${BTWIFIFILES}; do
isdir=0
- # If last character is /, make the CONFIG directory.
+ # If last character is /, make the CONFIG directory.
if [[ ${file: -1} == / ]] ; then
isdir=1
file=${file%?}
- if ! [[ -d ${CONFIG_DIR}/$file ]] ; then
+ if ! [[ -d ${CONFIG_DIR}/$file ]] ; then
rm -f ${CONFIG_DIR}/$file 2>/dev/null || true
- mkdir ${CONFIG_DIR}/$file
- fi
- if [[ -d ${file} ]] ; then
+ mkdir ${CONFIG_DIR}/$file
+ ln -sf ${CONFIG_DIR}/$file /etc/$file 2>/dev/null || true
+ fi
+
+ if [[ -d ${file} ]] && [[ -d /etc/${file} ]] ; then
copydir "/etc/${file}" "${CONFIG_DIR}"
fi
- fi
-
+ fi
+
if ((isdir == 0)); then
dir=$(dirname $file)
if [[ $dir != '.' ]] ; then
@@ -287,8 +288,10 @@ case $1 in
)
rm -rf old
fi
- rm -rf /etc/$file
- ln -sf ${CONFIG_DIR}/$file /etc/$file
+ if [[ -e /etc/$file ]] ; then
+ rm -rf /etc/$file
+ ln -sf ${CONFIG_DIR}/$file /etc/$file
+ fi
else
if ! [[ -L "/etc/${file}" ]] ; then
rm -f "/etc/${file}/*"