Skip to contentSkip to conversation

dhcp-client: override make_resolv_conf for read-only fs

PATCH New Hongxu Jia 1 participant 2 messages Dec 3, 2013

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover dhcp-client: override make_resolv_conf for read-only fs

The following changes since commit a17ffbdbb7d142a94ef842a32b749b18e2e7f0a1:

bitbake: hob: fix rotating progress icon animation (2013-12-02 17:51:35 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-dhcpclient
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-dhcpclient

Hongxu Jia (1):
dhcp-client: override make_resolv_conf for read-only fs

 meta/recipes-connectivity/dhcp/dhcp.inc                           | 8 +++++++-
 .../recipes-connectivity/dhcp/files/readonly-dhclient-enter-hooks | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/dhcp/files/readonly-dhclient-enter-hooks
Signature · 1 line
1.8.1.2
author
#1 lore raw

PATCH 1/1 dhcp-client: override make_resolv_conf for read-only fs

When dhclient-script starts, the client script first defines a shell function, make_resolv_conf , which is later used to create the /etc/resolv.conf file.

But the read-only filesystem didn't permit the modification, so override the default behaviour and redefine this function in the enter hook script.

http://linux.about.com/library/cmd/blcmdl8_dhclient-script.htm
[YOCTO #5624]

---
 meta/recipes-connectivity/dhcp/dhcp.inc                           | 8 +++++++-
 .../recipes-connectivity/dhcp/files/readonly-dhclient-enter-hooks | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/dhcp/files/readonly-dhclient-enter-hooks
meta/recipes-connectivity/dhcp/dhcp.inc +7 -1
index ad82b57..d9a6beb 100644
@@ -16,6 +16,7 @@ SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
            file://site.h \
 	   file://init-relay file://default-relay \
 	   file://init-server file://default-server \
+	   file://readonly-dhclient-enter-hooks \
 	   file://dhclient.conf file://dhcpd.conf"
 
 inherit autotools
@@ -51,6 +52,9 @@ do_install_append () {
 		mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
 	fi
 	install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
+		install -m 0755 ${WORKDIR}/readonly-dhclient-enter-hooks ${D}${sysconfdir}/dhclient-enter-hooks
+	fi
 }
 
 PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
@@ -66,7 +70,9 @@ FILES_dhcp-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp
 
 FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
 
-FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"
+FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf \
+                     ${sysconfdir}/dhclient-enter-hooks \
+"
 RDEPENDS_dhcp-client = "bash"
 
 FILES_dhcp-omshell = "${bindir}/omshell"
meta/recipes-connectivity/dhcp/files/readonly-dhclient-enter-hooks new file +3 -0
new file mode 100644
index 0000000..06c90e3
@@ -0,0 +1,3 @@
+make_resolv_conf(){
+  :
+}
Signature · 1 line
1.8.1.2