Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131676639
D38589.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38589.diff
View Options
diff --git a/tools/boot/ci-qemu-test.sh b/tools/boot/ci-qemu-test.sh
--- a/tools/boot/ci-qemu-test.sh
+++ b/tools/boot/ci-qemu-test.sh
@@ -21,7 +21,7 @@
tempdir_cleanup()
{
trap - EXIT SIGINT SIGHUP SIGTERM SIGQUIT
- rm -rf ${ROOTDIR}
+ rm -rf ${WORKDIR}
}
tempdir_setup()
@@ -99,18 +99,31 @@
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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 6:38 AM (11 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23566479
Default Alt Text
D38589.diff (1 KB)
Attached To
Mode
D38589: Cirrus-CI: use makefs if size exceeds QEMU's virtual FAT limit
Attached
Detach File
Event Timeline
Log In to Comment