use bash var sub instead of sed

This commit is contained in:
i-c-u-p 2022-04-29 08:44:25 +00:00
parent c7536cef0e
commit 4c5ea199c4
No known key found for this signature in database
GPG key ID: ABB80C12170FC0D1

View file

@ -323,7 +323,7 @@ mountopts="ssd,noatime,compress-force=zstd:3,discard=async"
mount -o $mountopts,subvol=@ $BTRFS /mnt
mkdir -p /mnt/{home,root,srv,.snapshots,var/{log,cache/pacman/pkg},boot}
for subvol in "${subvols[@]:2}"; do # ":2" excludes first two subvols (@snapshots and @var_pkgs) from loop
mount -o "$mountopts",subvol=@"$subvol" "$BTRFS" /mnt/"$(sed 's,_,/,g' <<< "$subvol")"
mount -o "$mountopts",subvol=@"$subvol" "$BTRFS" /mnt/"${subvol//_//}"
done
chmod 750 /mnt/root
mount -o $mountopts,subvol=@snapshots $BTRFS /mnt/.snapshots