diff options
author | Richard Marko <srk@48.io> | 2018-02-17 23:33:24 +0100 |
---|---|---|
committer | Richard Marko <srk@48.io> | 2020-02-05 10:35:59 +0100 |
commit | 0c20feb231eb9a98bcf8b7ee3f2876302437e8ca (patch) | |
tree | a51c9b8663fd8bc1e7c5187cf71f8d9882cc63ba /nixos/modules/system | |
parent | eacc771f72beeb77317c1661cb6ce8cc7aa99445 (diff) | |
download | nixlib-0c20feb231eb9a98bcf8b7ee3f2876302437e8ca.tar nixlib-0c20feb231eb9a98bcf8b7ee3f2876302437e8ca.tar.gz nixlib-0c20feb231eb9a98bcf8b7ee3f2876302437e8ca.tar.bz2 nixlib-0c20feb231eb9a98bcf8b7ee3f2876302437e8ca.tar.lz nixlib-0c20feb231eb9a98bcf8b7ee3f2876302437e8ca.tar.xz nixlib-0c20feb231eb9a98bcf8b7ee3f2876302437e8ca.tar.zst nixlib-0c20feb231eb9a98bcf8b7ee3f2876302437e8ca.zip |
use overlayfs by default for netboot and iso
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/stage-1-init.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index f520bf54ad1b..8736613c3d25 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -334,8 +334,10 @@ mountFS() { # Filter out x- options, which busybox doesn't do yet. local optionsFiltered="$(IFS=,; for i in $options; do if [ "${i:0:2}" != "x-" ]; then echo -n $i,; fi; done)" + # Prefix (lower|upper|work)dir with /mnt-root (overlayfs) + local optionsPrefixed="$( echo "$optionsFiltered" | sed -E 's#\<(lowerdir|upperdir|workdir)=#\1=/mnt-root#g' )" - echo "$device /mnt-root$mountPoint $fsType $optionsFiltered" >> /etc/fstab + echo "$device /mnt-root$mountPoint $fsType $optionsPrefixed" >> /etc/fstab checkFS "$device" "$fsType" @@ -354,10 +356,11 @@ mountFS() { ;; esac - # Create backing directories for unionfs-fuse. - if [ "$fsType" = unionfs-fuse ]; then - for i in $(IFS=:; echo ${options##*,dirs=}); do - mkdir -m 0700 -p /mnt-root"${i%=*}" + # Create backing directories for overlayfs + if [ "$fsType" = overlay ]; then + for i in upper work; do + dir="$( echo "$optionsPrefixed" | grep -o "${i}dir=[^,]*" )" + mkdir -m 0700 -p "${dir##*=}" done fi |