Overlay does not copy my files to base system

i have a file named /etc/startup-config i am saving this file in /tmp before doing firstboot
#!/bin/sh

/sbin/jffs2reset $@

after this i am copy file to /overlay/etc/startup-config and i am expecting it in /etc dir after reboot
but this is not happing . I also tried to save this file after changing its name still dont get this file after resetting firmware

/dev/ubi0_4 on /overlay type ubifs (rw,noatime,assert=read-only,ubi=0,vol=4)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work )

these are logs
[ 11.002276] mount_root: overlay filesystem has not been fully initialized yet
[ 11.014335] mount_root: switching to ubifs overlay

what am i missing?

Is this is the reason?
/dev/mtdblock20 28.3M 28.3M 0 100% /rom

Have you tried just copying it to /etc/startup-config?

yes. but after reset default /etc/startup-config vfile will get replaced

Another option would be to bake your startup config into the image. This can be done via UCI commands in the online image builder on the firmware-selector website, or other more complex files/scripts can be embedded via the image builder that you download and run from your local computer.

1 Like

Not sure if your approach will work at all but that overlay directory if wrong at the first place.
It should be /overlay/upper/etc

correct, but after firstboot there are no such dirctory so i am coping my file at overlat/etc/startup-config