summaryrefslogtreecommitdiffstats
path: root/system-boot/components/2010-remove-persistence
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsystem-boot/components/2010-remove-persistence31
1 files changed, 31 insertions, 0 deletions
diff --git a/system-boot/components/2010-remove-persistence b/system-boot/components/2010-remove-persistence
new file mode 100755
index 0000000..717a408
--- /dev/null
+++ b/system-boot/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 /run/live/overlay && find . -not -name 'persistence.conf' | xargs rm -rf
+}