From 0bf867bb9a1a3113e72330f687da92d616d68f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C3=85berg?= Date: Tue, 17 Aug 2021 18:18:16 +0200 Subject: [PATCH] Meta: Create memory disk before mounting it on FreeBSD There was previously a case where the build-image-qemu.sh script decided to mount an existing disk image, but without creating the memory disk device and recording its /dev file name. After this commit, We create the memory disk device just before it is used to mount the disk image. --- Meta/build-image-qemu.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh index 938a9241c0..4dc8726804 100755 --- a/Meta/build-image-qemu.sh +++ b/Meta/build-image-qemu.sh @@ -98,9 +98,6 @@ if [ $USE_EXISTING -ne 1 ]; then VND=$(vnconfig _disk_image) (echo "e 0"; echo 83; echo n; echo 0; echo "*"; echo "quit") | fdisk -e "$VND" newfs_ext2fs -D $INODE_SIZE -n $INODE_COUNT "/dev/r${VND}i" || die "could not create filesystem" - elif [ "$(uname -s)" = "FreeBSD" ]; then - MD=$(mdconfig _disk_image) - mke2fs -q -I $INODE_SIZE -N $INODE_COUNT _disk_image || die "could not create filesystem" else if [ -x /sbin/mke2fs ]; then /sbin/mke2fs -q -I $INODE_SIZE -N $INODE_COUNT _disk_image || die "could not create filesystem" @@ -119,6 +116,7 @@ if [ "$(uname -s)" = "Darwin" ]; then elif [ "$(uname -s)" = "OpenBSD" ]; then mount_cmd="mount -t ext2fs "/dev/${VND}i" mnt/" elif [ "$(uname -s)" = "FreeBSD" ]; then + MD=$(mdconfig _disk_image) mount_cmd="fuse-ext2 -o rw+,direct_io "/dev/${MD}" mnt/" else mount_cmd="mount _disk_image mnt/"