blob: 43c9b04eb9cc94fda64698fb49e64e49ad447531 [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}
Andrew Geissler9aee5002022-03-30 16:27:02 +000019if mount -n -t {OVERLAYFS_ETC_FSTYPE} \
20 -o {OVERLAYFS_ETC_MOUNT_OPTIONS} \
21 {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT}
Andrew Geissler595f6302022-01-24 19:11:47 +000022then
23 mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper
24 mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work
Andrew Geissler9aee5002022-03-30 16:27:02 +000025 mount -n -t overlay \
26 -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper \
27 -o lowerdir=/etc \
28 -o workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work \
29 -o index=off,xino=off,redirect_dir=off,metacopy=off \
30 {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || \
31 echo "PREINIT: Mounting etc-overlay failed!"
Andrew Geissler595f6302022-01-24 19:11:47 +000032else
33 echo "PREINIT: Mounting </data> failed!"
34fi
35
36echo "PREINIT: done; starting </sbin/init>"
37exec {SBIN_INIT_NAME}