blob: b242838753e7afec95c4511432bacc9ce24b008c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#!/bin/sh
echo "[yerba-initramfs/init] DEBUG: running ls -la on /"
ls -la / || true
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
mount /dev/sr0 /mnt/iso
echo "[yerba-initramfs/init] Mounted /dev/sr0 (ISO root)"
echo "[yerba-initramfs/init] DEBUG: running ls -la on /mnt/iso"
ls -la /mnt/iso || true
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 -la on /mnt/root"
ls -la /mnt/root || true
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 -la on /mnt/overlay/merged"
ls -la /mnt/overlay/merged || true
mount -t devtmpfs devtmpfs /mnt/overlay/merged/dev
echo "[yerba-initramfs/init] Switching to overlay root..."
echo "debug don't switch root"
# exec switch_root /mnt/overlay/merged /usr/bin/runit-init
echo "[yerba-initramfs/init] switch_root failed, dropping to shell"
exec /bin/sh
|