From owner-svn-src-all@FreeBSD.ORG Thu Apr 23 01:04:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEC66D06; Thu, 23 Apr 2015 01:04:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FF531F51; Thu, 23 Apr 2015 01:04:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3N14FmK011241; Thu, 23 Apr 2015 01:04:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3N14FfQ011235; Thu, 23 Apr 2015 01:04:15 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201504230104.t3N14FfQ011235@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 23 Apr 2015 01:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281876 - in head/release: scripts tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2015 01:04:15 -0000 Author: gjb Date: Thu Apr 23 01:04:14 2015 New Revision: 281876 URL: https://svnweb.freebsd.org/changeset/base/281876 Log: 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 Modified: head/release/scripts/mk-vmimage.sh head/release/tools/vmimage.subr Modified: head/release/scripts/mk-vmimage.sh ============================================================================== --- head/release/scripts/mk-vmimage.sh Wed Apr 22 22:23:56 2015 (r281875) +++ head/release/scripts/mk-vmimage.sh Thu Apr 23 01:04:14 2015 (r281876) @@ -93,6 +93,16 @@ main() { . "${VMCONFIG}" fi + case ${TARGET}:${TARGET_ARCH} in + arm64:aarch64) + ROOTLABEL="ufs" + NOSWAP=1 + ;; + *) + ROOTLABEL="gpt" + ;; + esac + vm_create_base vm_install_base vm_extra_install_base Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Wed Apr 22 22:23:56 2015 (r281875) +++ head/release/tools/vmimage.subr Thu Apr 23 01:04:14 2015 (r281876) @@ -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' \