stage-1-init: add boot.persistence option
This option allows replacing the tmpfs mounted on / by the live CD's init script with a physical device Since nixOS symlinks everything there's no trouble at all. That enables the user to easily use a nixOS live CD as a portable installation. Note that due to some limitations in how the store is mounted currently only the non-store things are persisted.
This commit is contained in:
parent
4c23f68699
commit
948de104de
@ -144,6 +144,14 @@ for o in $(cat /proc/cmdline); do
|
|||||||
set -- $(IFS==; echo $o)
|
set -- $(IFS==; echo $o)
|
||||||
stage2Init=$2
|
stage2Init=$2
|
||||||
;;
|
;;
|
||||||
|
boot.persistence=*)
|
||||||
|
set -- $(IFS==; echo $o)
|
||||||
|
persistence=$2
|
||||||
|
;;
|
||||||
|
boot.persistence.opt=*)
|
||||||
|
set -- $(IFS==; echo $o)
|
||||||
|
persistence_opt=$2
|
||||||
|
;;
|
||||||
boot.trace|debugtrace)
|
boot.trace|debugtrace)
|
||||||
# Show each command.
|
# Show each command.
|
||||||
set -x
|
set -x
|
||||||
@ -534,6 +542,14 @@ while read -u 3 mountPoint; do
|
|||||||
continue
|
continue
|
||||||
fi
|
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"
|
mountFS "$device" "$mountPoint" "$options" "$fsType"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user