blob: da9ad485c10fae0b39b9ca03d50c0e2f9095fb7c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#!/bin/sh
Patrick Williams45852732022-04-02 08:58:32 -05002#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006### BEGIN INIT INFO
7# Provides: mountvirtfs
8# Required-Start:
9# Required-Stop:
10# Default-Start: S
11# Default-Stop:
12# Short-Description: Mount kernel virtual file systems.
13# Description: Mount initial set of virtual filesystems the kernel
14# provides and that are required by everything.
15### END INIT INFO
16
17if [ -e /proc ] && ! [ -e /proc/mounts ]; then
18 mount -t proc proc /proc
19fi
20
21if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then
22 mount -t sysfs sysfs /sys
23fi
24
25if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then
26 mount -t debugfs debugfs /sys/kernel/debug
27fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050028
Brad Bishop6e60e8b2018-02-01 10:27:11 -050029if [ -e /sys/kernel/config ] && grep -q configfs /proc/filesystems; then
30 mount -t configfs configfs /sys/kernel/config
31fi
32
Brad Bishop1d80a2e2019-11-15 16:35:03 -050033if [ -e /sys/firmware/efi/efivars ] && grep -q efivarfs /proc/filesystems; then
34 mount -t efivarfs efivarfs /sys/firmware/efi/efivars
35fi
36
Patrick Williamsf1e5d692016-03-30 15:21:19 -050037if ! [ -e /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then
38 mount -n -t devtmpfs devtmpfs /dev
39fi