Mount /dev/shm for Linux systems, even not when in /etc/fstab, #196345.

This commit is contained in:
Roy Marples 2007-10-19 06:57:41 +00:00
parent 59c9e0e1ee
commit 0d9eaafe9a
2 changed files with 19 additions and 13 deletions

View File

@ -1,6 +1,10 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts # ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
19 Oct 2007; Roy Marples <uberlord@gentoo.org>:
Mount /dev/shm for Linux systems, even not when in /etc/fstab, #196345.
16 Oct 2007; Roy Marples <uberlord@gentoo.org>: 16 Oct 2007; Roy Marples <uberlord@gentoo.org>:
We now build and optionally work with static libraries. We now build and optionally work with static libraries.

View File

@ -206,26 +206,28 @@ else
done done
fi fi
# Mount the new fancy pants /dev/pts whenever possible # Mount required stuff as user may not have then in /etc/fstab
if grep -Eq "[[:space:]]+devpts$" /proc/filesystems && \ for x in "devpts /dev/pts" "tmpfs /dev/shm ,nodev"; do
! mountinfo -q /dev/pts; then set -- ${x}
if [ ! -d /dev/pts ] && \ grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
mountinfo -q "$2" && continue
if [ ! -d "$2" ] && \
[ "${devfs}" = "yes" -o "${udev}" = "yes" ]; then [ "${devfs}" = "yes" -o "${udev}" = "yes" ]; then
# Make sure we have /dev/pts mkdir -p "$2" >/dev/null 2>/dev/null || \
mkdir -p /dev/pts >/dev/null 2>/dev/null || \ ewarn "Could not create $2!"
ewarn "Could not create /dev/pts!"
fi fi
if [ -d /dev/pts ]; then if [ -d "$2" ]; then
ebegin "Mounting devpts at /dev/pts" ebegin "Mounting $1 at $2"
if fstabinfo --quiet /dev/pts; then if fstabinfo --quiet "$2"; then
try mount -n /dev/pts try mount -n "$2"
else 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 fi
eend $? eend $?
fi fi
fi done
# If booting off CD, we want to update inittab before setting the runlevel # If booting off CD, we want to update inittab before setting the runlevel
if [ -f /sbin/livecd-functions.sh -a -n "${CDBOOT}" ]; then if [ -f /sbin/livecd-functions.sh -a -n "${CDBOOT}" ]; then