Permalink
Browse files

dhcp: Point the leases file at /tmp (so / can be ro)

This creates a symlink from /var/lib/dhcp to /tmp.  dhclient opens files in
this directory as rw when it obtains a lease.  This prevents us from
mounting / as ro.
  • Loading branch information...
1 parent fd19249 commit fb5059c5750daeaf9f1f2700ee1dada0c3d796fe Sean Cross committed Oct 4, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
@@ -0,0 +1,14 @@
+THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:"
+PRINC := "${@int(PRINC) + 1}"
+
+pkg_postinst_dhcp-client() {
+ ln -sf /tmp ${localstatedir}/lib/dhcp
+}
+
+pkg_postrm_dhcp-client() {
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+ rm -rf ${localstatedir}/lib/dhcp
+}

0 comments on commit fb5059c

Please sign in to comment.