blob: 2ebb6c9224e3ead9f033daeea9a836ffb71703da [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001#!/bin/sh
2
3echo "PREINIT: Start"
4
5PATH=/sbin:/bin:/usr/sbin:/usr/bin
6mount -o remount,rw /
7
8mkdir -p /proc
9mkdir -p /sys
10mkdir -p /run
11mkdir -p /var/run
12
13mount -t proc proc /proc
14mount -t sysfs sysfs /sys
15
16[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
17
18mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}
19if mount -n -t {OVERLAYFS_ETC_FSTYPE} -o {OVERLAYFS_ETC_MOUNT_OPTIONS} {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT}
20then
21 mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper
22 mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work
23 mount -n -t overlay -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper,lowerdir=/etc,workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || echo "PREINIT: Mounting etc-overlay failed!"
24else
25 echo "PREINIT: Mounting </data> failed!"
26fi
27
28echo "PREINIT: done; starting </sbin/init>"
29exec {SBIN_INIT_NAME}