-# mkroot2: for running outside of fai and setting up the root2/boot2 luks and btrfs
+# mkroot2: for running outside of fai and setting up the root2/boot2 luks and btrfs and tab files
+#
+# mkroot2tab: for running outside of fai and setting up the root2/boot2 tab files, in case luks and btrfs
+# happen to already be setup.
+#
# because these are filesystems created after our current root, and so
# this allows us to update other root filesystems too.
rm -f /mnt/root/root2-{fs,crypt}tab
# because these are filesystems created after our current root, and so
# this allows us to update other root filesystems too.
rm -f /mnt/root/root2-{fs,crypt}tab
cat >>/mnt/root/root2-crypttab <<EOF
$(root2-cryptname) $(root2dev) $luks_file discard,luks,initramfs
EOF
done
cat >>/mnt/root/root2-crypttab <<EOF
$(root2-cryptname) $(root2dev) $luks_file discard,luks,initramfs
EOF
done
mkdir -p /mnt/root2 /mnt/boot2
cat >>/mnt/root/root2-fstab <<EOF
$(root2-cryptdev ${devs[0]}) /mnt/root2 btrfs nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,subvolid=0$mopts 0 0
mkdir -p /mnt/root2 /mnt/boot2
cat >>/mnt/root/root2-fstab <<EOF
$(root2-cryptdev ${devs[0]}) /mnt/root2 btrfs nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,subvolid=0$mopts 0 0