summaryrefslogtreecommitdiff
path: root/src/opt/vyatta/sbin/vyos-persistpath
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-06-30 07:35:25 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-07-03 15:05:02 +0000
commit7aa420e5a5509793030350acb9c108eaef6c79ea (patch)
tree5318e1a5d2ff7fc3b7e0cf7e4a647c85fa9bfe07 /src/opt/vyatta/sbin/vyos-persistpath
parent3817a83f0af6f7a97e1fb822d0e5da844068100f (diff)
downloadvyos-1x-7aa420e5a5509793030350acb9c108eaef6c79ea.tar.gz
vyos-1x-7aa420e5a5509793030350acb9c108eaef6c79ea.zip
T6527: add legacy Vyatta interpreter files still in use
(cherry picked from commit 72a704d2e2b06bfedc4f1ee841814f983fc34baa)
Diffstat (limited to 'src/opt/vyatta/sbin/vyos-persistpath')
-rwxr-xr-xsrc/opt/vyatta/sbin/vyos-persistpath19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/opt/vyatta/sbin/vyos-persistpath b/src/opt/vyatta/sbin/vyos-persistpath
new file mode 100755
index 000000000..d7199b09a
--- /dev/null
+++ b/src/opt/vyatta/sbin/vyos-persistpath
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+if grep -q -e '^overlay.*/filesystem.squashfs' /proc/mounts; then
+ # Live CD boot
+ exit 2
+
+elif grep -q 'upperdir=/live/persistence/' /proc/mounts && egrep -q 'overlay / overlay ' /proc/mounts; then
+ # union boot
+
+ boot_device=`grep -o 'upperdir=/live/persistence/[^/]*/boot' /proc/mounts | cut -d / -f 4`
+ persist_path="/lib/live/mount/persistence/$boot_device"
+
+ echo $persist_path
+ exit 0
+else
+ # old style boot
+
+ exit 1
+fi \ No newline at end of file