summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorApachez <apachez@gmail.com>2023-10-27 17:57:30 +0200
committerApachez <apachez@gmail.com>2023-10-27 17:57:30 +0200
commite56e22903d703e21346a8bdba89a6d80f5af67dd (patch)
tree3072762e2fa16d373517dcf5db1633e3cb437c01
parent6048984c7ce008e235b9d1f01c41ded95f0ebcc6 (diff)
downloadvyatta-op-e56e22903d703e21346a8bdba89a6d80f5af67dd.tar.gz
vyatta-op-e56e22903d703e21346a8bdba89a6d80f5af67dd.zip
T5693: Adding variable vyos_persistence_dir (and improve variable vyos_rootfs_dir)
-rw-r--r--etc/default/vyatta.in13
1 files changed, 5 insertions, 8 deletions
diff --git a/etc/default/vyatta.in b/etc/default/vyatta.in
index 1c7759e..909f124 100644
--- a/etc/default/vyatta.in
+++ b/etc/default/vyatta.in
@@ -137,7 +137,6 @@ unset _vyatta_extglob
declare -x -r vyatta_sysconfdir=$vyatta_prefix/etc
fi
fi
-
if test -z "$vyatta_op_templates" ; then
declare -x -r vyatta_op_templates=$vyatta_datadir/vyatta-op/templates
declare -x -r vyos_op_templates=$vyatta_datadir/vyatta-op/templates
@@ -163,24 +162,23 @@ unset _vyatta_extglob
if test -z "$vyos_conf_scripts_dir" ; then
declare -x -r vyos_conf_scripts_dir=$vyos_libexec_dir/conf_mode
fi
-
if test -z "$vyos_op_scripts_dir" ; then
declare -x -r vyos_op_scripts_dir=$vyos_libexec_dir/op_mode
fi
-
if test -z "$vyos_completion_dir" ; then
declare -x -r vyos_completion_dir=$vyos_libexec_dir/completion
fi
-
if test -z "$vyos_validators_dir" ; then
declare -x -r vyos_validators_dir=$vyos_libexec_dir/validators
fi
-
+ if test -z "$vyos_persistence_dir" ; then
+ UNION_NAME=$(cat /proc/cmdline | sed -e s+^.*vyos-union=++ | sed -e 's/ .*$//')
+ declare -x -r vyos_persistence_dir="/usr/lib/live/mount/persistence/${UNION_NAME}"
+ fi
if test -z "$vyos_rootfs_dir" ; then
- ROOTFS=$(mount -t squashfs | cut -d' ' -f3)
+ ROOTFS=$(mount -t squashfs | grep loop0 | cut -d' ' -f3)
declare -x -r vyos_rootfs_dir="${ROOTFS}"
fi
-
if test -z "$VRF" ; then
VRF=$(ip vrf identify)
[ -n "$VRF" ] && declare -x -r VRF="${VRF}"
@@ -190,7 +188,6 @@ unset _vyatta_extglob
[ -n "$NETNS" ] && declare -x -r NETNS="${NETNS}"
fi
-
} 2>/dev/null || :
[ -r /etc/default/vyatta-cfg ] && source /etc/default/vyatta-cfg