OpenWrt build rc5 BPi-R4

My goal here is to build my own image of rc5 with the correct kernel hash so I can use the openwrt repo.

Once I clone openwrt's github I then use

git checkout openwrt-24.10
git pull
git checkout v24.10.0-rc
./scripts/feeds update -a && ./scripts/feeds install -a
wget -O .config https://downloads.openwrt.org/releases/24.10.0-rc5/targets/mediatek/filogic/config.buildinfo
make defconfig

I then run make menuconfig and select the needed settings for the BPi-R4. Then

make download
make -j5

That produces an image where I can download kmods from the openwrt repo. My issue is overlay isn't working. After every reboot settings reset and everything I installed is gone. What am I doing wrong?

What the image name did use? you maybe used *-initramfs-recovery

I read that was a possibility, but I definitely did not make that mistake. I even used the sysupgrade and the issue still persisted. Simply by changing to rc5 the image contains that issue. I will try rc4 later and see if that works.

you should check mounts and post output here

mount

and

ubinfo /dev/ubi0 -a

root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime,errors=continue)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work,uuid=on,xino=off)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,noatime)
root@OpenWrt:~# ubinfo /dev/ubi0 -a
ubi0
Volumes count:                           7
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     1005 (127610880 bytes, 121.6 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       3
Count of reserved physical eraseblocks:  17
Current maximum erase counter value:     2
Minimum input/output unit size:          2048 bytes
Character device major/minor:            249:0
Present volumes:                         0, 1, 2, 3, 4, 5, 6

Volume ID:   0 (on ubi0)
Type:        static
Alignment:   1
Size:        17 LEBs (2158592 bytes, 2.0 MiB)
Data bytes:  2097152 bytes (2.0 MiB)
State:       OK
Name:        fip
Character device major/minor: 249:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        9 LEBs (1142784 bytes, 1.0 MiB)
State:       OK
Name:        ubootenv
Character device major/minor: 249:2
-----------------------------------
Volume ID:   2 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        9 LEBs (1142784 bytes, 1.0 MiB)
State:       OK
Name:        ubootenv2
Character device major/minor: 249:3
-----------------------------------
Volume ID:   3 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        143 LEBs (18157568 bytes, 17.3 MiB)
State:       OK
Name:        recovery
Character device major/minor: 249:4
-----------------------------------
Volume ID:   4 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        167 LEBs (21204992 bytes, 20.2 MiB)
State:       OK
Name:        fit
Character device major/minor: 249:5
-----------------------------------
Volume ID:   5 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        67 LEBs (8507392 bytes, 8.1 MiB)
State:       OK
Name:        emmc_install
Character device major/minor: 249:6
-----------------------------------
Volume ID:   6 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        570 LEBs (72376320 bytes, 69.0 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 249:7

So for reasons I don't understand the problem was that /overlay(/dev/fitrw) wasn't formatted. So I installed mkfs.f2fs and formatted it. after that a reboot had /overlayfs mounted correctly. From there I installed the missing kmods then everything worked. It's working fine now but this definitely isn't a good solution, but maybe will help me figure this out.

So after looking into further and doing much more testing I found the issue, and I believe it's a bug in the openwrt build system.

To build an image with the same hash as rc5 where I can use the openwrt rc5 repo I must use the .config.buildinfo file from

https://downloads.openwrt.org/releases/24.10.0-rc5/targets/mediatek/filogic/config.buildinfo

If I just use that without making any changes it builds images for all devices that use the filogic MediaTek board. I tried building that and the resulting image for the BPi-r4 works fine. I then kept "Multiple Devices" selected under "Target Profile" then unselected all devices from "Target Devices" in the menuconfig except for the BPi-r4. The resulting image still worked fine. If I change "Target Profile" from "Multiple Devices" and change it to BPi-R4 the image then contains the issue that I created this topic about.

This to me seems like a bug in the build system. I should be able to change Target Profile from Multiple Devices to the BPi-R4 and the resulting image should be perfect, but it's not.

When the bug is present in the images the file sizes are much smaller. For example when I leave "Multiple Devices" selected the BPi-r4 sysupgrade file is 17mb. When I select BPi-R4 under "Target Profile" it's then half the size, and non-working.

This is the working image file sizes

This is the non-working image file sizes

This is what you must leave selected to create a working image