From nobody Tue Feb 14 20:44:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGY9l0p7cz3pySk; Tue, 14 Feb 2023 20:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGY9k6WlKz42L6; Tue, 14 Feb 2023 20:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676407498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iwN4JNUmHJWXshm2qFsAMOVR9WODFvXAUKH+YRpvw8Q=; b=W0hXhKtKYyAbDnoTfBZtgJN1jIbAA/IApuEjTBoCPKVvhY+nSJtVQkSjIZFgASrdnaBAWH 1LRVOI3h8XchpKYEbKXl+YyL0ht0EnIRVDH6IH/W8BAAkmUwjx4FqRbDtb+VpVZLdG55A9 Omooihmj3VwjSAD5nNdPWl+cSQgZUFW1SnVF0APrlFWKtxeIKrBZUuOBZNpuIikJ+C+Ntv D7MJGsLcwa5U2xBKRk8IZYW+aiF96LA6b8KK68FWA+7SVpFeQm0GPOO+1FoSI1MOmHIJNi DWYGhSD/CMh8/KXWTp+ZrPittqEzGAF9P9W5KUhapUFSGH/YQrAnRZ25G4ViZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676407498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iwN4JNUmHJWXshm2qFsAMOVR9WODFvXAUKH+YRpvw8Q=; b=niX/TRiTKtSZfPJ4MZKugENjnGwwAIsOYW2TpQohMFkZwkUyB3Esp77Vy1NX/itDTwm4P2 Vc8Kipfua7vIXGhrRmfjYD9e569BWacrRhn3uz4vDHZS1VDPC2sZNyURAxHeguvKBbAJIN x/AAH/YP6IRqV8D7atEAK3hbiDllDsOySWqNRdyHwFXTbOnJ8p8KIPkoT3JCeXupyxIsJB zSKb4pjvCX5afWQjQuYxtOgE7QdEzUitpFS8D+HUS86ZHKa7ocp2oSQpZNi2nuC9vN6l+0 MU/T+/Z0vwjotDDouET3/GilhbBc3djjCw3lNvgEC2llZYUlAkBBZA8+O44e2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676407498; a=rsa-sha256; cv=none; b=s2aSZYz965aakzd453U+pIYHylsZ1u8GAzIf/CiPMxpgaV/rHSGKTZbSX55AZuaW4WE3w6 9VjFh87Y2RhCBp77slr8HPInsY0fFWjOEXYF6uX6XAhJbLPT3fWOnZIBPY/tuoCKcx0EVn 79X66xrSMG/gnFJrMKeWMJrVP4tD4KLuTPlFGde/ZFdoyjfErOmnhwkEFVVVjaQifiRk39 LbK33XWOhWpv7x2gUN7up0fakYnD1zTAEz5ccoMX0z3vrogcoUBGvF1mFLISctHySmREAp 7Wa40Bc7SklYGaqYK9KJGQnSSAocbFBR6ZgxWj2Y/GLCaOvrRtpj/H6Y/p9UJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGY9k5ZgJz1Byy; Tue, 14 Feb 2023 20:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31EKiwui088700; Tue, 14 Feb 2023 20:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EKiw6b088699; Tue, 14 Feb 2023 20:44:58 GMT (envelope-from git) Date: Tue, 14 Feb 2023 20:44:58 GMT Message-Id: <202302142044.31EKiw6b088699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 7b0593fdcbbb - main - Cirrus-CI: use makefs if root size exceeds QEMU's virtual FAT limit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b0593fdcbbb9c73d282fc0024d844c044423b31 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7b0593fdcbbb9c73d282fc0024d844c044423b31 commit 7b0593fdcbbb9c73d282fc0024d844c044423b31 Author: Ed Maste AuthorDate: 2023-02-13 17:39:39 +0000 Commit: Ed Maste CommitDate: 2023-02-14 20:41:01 +0000 Cirrus-CI: use makefs if root size exceeds QEMU's virtual FAT limit We use QEMU's virtual FAT support to avoid having to create a disk image because it is much faster, but it has a limit of about 500MB. Artifacts produced by the GCC 12 CI job exceeded this size. Add support for creating a FAT partition image and MBR-partitioned disk image and use it when the file system is too large for QEMU. In one run the Cirrus-CI LLVM test task took 1m33s using QEMU's virtual FAT while the GCC task took 6m48s using makefs+mkimg. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38589 --- tools/boot/ci-qemu-test.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/boot/ci-qemu-test.sh b/tools/boot/ci-qemu-test.sh index e6481c794af5..b730e9725014 100755 --- a/tools/boot/ci-qemu-test.sh +++ b/tools/boot/ci-qemu-test.sh @@ -21,7 +21,7 @@ die() tempdir_cleanup() { trap - EXIT SIGINT SIGHUP SIGTERM SIGQUIT - rm -rf ${ROOTDIR} + rm -rf ${WORKDIR} } tempdir_setup() @@ -99,18 +99,31 @@ arm64) esac # Create a temp dir to hold the boot image. -ROOTDIR=$(mktemp -d -t ci-qemu-test-fat-root) +WORKDIR=$(mktemp -d -t ci-qemu-test-fat-root) +ROOTDIR=${WORKDIR}/stage-root trap tempdir_cleanup EXIT SIGINT SIGHUP SIGTERM SIGQUIT # Populate the boot image in a temp dir. ( cd ${SRCTOP} && tempdir_setup ) +# Using QEMU's virtual FAT support is much faster than creating a disk image, +# but only supports about 500MB. Fall back to creating a disk image if the +# staged root is too large. +hda="fat:${ROOTDIR}" +rootsize=$(du -skA ${ROOTDIR} | sed 's/[[:space:]].*$//') +if [ $rootsize -gt 512000 ]; then + echo "Root size ${rootsize}K too large for QEMU virtual FAT" >&2 + makefs -t msdos -s 1g $WORKDIR/image.fat $ROOTDIR + mkimg -s mbr -p efi:=$WORKDIR/image.fat -o $WORKDIR/image.mbr + hda="$WORKDIR/image.mbr" +fi + # And, boot in QEMU. : ${BOOTLOG:=${TMPDIR:-/tmp}/ci-qemu-test-boot.log} timeout 300 \ $QEMU -m 256M -nodefaults \ -serial stdio -vga none -nographic -monitor none \ - -snapshot -hda fat:${ROOTDIR} 2>&1 | tee ${BOOTLOG} + -snapshot -hda $hda 2>&1 | tee ${BOOTLOG} # Check whether we succesfully booted... if grep -q 'Hello world.' ${BOOTLOG}; then