Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | echo "PREINIT: Start" |
| 4 | |
| 5 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
| 6 | mount -o remount,rw / |
| 7 | |
| 8 | mkdir -p /proc |
| 9 | mkdir -p /sys |
| 10 | mkdir -p /run |
| 11 | mkdir -p /var/run |
| 12 | |
| 13 | mount -t proc proc /proc |
| 14 | mount -t sysfs sysfs /sys |
| 15 | |
| 16 | [ -z "$CONSOLE" ] && CONSOLE="/dev/console" |
| 17 | |
| 18 | mkdir -p {OVERLAYFS_ETC_MOUNT_POINT} |
| 19 | if mount -n -t {OVERLAYFS_ETC_FSTYPE} -o {OVERLAYFS_ETC_MOUNT_OPTIONS} {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT} |
| 20 | then |
| 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!" |
| 24 | else |
| 25 | echo "PREINIT: Mounting </data> failed!" |
| 26 | fi |
| 27 | |
| 28 | echo "PREINIT: done; starting </sbin/init>" |
| 29 | exec {SBIN_INIT_NAME} |