diff options
author | worldofpeace <worldofpeace@protonmail.ch> | 2020-07-30 14:56:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 14:56:06 -0400 |
commit | b21c16fc5e53fa7f7298ea734b4d8baffd1d1720 (patch) | |
tree | 3ef6c9050ccfd9fb813714a73e75ba51b29a2fbf | |
parent | 08bc533dc66179c70c80cc941fc257741282ae84 (diff) | |
parent | 948de104de09cc27184d97aed2fe3b758133cc8e (diff) |
Merge pull request #83911 from mkg20001/boot-persistence
stage-1-init: add boot.persistence option
-rw-r--r-- | nixos/modules/system/boot/stage-1-init.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index 607aec87f01e..54e3a691b2f8 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -144,6 +144,14 @@ for o in $(cat /proc/cmdline); do set -- $(IFS==; echo $o) stage2Init=$2 ;; + boot.persistence=*) + set -- $(IFS==; echo $o) + persistence=$2 + ;; + boot.persistence.opt=*) + set -- $(IFS==; echo $o) + persistence_opt=$2 + ;; boot.trace|debugtrace) # Show each command. set -x @@ -534,6 +542,14 @@ while read -u 3 mountPoint; do continue fi + if [ "$mountPoint" = / ] && [ "$device" = tmpfs ] && [ ! -z "$persistence" ]; then + echo persistence... + waitDevice "$persistence" + echo enabling persistence... + mountFS "$persistence" "$mountPoint" "$persistence_opt" "auto" + continue + fi + mountFS "$device" "$mountPoint" "$options" "$fsType" done |