done
dir=/nocow
-l=$(sed -rn "s#^(\s*\S+\s+)/q(\s.*)(subvol=q)#\1$dir\2subvol=nocow#p" /etc/fstab)
-if [[ $l ]] && ! mountpoint $dir; then
+if ! mountpoint $dir; then
+ subvol=/mnt/root/nocow
+ if [[ ! -e nocow ]]; then
+ btrfs subvolume create $subvol
+ chown root:1000 $subvol
+ chattr +C $subvol
+ fi
+
+ first_root_crypt=$(awk '$2 == "/" {print $1}' /etc/mtab)
tu /etc/fstab <<EOF
-$l
+$first_root_crypt /nocow btrfs noatime,subvol=nocow 0 0
EOF
s mkdir -p $dir
s chown ian:ian $dir
# I haven't gotten around to getting a non-debian exim
# setup.
mail-setup exim4
-else
- mail-setup postfix
+ else
+ mail-setup postfix
fi
-if isubuntu; then
- # disable crash report annoying crap
- s dd of=/etc/default/apport <<<'enabled=0'
-fi
+ if isubuntu; then
+ # disable crash report annoying crap
+ s dd of=/etc/default/apport <<<'enabled=0'
+ fi
# fai sets this an old way that doesn't work for stretch.
# no harm in setting it universally here.