From cf57e4b483e70c050c1390416a3b4c22afcb6a72 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Tue, 16 Oct 2018 22:45:23 +0300 Subject: [PATCH] init: fix conf script sourcing when no data partition available --- board/common/overlay/etc/init.d/conf | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/board/common/overlay/etc/init.d/conf b/board/common/overlay/etc/init.d/conf index 39abf427ae..dc71091fb9 100644 --- a/board/common/overlay/etc/init.d/conf +++ b/board/common/overlay/etc/init.d/conf @@ -4,6 +4,17 @@ _sys_conf="/etc/os.conf" _boot_conf="/boot/os.conf" _conf="/data/etc/os.conf" +if ! [ -d /data/etc ]; then + # use boot/system variants if we don't have the data partition mounted + if [ -f $_boot_conf ]; then + source $_boot_conf + elif [ -f $_sys_conf ]; then + source $_sys_conf + fi + + return +fi + if ! [ -f $_conf ]; then if [ -f $_boot_conf ]; then cp $_boot_conf $_conf @@ -12,5 +23,7 @@ if ! [ -f $_conf ]; then fi fi -source $_conf +if [ -f $_conf ]; then + source $_conf +fi