Fedora image: use UUIDs in /etc/fstab

This commit is contained in:
fnux 2019-12-05 11:40:55 +01:00
parent 177e50498c
commit 98cc55d01e

View file

@ -135,10 +135,11 @@ run_root dnf -y install openssh-server
run_root systemctl enable sshd
# Generate fstab file.
# TODO: use UIDs instead of /dev/vdaX, current scheme is very fragile.
boot_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p1")
root_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p2")
cat >>/mnt/etc/fstab <<EOF
/dev/sda1 /boot ext4 rw,relatime,data=ordered 0 2
/dev/sda2 / ext4 rw,relatime,data=ordered 0 1
UUID=$boot_uuid /boot ext4 rw,relatime,data=ordered 0 2
UUID=$root_uuid / ext4 rw,relatime,data=ordered 0 1
EOF
# Make sure everything is written to disk before exiting.