From acca93a9e48a833321f7fc662aed68593af76c66 Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Fri, 4 Jan 2019 17:16:10 +1100 Subject: [PATCH] always copy /boot/wpa_supplicant.conf during startup --- board/common/overlay/etc/init.d/S35wifi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/board/common/overlay/etc/init.d/S35wifi b/board/common/overlay/etc/init.d/S35wifi index 7ab6635531..60ec787932 100755 --- a/board/common/overlay/etc/init.d/S35wifi +++ b/board/common/overlay/etc/init.d/S35wifi @@ -22,10 +22,17 @@ fi source $watch_conf +if [[ -f $boot_conf ]]; then + cp -f $boot_conf $conf + grep -E "/boot .*ro[\s,]" /proc/mounts + RO=$? + test $RO == 0 && mount -o remount,rw /boot + rm -f $boot_conf + test $RO == 0 && mount -o remount,ro /boot +fi + if ! [[ -f $conf ]]; then - if [[ -f $boot_conf ]]; then - cp $boot_conf $conf - elif [[ -f $sys_conf ]]; then + if [[ -f $sys_conf ]]; then cp $sys_conf $conf fi fi