My openwrt ver: 19.07
what I want to do is prevent system reboot after sysupgrade, and use my daemon to notice remote machine the upgrade process is complete. I modified lib/upgrade/stage2 to preserve my daemon(sun-rpc based clint) in ramfs, and marked all reboot lines in lib/upgrade/do_stage2.
sysupgrade -T <imagepath>
to extract image file, then use:
/lib/upgrade/stage2 <imagepath> /lib/upgrade/do_stage2
to directly do firmware upgrade.
After upgrade is complete, system doesn't restart, it's good, but when I execute my daemon it can not connect to remote server. I found the network service needs /etc/services file to indicate ports it used, so I modified stage2 again to copy /etc/services to ramfs, but it still not works. Any idea how to make network service works after switch to ramfs? (ping to server is ok)