Skip to contentSkip to conversation

android-xfstests: create /dev/fd on the Android device

PATCH Applied Eric Biggers 2 participants 2 messages Dec 9, 2020 – Dec 10, 2020 fscrypt: file system level encryption support

lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 android-xfstests: create /dev/fd on the Android device

From: Eric Biggers <[email protected]>

In order for bash process substitution (the syntax like "<(list)" or ">(list)") to work, /dev/fd has to be a symlink to /proc/self/fd. /dev/fd doesn't exist on Android, so create it if it's missing.

This fixes xfstest generic/576.

---
 kvm-xfstests/android-xfstests | 5 +++++
 1 file changed, 5 insertions(+)
kvm-xfstests/android-xfstests +5 -0
index a8f9be9..7741162 100755
@@ -244,6 +244,11 @@ if ! cut -d' ' -f2 /proc/mounts 2>/dev/null | grep -q '^$CHROOT_DIR/results$'; t
     mount --bind $RESULTS_DIR $CHROOT_DIR/results
 fi
 
+# /dev/fd needs to exist in order for bash process substitution to work.
+if [ ! -e /dev/fd ]; then
+	ln -s /proc/self/fd /dev/fd
+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
Signature · 1 line
2.29.2
maintainer Applied
#1 lore raw
Quoted 9 lines · Eric Biggers

From: Eric Biggers <[email protected]>

In order for bash process substitution (the syntax like "<(list)" or ">(list)") to work, /dev/fd has to be a symlink to /proc/self/fd. /dev/fd doesn't exist on Android, so create it if it's missing.

This fixes xfstest generic/576.

Thanks, applied.

- Ted