summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-11-30 16:40:03 -0600
committerJohn Klug <john.klug@multitech.com>2017-11-30 16:41:01 -0600
commit7ff6d720b2c531494b0ac8e4fc8b386565c65d6f (patch)
treebbaf3e6e70508f542c27ce987fa10721875c1099
parent3efbbeb47271d42135243f2609a52905eee99ee7 (diff)
downloadmeta-mlinux-7ff6d720b2c531494b0ac8e4fc8b386565c65d6f.tar.gz
meta-mlinux-7ff6d720b2c531494b0ac8e4fc8b386565c65d6f.tar.bz2
meta-mlinux-7ff6d720b2c531494b0ac8e4fc8b386565c65d6f.zip
Preserve wifi and bluetooth settings during upgrade.
-rw-r--r--recipes-connectivity/hostapd/hostap-daemon-2.6/default4
-rwxr-xr-xrecipes-connectivity/hostapd/hostap-daemon-2.6/init6
-rw-r--r--recipes-core/multitech/config/config.init28
3 files changed, 38 insertions, 0 deletions
diff --git a/recipes-connectivity/hostapd/hostap-daemon-2.6/default b/recipes-connectivity/hostapd/hostap-daemon-2.6/default
index 0923a8c..afc965d 100644
--- a/recipes-connectivity/hostapd/hostap-daemon-2.6/default
+++ b/recipes-connectivity/hostapd/hostap-daemon-2.6/default
@@ -1,2 +1,6 @@
# set to "yes" to start hostapd on boot
START_ON_BOOT="no"
+# Stuff to creat the device if needed.
+DEV=wifi1
+PREUP="[[ -d /sys/class/net/${DEV} ]] || /opt/rs9113/onebox_util rpine0 create_vap ${DEV} ap"
+POSTUP="ifup wifi1"
diff --git a/recipes-connectivity/hostapd/hostap-daemon-2.6/init b/recipes-connectivity/hostapd/hostap-daemon-2.6/init
index 12ea944..bb3319b 100755
--- a/recipes-connectivity/hostapd/hostap-daemon-2.6/init
+++ b/recipes-connectivity/hostapd/hostap-daemon-2.6/init
@@ -13,11 +13,17 @@ set -e
case "$1" in
start)
+ if [[ -n $PREUP ]] ; then
+ bash -c "$PREUP"
+ fi
if [ "$START_ON_BOOT" != "yes" ]; then
exit 0
fi
echo -n "Starting $DESC: "
start-stop-daemon -S -x $DAEMON -- $ARGS
+ if [[ -n $POSTUP ]] ; then
+ bash -c "$POSTUP"
+ fi
echo "$NAME."
;;
stop)
diff --git a/recipes-core/multitech/config/config.init b/recipes-core/multitech/config/config.init
index 874416c..2a40c16 100644
--- a/recipes-core/multitech/config/config.init
+++ b/recipes-core/multitech/config/config.init
@@ -15,6 +15,19 @@ ppp/chap-secrets \
ppp/peers \
"
+# Files used by bluetooth or wifi.
+BTWIFIFILES="\
+bluetooth
+default/rs9113 \
+default/hostapd \
+dnsmasq.d \
+hosts \
+hostname \
+hostapd.conf \
+modprobe.d \
+wpa_supplicant.conf \
+"
+
mount_config() {
echo "Mounting ${CONFIG_DIR}"
mkdir -p ${CONFIG_DIR}
@@ -94,6 +107,21 @@ case $1 in
ln -sf ${CONFIG_DIR}/$file /etc/$file
fi
done
+
+ # Move bluetooth wifi stuff to config directory.
+ # We don't have factory defaults.
+ for file in ${BTWIFIFILES}; do
+ if [[ ! -L /etc/$file ]]; then
+ echo "Creating link to ${CONFIG_DIR}/$file"
+ dir=$(dirname $file)
+ if [[ $dir != '.' ]] ; then
+ mkdir -p "$dir"
+ fi
+ mv /etc/$file ${CONFIG_DIR}/$file
+ ln -sf ${CONFIG_DIR}/$file /etc/$file
+ fi
+ done
+
;;