diff options
author | gjb <gjb@FreeBSD.org> | 2015-04-23 01:04:14 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2015-04-23 01:04:14 +0000 |
commit | 09615c77fe4f508ba3b0f582beab97b63ddedf18 (patch) | |
tree | 9607905389472283ff3a3364d44593b216534d8b /release/tools | |
parent | 848d56ad43c9c07400271f412fb21883fc5cd3d9 (diff) | |
download | FreeBSD-src-09615c77fe4f508ba3b0f582beab97b63ddedf18.zip FreeBSD-src-09615c77fe4f508ba3b0f582beab97b63ddedf18.tar.gz |
Create the arm64/aarch64 VM disk image as MBR instead of
GPT scheme. UEFI needs to know the unique partition GUID
with GPT, which changes each time. Specifically, the QEMU
EFI BIOS file has this hard-coded.[1]
Since the GPT labels are now unavailable, unconditionally
label the root filesystem as 'rootfs' with newfs(8), since
it does not hurt anything anywhere else. For the arm64 case,
'/' is mounted from /dev/ufs/rootfs; for all other VM images,
'/' is mounted from /dev/gpt/rootfs.
Unfortunately, since the /dev/gpt/swapfs label is also lost,
set NOSWAP=1 for the arm64/aarch64 images. This is temporary,
until I figure out a scalable solution to this. But, a certain
piece of softare was written "very fast", and ended up living
for 15 years. We can deal with this for a week or so.
Information from: andrew, emaste [1]
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'release/tools')
-rw-r--r-- | release/tools/vmimage.subr | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 1a295e5..fa6db41 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -30,10 +30,9 @@ write_partition_layout() { -o ${VMIMAGE} ;; arm64:aarch64) - mkimg -s gpt \ - -p efi/efiboot:=${BOOTFILES}/efi/boot1/boot1.efifat \ - ${SWAPOPT} \ - -p freebsd-ufs/rootfs:=${VMBASE} \ + mkimg -s mbr \ + -p efi:=${BOOTFILES}/efi/boot1/boot1.efifat \ + -p freebsd:=${VMBASE} \ -o ${VMIMAGE} ;; powerpc:powerpc*) @@ -77,7 +76,7 @@ vm_create_base() { mkdir -p ${DESTDIR} truncate -s ${VMSIZE} ${VMBASE} mddev=$(mdconfig -f ${VMBASE}) - newfs /dev/${mddev} + newfs -L rootfs /dev/${mddev} mount /dev/${mddev} ${DESTDIR} return 0 @@ -97,7 +96,7 @@ vm_copy_base() { truncate -s ${VMSIZE} ${VMBASE}.tmp mkdir -p ${DESTDIR}/new mdnew=$(mdconfig -f ${VMBASE}.tmp) - newfs /dev/${mdnew} + newfs -L rootfs /dev/${mdnew} mount /dev/${mdnew} ${DESTDIR}/new tar -cf- -C ${DESTDIR}/old . | tar -xUf- -C ${DESTDIR}/new @@ -123,7 +122,7 @@ vm_install_base() { echo '# Custom /etc/fstab for FreeBSD VM images' \ > ${DESTDIR}/etc/fstab - echo '/dev/gpt/rootfs / ufs rw 1 1' \ + echo "/dev/${ROOTLABEL}/rootfs / ufs rw 1 1" \ >> ${DESTDIR}/etc/fstab if [ -z "${NOSWAP}" ]; then echo '/dev/gpt/swapfs none swap sw 0 0' \ |