Release new version 1:20210208+grml.5
[live-boot-grml.git] / components / 2010-remove-persistence
1 #!/bin/sh
2
3 #set -e
4
5 Remove_persistence ()
6 {
7         for _PARAMETER in ${LIVE_BOOT_CMDLINE}
8         do
9                 case "${_PARAMETER}" in
10                         live-boot.persistence-remove=*|persistence-remove=*)
11                                 LIVE_PERSISTENCE_REMOVE="${_PARAMETER#*persistence-remove=}"
12                                 ;;
13
14                         live-boot.persistence-remove|persistence-remove)
15                                 LIVE_PERSISTENCE_REMOVE="true"
16                                 ;;
17                 esac
18         done
19
20         case "${LIVE_PERSISTENCE_REMOVE}" in
21                 true)
22                         ;;
23
24                 *)
25                         return 0
26                         ;;
27         esac
28
29         # Remove persistence
30         cd /run/live/overlay && find . -not -name 'persistence.conf' | xargs rm -rf
31 }