Use UUID instead of device path for boot partition

This commit is contained in:
gardouille 2020-10-19 18:12:45 +02:00
parent a58cff12bd
commit 2596c370a3
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 2 additions and 1 deletions

View File

@ -129,8 +129,9 @@ mountpoint -q /target || mount -- /dev/mapper/"${vgname}"-root /targe
### boot - grub
mkdir -p -- /target/boot
mountpoint -q /target/boot || mount -- ${hdd}1 /target/boot
boot_uuid=$(blkid | grep "${hdd}1" | sed 's/.*1.*UUID="\(.*\)" TYPE.*/\1/')
### Prepare an fstab file
printf '%b\n' "${hdd}1 /boot ext3 defaults 0 0" > /tmp/target.fstab
printf '%b\n' "UUID=${boot_uuid} /boot ext3 defaults 0 0" > /tmp/target.fstab
### Prepare the base system tree according to the expected file system
if [ "${manage_btrfs}" -eq 0 ]; then