#!/bin/sh
# /init - first userspace process. Mount essential virtual filesystems and
# hand off to the system service manager. The bootloader passes us
# 'rdinit=/init' so this runs as PID 1.
set -e

mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev || true
mount -t tmpfs tmpfs /run
mount -t tmpfs tmpfs /tmp

# Bring up the loopback interface.
ip link set lo up 2>/dev/null || true

echo "[prestrike] userspace up"

# Hand off to the distro-specific init system.
if [ -x /sbin/init ]; then
  exec /sbin/init "$@"
else
  exec /bin/sh
fi
