Use UUID for fstab in virtual machine builds.
This solves issues when booting virtio-type drives.
This commit is contained in:
parent
580fecb67c
commit
e2876ea69f
|
|
@ -81,13 +81,13 @@ build_vm_dist()
|
||||||
notice "Building complete VM image(s)"
|
notice "Building complete VM image(s)"
|
||||||
|
|
||||||
bootstrap_complete_base || { zerr; return 1; }
|
bootstrap_complete_base || { zerr; return 1; }
|
||||||
vm_inject_overrides || { zerr; return 1; }
|
|
||||||
blend_preinst || { zerr; return 1; }
|
blend_preinst || { zerr; return 1; }
|
||||||
image_prepare_raw || { zerr; return 1; }
|
image_prepare_raw || { zerr; return 1; }
|
||||||
image_connect_raw || { zerr; return 1; }
|
image_connect_raw || { zerr; return 1; }
|
||||||
image_partition_${parted_type} || { zerr; return 1; }
|
image_partition_${parted_type} || { zerr; return 1; }
|
||||||
image_format_partitions || { zerr; return 1; }
|
image_format_partitions || { zerr; return 1; }
|
||||||
image_mount || { zerr; return 1; }
|
image_mount || { zerr; return 1; }
|
||||||
|
vm_inject_overrides || { zerr; return 1; }
|
||||||
strapdir_to_image || { zerr; return 1; }
|
strapdir_to_image || { zerr; return 1; }
|
||||||
vm_setup_grub || { zerr; return 1; }
|
vm_setup_grub || { zerr; return 1; }
|
||||||
blend_postinst || { zerr; return 1; }
|
blend_postinst || { zerr; return 1; }
|
||||||
|
|
|
||||||
8
zlibs/vm
8
zlibs/vm
|
|
@ -21,13 +21,17 @@ vars+=(vmname)
|
||||||
vm_inject_overrides()
|
vm_inject_overrides()
|
||||||
{
|
{
|
||||||
fn vm_inject_overrides
|
fn vm_inject_overrides
|
||||||
req=(strapdir bootfs)
|
req=(strapdir bootfs rootfs bootpart rootpart)
|
||||||
ckreq || return 1
|
ckreq || return 1
|
||||||
|
|
||||||
notice "Injecting rootfs overrides"
|
notice "Injecting rootfs overrides"
|
||||||
|
|
||||||
|
bootuuid="$(lsblk "$bootpart" -no UUID)"
|
||||||
|
rootuuid="$(lsblk "$rootpart" -no UUID)"
|
||||||
|
|
||||||
cat <<EOF | sudo tee -a "$strapdir/etc/fstab" >/dev/null
|
cat <<EOF | sudo tee -a "$strapdir/etc/fstab" >/dev/null
|
||||||
/dev/sda1 /boot ${bootfs} defaults 0 1
|
UUID=${rootuuid} / ${rootfs} defaults 0 1
|
||||||
|
UUID=${bootuuid} /boot ${bootfs} defaults 0 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF | sudo tee "$strapdir/etc/rc.local" >/dev/null
|
cat <<EOF | sudo tee "$strapdir/etc/rc.local" >/dev/null
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue