summaryrefslogtreecommitdiff
path: root/components/2010-remove-persistence
diff options
context:
space:
mode:
authorTom Jampen <tom@cryptography.ch>2014-12-15 15:17:04 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2015-01-04 21:51:16 +0100
commit73d837abfd95add4e0792ef27df8c7eea8a7388f (patch)
tree912cd5158dfa3ccb2902c2da19863a64801bfae6 /components/2010-remove-persistence
parent3a68424fa4d5372cc0fc60d07f58867d41ddcafc (diff)
downloadlive-boot-73d837abfd95add4e0792ef27df8c7eea8a7388f.tar.gz
live-boot-73d837abfd95add4e0792ef27df8c7eea8a7388f.zip
Adding command line parameter to remove persistence.
Diffstat (limited to 'components/2010-remove-persistence')
-rwxr-xr-xcomponents/2010-remove-persistence31
1 files changed, 31 insertions, 0 deletions
diff --git a/components/2010-remove-persistence b/components/2010-remove-persistence
new file mode 100755
index 0000000..5dcf0c0
--- /dev/null
+++ b/components/2010-remove-persistence
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+#set -e
+
+Remove_persistence ()
+{
+ for _PARAMETER in ${LIVE_BOOT_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ live-boot.persistence-remove=*|persistence-remove=*)
+ LIVE_PERSISTENCE_REMOVE="${_PARAMETER#*persistence-remove=}"
+ ;;
+
+ live-boot.persistence-remove|persistence-remove)
+ LIVE_PERSISTENCE_REMOVE="true"
+ ;;
+ esac
+ done
+
+ case "${LIVE_PERSISTENCE_REMOVE}" in
+ true)
+ ;;
+
+ *)
+ return 0
+ ;;
+ esac
+
+ # Remove persistence
+ cd /live/overlay && find . -not -name 'persistence.conf' | xargs rm -rf
+}