#!/bin/sh echo "[yerba-initramfs/init] DEBUG: running ls on /" ls / mkdir -p /proc /sys /dev mount -t proc none /proc mount -t sysfs none /sys mount -t devtmpfs none /dev echo "[yerba-initramfs/init] Mounted /dev, /proc, /sys respectively" # wait for CD-ROM?? sleep 1 mkdir -p /mnt/iso ls /mnt/iso mount /dev/sr0 /mnt/iso echo "[yerba-initramfs/init] Mounted /dev/sr0 (ISO root)" echo "[yerba-initramfs/init] DEBUG: running ls on /mnt/iso" mkdir -p /mnt/root mount -t squashfs -o loop /mnt/iso/yerba/rootfs.squashfs /mnt/root echo "[yerba-initramfs/init] Mounted squashfs at /mnt/root" echo "[yerba-initramfs/init] DEBUG: running ls on /mnt/root" ls /mnt/root mkdir -p /mnt/overlay mount -t tmpfs tmpfs /mnt/overlay mkdir -p /mnt/overlay/upper /mnt/overlay/work /mnt/overlay/merged echo "[yerba-initramfs/init] Mounted tmpfs at /mnt/overlay and created upper, work & merged directories" mount -t overlay overlay -o lowerdir=/mnt/root,upperdir=/mnt/overlay/upper,workdir=/mnt/overlay/work /mnt/overlay/merged echo "[yerba-initramfs/init] Mounted OverlayFS at /mnt/overlay/merged" if [ ! -c /dev/console ]; then echo "[yerba-initramfs/init] console device not found, creating" mknod -m 600 /dev/console c 5 1 fi if [ ! -c /dev/tty0 ]; then echo "[yerba-initramfs/init] tty0 device not found, creating" mknod -m 620 /dev/tty0 c 4 0 fi echo "[yerba-initramfs/init] DEBUG: running ls on /mnt/overlay/merged" ls /mnt/overlay/merged echo "[yerba-initramfs/init] Switching to overlay root..." exec switch_root /mnt/overlay/merged /init echo "[yerba-initramfs/init] switch_root failed, dropping to shell" exec /bin/sh