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} |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 19 | if mount -n -t {OVERLAYFS_ETC_FSTYPE} \ |
| 20 | -o {OVERLAYFS_ETC_MOUNT_OPTIONS} \ |
| 21 | {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT} |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 22 | then |
| 23 | mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper |
| 24 | mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 25 | 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 Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 32 | else |
| 33 | echo "PREINIT: Mounting </data> failed!" |
| 34 | fi |
| 35 | |
| 36 | echo "PREINIT: done; starting </sbin/init>" |
| 37 | exec {SBIN_INIT_NAME} |