source: bootscripts/lfs/init.d/mountvirtfs@ 16cd0963

11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 12.2 12.2-rc1 bdubbs/gcc13 multilib renodr/libudev-from-systemd trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 16cd0963 was 16cd0963, checked in by Bruce Dubbs <bdubbs@…>, 2 years ago

Adjust instructions for /dev/shm when creating virtual filesystems.
Some host create /dev/shm as a tmpfs. Some have is as
a symlink to a location in another directory. This
change handles both cases.

The change to the sysV bootscripts now creates /dev/shm
as a separate tmpfs from /run. This makes LFS sysV and
systemd versions treat /dev/shm the same.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1#!/bin/sh
2########################################################################
3# Begin mountvirtfs
4#
5# Description : Ensure proc, sysfs, run, and dev are mounted
6#
7# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
8# DJ Lucas - dj@linuxfromscratch.org
9# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
10#
11# Version : LFS 7.0
12#
13########################################################################
14
15### BEGIN INIT INFO
16# Provides: mountvirtfs
17# Required-Start: $first
18# Should-Start:
19# Required-Stop:
20# Should-Stop:
21# Default-Start: S
22# Default-Stop:
23# Short-Description: Mounts various special fs needed at start
24# Description: Mounts /sys and /proc virtual (kernel) filesystems.
25# Mounts /run (tmpfs) and /dev (devtmpfs).
26# This is done only if they are not already mounted.
27# with the kernel config proposed in the book, dev
28# should be automatically mounted by the kernel.
29# X-LFS-Provided-By: LFS
30### END INIT INFO
31
32. /lib/lsb/init-functions
33
34case "${1}" in
35 start)
36 # Make sure /run is available before logging any messages
37 if ! mountpoint /run >/dev/null; then
38 mount /run || failed=1
39 fi
40
41 mkdir -p /run/lock
42 chmod 1777 /run/lock
43
44 log_info_msg "Mounting virtual file systems: ${INFO}/run"
45
46 if ! mountpoint /proc >/dev/null; then
47 log_info_msg2 " ${INFO}/proc"
48 mount -o nosuid,noexec,nodev /proc || failed=1
49 fi
50
51 if ! mountpoint /sys >/dev/null; then
52 log_info_msg2 " ${INFO}/sys"
53 mount -o nosuid,noexec,nodev /sys || failed=1
54 fi
55
56 if ! mountpoint /dev >/dev/null; then
57 log_info_msg2 " ${INFO}/dev"
58 mount -o mode=0755,nosuid /dev || failed=1
59 fi
60
61 mkdir -p /dev/shm
62 log_info_msg2 " ${INFO}/dev/shm"
63 mount -o nosuid,nodev /dev/shm || failed=1
64
65 (exit ${failed})
66 evaluate_retval
67 exit $failed
68 ;;
69
70 *)
71 echo "Usage: ${0} {start}"
72 exit 1
73 ;;
74esac
75
76# End mountvirtfs
Note: See TracBrowser for help on using the repository browser.