init: fix conf script sourcing when no data partition available

This commit is contained in:
Calin Crisan 2018-10-16 22:45:23 +03:00
parent 5281a3dfe6
commit cf57e4b483

View File

@ -4,6 +4,17 @@ _sys_conf="/etc/os.conf"
_boot_conf="/boot/os.conf" _boot_conf="/boot/os.conf"
_conf="/data/etc/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 $_conf ]; then
if [ -f $_boot_conf ]; then if [ -f $_boot_conf ]; then
cp $_boot_conf $_conf cp $_boot_conf $_conf
@ -12,5 +23,7 @@ if ! [ -f $_conf ]; then
fi fi
fi fi
source $_conf if [ -f $_conf ]; then
source $_conf
fi