X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=mount-latest-subvol;h=1b0a8e23123201182ac5eb0d7a99ca626f982652;hb=86ebcd0416223ded297f6cbbcb0906b85793e359;hp=e4c4d6b0a652b992f6feb7483cecd394bbf1040c;hpb=78b46528ee55117d3339cc5730585276dddf5a4b;p=distro-setup diff --git a/mount-latest-subvol b/mount-latest-subvol index e4c4d6b..1b0a8e2 100644 --- a/mount-latest-subvol +++ b/mount-latest-subvol @@ -73,17 +73,25 @@ mnt() { e mount $dir fi } +fstab() { + while read -r start mpoint end; do + l="$start $mpoint $end" + # kill off any lines that duplicate the mount point. + sed --follow-symlinks -ri "\%$l%b;\%^\s*\S+\s+$mpoint\s%d" /etc/fstab + tu /etc/fstab <<<"$l" + done +} ret=0 ##### begin setup fstab for subvols we care about ###### first_root_crypt=$(awk '$2 == "/" {print $1}' /etc/mtab) -tu /etc/fstab <