[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#224656: bad tmpfs support detection



Package: rootskel
Version: 0.56

In /sbin/init, it attempts to determine whether or not the kernel supports
tmpfs by looking in /proc/filesystems:

#!/bin/sh -e
# Set up filesystem as root and pivot into it.
echo "Setting up filesystem, please wait ..."
umount initrd
mount -t proc proc proc
if grep -q tmpfs /proc/filesystems; then
        mount -t tmpfs -o size=100M tmpfs mnt
else
        mount -t shm shm mnt
fi

This is a valid way to detect support for most filesystems, but since tmpfs
is used internally by the kernel, it is always present in some form, and always
appears in /proc/filesystems.  This is true even if its configured off (and
therefore not mountable from userspace).

A better way may be to attempt the mount, and if it fails, try the shm mount.



Reply to: