My x86 device running 18.06 was hit by a power failure. It came back with lots of ext4 errors on the syslog. I ran e2fsck which found a deleted inode in /etc/config/dhcp, so I no longer had that file.
However, with that file missing, LuCI no longer displayed the "DHCP Server" section on any interface, and the "DHCP and DNS" page was missing as well. Creating a blank file restored these sections, but the "Server Settings" on "DHCP and DNS" were still missing; and after reconfiguring DHCP on the lan interface, my network still had no DNS. Eventually I logged in to my Wi-Fi bridge and copied its unused /etc/config/dhcp over, and everything started working again.
My question is: what would be the best solution (short of a reflash) to restore a single config file to its defaults?
This is an x86 device with RW ext4 root filesystem, there is no /rom structure.
root@OpenWrt:~# ls /rom
note
root@OpenWrt:~# cat /rom/note
SQUASHFS USERS:
After firstboot has been run, / will be jffs2 and /rom will be squashfs
(* except when in failsafe)
root@OpenWrt:~#