Core MP135 - overlay fs
-
Hi All,
i'm deploying a core mp135 into a permanent install. Everything is working great but I can't get the overlay fs to work.
typically we mount the overlay fs in the initrd init script but I don't think it has one. Putting an init script into extlinux.conf seemed to kill the whole boot and given the timing of the HDMI coming on have been unable to capture any error messages.
Would love any ideas?
Cheers,
Alex -
@ghotihook Have you tried creating the initrd script?
-
@ajb2k3 this was my attempted at an initrd script. I can't find any evidence in logs that its being run.
root@cmp135:/boot# uname -a
Linux cmp135 5.15.118 #1 SMP PREEMPT Thu Sep 19 20:04:06 CST 2024 armv7l GNU/Linuxroot@cmp135:/boot# zcat /proc/config.gz > /boot/config-5.15.118
update-initramfs: Generating /boot/initrd.img-5.15.118
W: No zstd in /usr/bin:/sbin:/bin, using gzip
root@cmp135:/boot#root@cmp135:/boot# mkdir /tmp/initramfs
root@cmp135:/boot# cd /tmp/initramfs
root@cmp135:/tmp/initramfs#zcat /boot/initrd.img-$(uname -r) | cpio -idmv
… unloaded the imageUsed nano to add the below to the init file
mkdir -p /overlay/upper
mkdir -p /overlay/work
mkdir -p /newroot
mkdir -p /lower
mount -o ro /dev/mmcblk0p5 /lower
mount -t tmpfs tmpfs /overlay
mkdir -p /overlay/upper
mkdir -p /overlay/work
mount -t overlay overlay -o lowerdir=/lower,upperdir=/overlay/upper,workdir=/overlay/work /newroot
mount --move /proc /newroot/proc
mount --move /sys /newroot/sys
mount --move /dev /newroot/devroot@cmp135:/tmp/initramfs# find . | cpio -o -H newc | gzip > /boot/initrd.img-5.15.118
21562 blocks
root@cmp135:/tmp/initramfs#Added initrd to /boot/extlinux/extlinux.conf
label stm32mp135f-coremp135-buildroot
kernel /boot/zImage
initrd /boot/initrd.img-5.15.118
devicetree /boot/stm32mp135f-coremp135.dtb
append root=/dev/mmcblk0p5 rw panic=5 quiet rootwaitAfter boot
- Unable to find any of my echo statements in dmesg or journalctl
- root@cmp135:/home/alex060# mount | grep overlay
- root@cmp135:/home/alex060#
-
In addition I have tried hijacking the init script like this, but end up in an endless reboot before the HDMI or serial port come up. so I cannot see what the error is
root@cmp135:/sbin# ls /sbin/init
/sbin/init
root@cmp135:/sbin#root@cmp135:/sbin# ls /sbin/myinit
/sbin/myinit
root@cmp135:/sbin#root@cmp135:/sbin# chmod +x /sbin/myinit
root@cmp135:/sbin#add this to /sbin/myinit
#!/bin/sh
set -e
echo "Setting up OverlayFS for root filesystem..."
mkdir -p /overlay/upper
mkdir -p /overlay/work
mkdir -p /newroot
mkdir -p /lower
mount -o ro /dev/mmcblk0p5 /lower
mount -t tmpfs tmpfs /overlay
mkdir -p /overlay/upper
mkdir -p /overlay/work
mount -t overlay overlay -o lowerdir=/lower,upperdir=/overlay/upper,workdir=/overlay/work /newroot
mount --move /proc /newroot/proc
mount --move /sys /newroot/sys
mount --move /dev /newroot/dev
/sbin/initroot@cmp135:/sbin# cat /boot/extlinux/extlinux.conf
label stm32mp135f-coremp135-buildroot
kernel /boot/zImage
devicetree /boot/stm32mp135f-coremp135.dtb
append root=/dev/mmcblk0p5 rw panic=5 quiet=false rootwait init=/sbin/myinit
root@cmp135:/sbin#