diff options
author | Christian Breunig <christian@breunig.cc> | 2023-11-08 07:01:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-08 07:01:16 +0100 |
commit | 28c670bf1911ec0f3fff5b6fff6cdbd91e98a318 (patch) | |
tree | 920a2159e942cc94545063e8995a410863f6915d | |
parent | b0221ee32239413cbc242d9eab8dc915ad7c7955 (diff) | |
parent | e56e22903d703e21346a8bdba89a6d80f5af67dd (diff) | |
download | vyatta-op-28c670bf1911ec0f3fff5b6fff6cdbd91e98a318.tar.gz vyatta-op-28c670bf1911ec0f3fff5b6fff6cdbd91e98a318.zip |
Merge pull request #79 from Apachez-/T5693
T5693: Adding variable vyos_persistence_dir (and improve variable vyos_rootfs_dir)
-rw-r--r-- | etc/default/vyatta.in | 13 |
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 |