I'm in the process of configuring raspbian jessie to run as read-only. Only /tmp is writable and the system is configured to write DHCP ip information in /tmp.
Everything is working fine except /etc/resolv.conf. It just doesn't get updated during boot.
I have tried using a symbolic link. rm /etc/resolv.conf touch /tmp/resolv.conf ln -s /tmp/resolv.conf /etc/resolv.conf
But because /tmp is emptied on reboot, /tmp/resolve.conf can't be updated because it doesn't exist.
So I tried creating the file during boot.
touch /tmp/resolv.conf in /etc/rc.local
The file gets created, but only after dhclient runs, because there are no DNS entries in it. If I run dhclient after the system has booted it writes the DNS servers to the file successfully.
How can I make resolv.conf work on a read-only file system?