1#!/bin/sh
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
6### BEGIN INIT INFO
7# Provides:          mountall
8# Required-Start:    mountvirtfs
9# Required-Stop:
10# Default-Start:     S
11# Default-Stop:
12# Short-Description: Mount all filesystems.
13# Description:
14### END INIT INFO
15
16. /etc/default/rcS
17
18#
19# Mount local filesystems in /etc/fstab. For some reason, people
20# might want to mount "proc" several times, and mount -v complains
21# about this. So we mount "proc" filesystems without -v.
22#
23test "$VERBOSE" != no && echo "Mounting local filesystems..."
24mount -at nonfs,nosmbfs,noncpfs 2>/dev/null
25
26
27# We might have mounted something over /run; see if
28# /dev/initctl is present.  Look for
29# /sbin/init.sysvinit to verify that sysvinit (and
30# not busybox or systemd) is installed as default init).
31INITCTL="/dev/initctl"
32if [ ! -p "$INITCTL" ] && [ "${INIT_SYSTEM}" = "sysvinit" ]; then
33    # Create new control channel
34		rm -f "$INITCTL"
35		mknod -m 600 "$INITCTL" p
36
37		# Reopen control channel.
38		PID="$(pidof -s /sbin/init || echo 1)"
39		[ -n "$PID" ] && kill -s USR1 "$PID"
40fi
41
42#
43# Execute swapon command again, in case we want to swap to
44# a file on a now mounted filesystem.
45#
46[ -x /sbin/swapon ] && swapon -a
47
48: exit 0
49
50