diff mbox

android-xfstests: create loopback device nodes in standard location

Message ID 20170311005632.130135-1-ebiggers3@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Biggers March 11, 2017, 12:56 a.m. UTC
From: Eric Biggers <ebiggers@google.com>

Android creates loopback device nodes in /dev/block/, where they can't
be found by losetup.  Create them in /dev/ too so that losetup can find
them.  This stops tests using loopback devices, e.g. generic/361 and
shared/298, from failing.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 kvm-xfstests/android-xfstests | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Eric Biggers April 27, 2017, 6:17 p.m. UTC | #1
On Fri, Mar 10, 2017 at 04:56:32PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> Android creates loopback device nodes in /dev/block/, where they can't
> be found by losetup.  Create them in /dev/ too so that losetup can find
> them.  This stops tests using loopback devices, e.g. generic/361 and
> shared/298, from failing.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---

Ted, this patch seems to have gotten lost; can you apply it?  Thanks!

- Eric
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o April 29, 2017, 4:41 p.m. UTC | #2
On Fri, Mar 10, 2017 at 04:56:32PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> Android creates loopback device nodes in /dev/block/, where they can't
> be found by losetup.  Create them in /dev/ too so that losetup can find
> them.  This stops tests using loopback devices, e.g. generic/361 and
> shared/298, from failing.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/kvm-xfstests/android-xfstests b/kvm-xfstests/android-xfstests
index e798c7e..3489bc2 100755
--- a/kvm-xfstests/android-xfstests
+++ b/kvm-xfstests/android-xfstests
@@ -94,6 +94,14 @@  if ! cut -d' ' -f2 /proc/mounts 2>/dev/null | grep -q '^$CHROOT_DIR/results$'; t
     mkdir -p $RESULTS_DIR
     mount --bind $RESULTS_DIR $CHROOT_DIR/results
 fi
+
+# Android puts loopback device nodes in /dev/block/ instead of /dev/.
+# But losetup can only find them in /dev/, so create them there too.
+for i in \`seq 0 7\`; do
+	if [ ! -e /dev/loop\$i ]; then
+		mknod /dev/loop\$i b 7 \$i
+	fi
+done
 EOF
 }