summaryrefslogtreecommitdiff
path: root/sh.Linux
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-19 06:57:41 +0000
committerRoy Marples <roy@marples.name>2007-10-19 06:57:41 +0000
commit0d9eaafe9adbda53ab3617ec732900612634ca87 (patch)
treebf3fb55ac748014976aa54f4fc039d24d789e26d /sh.Linux
parent59c9e0e1ee3990870aabcc82b138280f8b08780c (diff)
downloadopenrc-0d9eaafe9adbda53ab3617ec732900612634ca87.tar.gz
openrc-0d9eaafe9adbda53ab3617ec732900612634ca87.tar.bz2
openrc-0d9eaafe9adbda53ab3617ec732900612634ca87.tar.xz
Mount /dev/shm for Linux systems, even not when in /etc/fstab, #196345.
Diffstat (limited to 'sh.Linux')
-rwxr-xr-xsh.Linux/init.sh28
1 files changed, 15 insertions, 13 deletions
diff --git a/sh.Linux/init.sh b/sh.Linux/init.sh
index 6011849..e45c734 100755
--- a/sh.Linux/init.sh
+++ b/sh.Linux/init.sh
@@ -206,26 +206,28 @@ else
done
fi
-# Mount the new fancy pants /dev/pts whenever possible
-if grep -Eq "[[:space:]]+devpts$" /proc/filesystems && \
- ! mountinfo -q /dev/pts; then
- if [ ! -d /dev/pts ] && \
+# Mount required stuff as user may not have then in /etc/fstab
+for x in "devpts /dev/pts" "tmpfs /dev/shm ,nodev"; do
+ set -- ${x}
+ grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
+ mountinfo -q "$2" && continue
+
+ if [ ! -d "$2" ] && \
[ "${devfs}" = "yes" -o "${udev}" = "yes" ]; then
- # Make sure we have /dev/pts
- mkdir -p /dev/pts >/dev/null 2>/dev/null || \
- ewarn "Could not create /dev/pts!"
+ mkdir -p "$2" >/dev/null 2>/dev/null || \
+ ewarn "Could not create $2!"
fi
- if [ -d /dev/pts ]; then
- ebegin "Mounting devpts at /dev/pts"
- if fstabinfo --quiet /dev/pts; then
- try mount -n /dev/pts
+ if [ -d "$2" ]; then
+ ebegin "Mounting $1 at $2"
+ if fstabinfo --quiet "$2"; then
+ try mount -n "$2"
else
- try mount -n -t devpts -o gid=5,mode=0620,noexec,nosuid devpts /dev/pts
+ try mount -n -t "$1" -o gid=5,mode=0620,noexec,nosuid"$3" none "$2"
fi
eend $?
fi
-fi
+done
# If booting off CD, we want to update inittab before setting the runlevel
if [ -f /sbin/livecd-functions.sh -a -n "${CDBOOT}" ]; then