On Fri, 29 May 2015 at 19:18:04 +0200, Guilhem Moulin wrote:
> An arguably simpler alternative to copying mountpoint(1) is to grep
> through /proc/mounts.

Forgot the patch, sorry.

-- 
Guilhem.
--- a/usr/share/initramfs-tools/scripts/init-premount/devpts
+++ b/usr/share/initramfs-tools/scripts/init-premount/devpts
@@ -13,15 +13,13 @@
 	;;
 esac
 
-. /scripts/functions
-
-grep -E "[[:space:]]+devpts$" /proc/filesystems >/dev/null 2>&1 || exit 0
+grep -qE '\sdevpts$' /proc/filesystems || exit 0
 
 # If /dev/pts is already mounted, don't re-mount it.
-mountpoint -q /dev/pts || exit 0
+! grep -qE '^devpts\s+/dev/pts\s+devpts\s' /proc/mounts || exit 0
 
+. /scripts/functions
 log_begin_msg "Mounting devpts"
 
 mkdir -p /dev/pts
 mount -t devpts none /dev/pts
-

Attachment: signature.asc
Description: Digital signature

Reply via email to