🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Core MP135 - overlay fs

    General
    3
    5
    551
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      ghotihook
      last edited by

      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

      ajb2k3A 1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3 @ghotihook
        last edited by

        @ghotihook Have you tried creating the initrd script?

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        G 1 Reply Last reply Reply Quote 0
        • G
          ghotihook @ajb2k3
          last edited by

          @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/Linux

          root@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 image

          Used 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/dev

          root@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 rootwait

          After boot

          • Unable to find any of my echo statements in dmesg or journalctl
          • root@cmp135:/home/alex060# mount | grep overlay
          • root@cmp135:/home/alex060#
          G 1 Reply Last reply Reply Quote 0
          • G
            ghotihook @ghotihook
            last edited by

            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/init

            root@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#

            1 Reply Last reply Reply Quote 0
            • K
              kingpwf
              last edited by

              你是自己编译的镜像嘛,分享下(或出下教程)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post