#!/bin/sh # Bring up the kernel virtual filesystems and runtime dirs before other # services start. Safe to re-run: each mount is guarded by mountpoint checks. set -eu export PATH=/usr/bin:/usr/sbin:/bin:/sbin mountpoint -q /proc || mount -t proc proc /proc mountpoint -q /sys || mount -t sysfs sysfs /sys mountpoint -q /dev || mount -t devtmpfs devtmpfs /dev mkdir -p /dev/pts /dev/shm mountpoint -q /dev/pts || mount -t devpts devpts /dev/pts mountpoint -q /dev/shm || mount -t tmpfs tmpfs /dev/shm # NOTE: /run is intentionally NOT remounted here. dinit (PID 1) binds its # control socket under /run before this script runs; on the all-RAM initramfs # boot /run is already writable, and a fresh tmpfs mount would hide that socket. # (A disk-rooted system should instead mount /run before starting dinit.) mkdir -p /run/user /run/udev