Replacing some files in read-only flash region making custom firmware for each device

Hello all and happy new year !

Sorry, it may be duplicate but can't find correct answer.

Device: MT7628
ImageFile: ./bin/targets/ramips/mt76x8/openwrt-ramips-mt76x8-mediatek_linkit-smart-7688-squashfs-sysupgrade.bin
OpenWrt version: latest master branch

Looking for faster way re-build image with couple replaced/modified files in ./files/ folder or another even faster way like mount image and replace file (if it is possible at all).

Files must be in FLASH read-only squash region, please do not offer any /overlay/ related option.

Each time after replacing/modifying files in ./files/ folder and running make -j64 takes approx. 3 minutes and this is huge waste of resources due to lots of compiler checks.

Maybe there any other faster way can be used? For example just to change files and pack/repack image? or Mount and change? or Any other?

Thank you

The methods depend on what you need to do in the ./files/ folder.

If your changes can be scripted in shell/UCI syntax, you can actually use the standard online image builder (firmware selector) to include that script as a first-boot script that is baked into the image.

For example:

Current default file files/etc/config/network selection:

config interface 'vpn'
        option proto 'wireguard'
        option private_key ''
        list addresses '172.22.0.1/32'
        option disabled '1'

I want to change it to:

config interface 'vpn'
        option proto 'wireguard'
        option private_key '<valid key>'
        list addresses '<valid IP>/32'
        option disabled '0'

How to generate individual firmware file for each device with updated files/etc/config/network specific key and , IP address and have this file in read-only squashFS.

Maybe it is possible to pass some arguments to regular Openwrt makefile just to re-pack image?
Please suggest any more reasonable way except just dumb make -jxx.

Thank you !

That you do not post in online forms, use local imagebuilder or better openwisp if you plan to grow your network.

I have tried imagebuilder 1 year ago and +-2 month ago without success, ...
ok lets try it now:

Kernel build with Imagebuilder enabled option
Openwrt source location (latest git clone master):
~/openwrt/openwrt_7628_frineta

After configured and succesfully build system image, archive containing imagebuilder from
bin/targets/ramips/mt76x8/openwrt-imagebuilder-ramips-mt76x8.Linux-x86_64.tar.zst extracted to:
~/openwrt/openwrt-imagebuilder-ramips-mt76x8.Linux-x86_64

then
cd ~/openwrt/openwrt-imagebuilder-ramips-mt76x8.Linux-x86_64

make image PROFILE="mediatek_linkit-smart-7688" PACKAGES="-odhcpd-ipv6only -ppp-mod-pppoe"

All packages downloaded, configured and installed and then

getting error that I cannot explain and can't google it out.

Please help.