diff options
author | Thomas Jepp <tom@tomjepp.co.uk> | 2016-02-03 20:08:16 +0000 |
---|---|---|
committer | Thomas Jepp <tom@tomjepp.co.uk> | 2016-02-03 20:08:16 +0000 |
commit | f54bad96cef6ed52547151bc3a7ef64377f16c3e (patch) | |
tree | a9234409c2eb66af7cc9429a110531712fa569c0 /scripts/vyos-persistpath | |
parent | ac29f8f49a1ee620d07c3c6bdaec97afaeb1ad27 (diff) | |
download | vyatta-cfg-system-f54bad96cef6ed52547151bc3a7ef64377f16c3e.tar.gz vyatta-cfg-system-f54bad96cef6ed52547151bc3a7ef64377f16c3e.zip |
Add vyos-persistpath and update install-image-existing and vyatta-update-grub.pl to use it.
Diffstat (limited to 'scripts/vyos-persistpath')
-rwxr-xr-x | scripts/vyos-persistpath | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/vyos-persistpath b/scripts/vyos-persistpath new file mode 100755 index 00000000..d7199b09 --- /dev/null +++ b/scripts/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 |