From 09c27ea248efebe1e72aa688cb55996dadbbbe29 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 29 Mar 2011 15:14:33 +0200 Subject: /dev: mount /dev/pts and /dev/shm during early boot This has two purposes: 1) it allows boot services like bootlogd (that needs /dev/pts) to be started very early in boot, and 2) by setting the standard options in rc.sysinit rather than in fstab we have control over them and can easily integrate them with other packages and make adjustments to fix bugs. This brings /dev/{pts,shm} into line with how we handle /dev, /proc, /sys and /run. With this patch /dev/{pts,shm} can (and probably should) be removed from the default fstab file, and fstab should only contain entries for the mountpoints the user has specified during install, like /boot, /home and /var. It will now be possible to boot a working system with an empty fstab. If /dev/{pts,shm} is in fstab the mountoptions there will take precedenc over the standard ones. Cc: Pierre Schmitz Signed-off-by: Tom Gundersen --- rc.sysinit | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 21b4eb1..02199b3 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -16,7 +16,7 @@ run_hook sysinit_start # export standard PATH (will be overridden later when /etc/profile is sourced, but is usefull for UDev) export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -# mount /dev, /proc, /sys, /run (the api filesystems) +# mount /proc, /sys, /dev, /dev/pts and /dev/shm (the api filesystems) if ! /bin/mountpoint -q /dev; then if grep -q devtmpfs /proc/filesystems 2>/dev/null; then /bin/mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid @@ -24,12 +24,12 @@ if ! /bin/mountpoint -q /dev; then /bin/mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid fi fi - -/bin/mkdir -p /dev/{pts,shm} - -/bin/mountpoint -q /proc || /bin/mount -n -t proc proc /proc -o nosuid,noexec,nodev -/bin/mountpoint -q /sys || /bin/mount -n -t sysfs sysfs /sys -o nosuid,noexec,nodev -/bin/mountpoint -q /run || /bin/mount -n -t tmpfs tmpfs /run -o mode=755,size=10M,nosuid,noexec,nodev +/bin/mkdir -p /run/lock /dev/{pts,shm} +/bin/chmod 1777 /run/lock +/bin/mountpoint -q /dev/pts || /bin/mount /dev/pts &> /dev/null \ + || /bin/mount -n -t devpts devpts /dev/pts -o mode=620,gid=5,nosuid,noexec +/bin/mountpoint -q /dev/shm || /bin/mount /devshm &> /dev/null \ + || /bin/mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev # start up our mini logger until syslog takes over /sbin/minilogd -- cgit v1.2.3