* [PATCH V3 0/1] dhcp-client: fix invoke dhclient-script failed on Read-only file system
@ 2014-03-05 8:52 Hongxu Jia
2014-03-05 8:52 ` [PATCH 1/1] " Hongxu Jia
0 siblings, 1 reply; 3+ messages in thread
From: Hongxu Jia @ 2014-03-05 8:52 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
Change in V3:
- Reduce the calling from the shell script, use shell variable instead;
//Hongxu
The following changes since commit 54c2e993ec129563c7ae9f3fdee74ab60da28698:
bsps: update H/W reference boards to v3.10.32 (2014-03-02 17:25:30 +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: fix invoke dhclient-script failed on Read-only file
system
...dhclient-script-drop-resolv.conf.dhclient.patch | 70 ++++++++++++++++++++++
meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb | 3 +-
2 files changed, 71 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
--
1.8.1.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] dhcp-client: fix invoke dhclient-script failed on Read-only file system
2014-03-05 8:52 [PATCH V3 0/1] dhcp-client: fix invoke dhclient-script failed on Read-only file system Hongxu Jia
@ 2014-03-05 8:52 ` Hongxu Jia
2014-03-05 9:08 ` Hongxu Jia
0 siblings, 1 reply; 3+ messages in thread
From: Hongxu Jia @ 2014-03-05 8:52 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
In read-only file system, '/etc' is on the readonly partition,
and '/etc/resolv.conf' is symlinked to a separate writable
partition.
In this situation, we should use shell variable to instead of
the temp file '/etc/resolv.conf.dhclient'.
[YOCTO #5624]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
...dhclient-script-drop-resolv.conf.dhclient.patch | 70 ++++++++++++++++++++++
meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb | 3 +-
2 files changed, 71 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
diff --git a/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
new file mode 100644
index 0000000..99ad91c
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
@@ -0,0 +1,70 @@
+dhclient-script: drop resolv.conf.dhclient
+
+Even though '/etc' is on the readonly partition, it's possible that
+/etc/resolv.conf is on a separate writable partition.
+
+In this situation, we should drop the temp file resolv.conf.dhclient,
+use shell variable instead.
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/linux | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/client/scripts/linux b/client/scripts/linux
+index 6f8ea4b..b369bef 100755
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -27,27 +27,27 @@ ip=/sbin/ip
+
+ make_resolv_conf() {
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- chmod 644 /etc/resolv.conf.dhclient
++ resolv_conf=""
+ if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ resolv_conf="search ${new_domain_search}\n"
+ elif [ x"$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ resolv_conf="search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ resolv_conf="${resolv_conf}nameserver ${nameserver}\n"
+ done
+
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
++ echo -e "${resolv_conf}" > /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+ cat /dev/null > /etc/resolv.conf.dhclient6
+ chmod 644 /etc/resolv.conf.dhclient6
++ resolv_conf=""
+
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ resolv_conf="search ${new_dhcp6_domain_search}\n"
+ fi
+ shopt -s nocasematch
+ for nameserver in ${new_dhcp6_name_servers} ; do
+@@ -59,11 +59,11 @@ make_resolv_conf() {
+ else
+ zone_id=
+ fi
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ resolv_conf="${resolv_conf}nameserver ${nameserver}$zone_id\n"
+ done
+ shopt -u nocasematch
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ echo -e "${resolv_conf}" > /etc/resolv.conf
+ fi
+ }
+
+--
+1.8.1.2
+
diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb b/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb
index 08db41b..d823350 100644
--- a/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb
+++ b/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb
@@ -1,11 +1,10 @@
require dhcp.inc
-PR = "r1"
-
SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
file://fix-external-bind.patch \
file://link-with-lcrypto.patch \
file://fixsepbuild.patch \
+ file://dhclient-script-drop-resolv.conf.dhclient.patch \
"
SRC_URI[md5sum] = "f68e3c1f00a9af5742bc5e71d567cf93"
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] dhcp-client: fix invoke dhclient-script failed on Read-only file system
2014-03-05 8:52 ` [PATCH 1/1] " Hongxu Jia
@ 2014-03-05 9:08 ` Hongxu Jia
0 siblings, 0 replies; 3+ messages in thread
From: Hongxu Jia @ 2014-03-05 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
On 03/05/2014 04:52 PM, Hongxu Jia wrote:
> In read-only file system, '/etc' is on the readonly partition,
> and '/etc/resolv.conf' is symlinked to a separate writable
> partition.
>
> In this situation, we should use shell variable to instead of
> the temp file '/etc/resolv.conf.dhclient'.
>
> [YOCTO #5624]
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> ...dhclient-script-drop-resolv.conf.dhclient.patch | 70 ++++++++++++++++++++++
> meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb | 3 +-
> 2 files changed, 71 insertions(+), 2 deletions(-)
> create mode 100644 meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
>
> diff --git a/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
> new file mode 100644
> index 0000000..99ad91c
> --- /dev/null
> +++ b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
> @@ -0,0 +1,70 @@
> +dhclient-script: drop resolv.conf.dhclient
> +
> +Even though '/etc' is on the readonly partition, it's possible that
> +/etc/resolv.conf is on a separate writable partition.
> +
> +In this situation, we should drop the temp file resolv.conf.dhclient,
> +use shell variable instead.
> +
> +Upstream-Status: Pending
> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +---
> + client/scripts/linux | 18 +++++++++---------
> + 1 file changed, 9 insertions(+), 9 deletions(-)
> +
> +diff --git a/client/scripts/linux b/client/scripts/linux
> +index 6f8ea4b..b369bef 100755
> +--- a/client/scripts/linux
> ++++ b/client/scripts/linux
> +@@ -27,27 +27,27 @@ ip=/sbin/ip
> +
> + make_resolv_conf() {
> + if [ x"$new_domain_name_servers" != x ]; then
> +- cat /dev/null > /etc/resolv.conf.dhclient
> +- chmod 644 /etc/resolv.conf.dhclient
> ++ resolv_conf=""
> + if [ x"$new_domain_search" != x ]; then
> +- echo search $new_domain_search >> /etc/resolv.conf.dhclient
> ++ resolv_conf="search ${new_domain_search}\n"
> + elif [ x"$new_domain_name" != x ]; then
> + # Note that the DHCP 'Domain Name Option' is really just a domain
> + # name, and that this practice of using the domain name option as
> + # a search path is both nonstandard and deprecated.
> +- echo search $new_domain_name >> /etc/resolv.conf.dhclient
> ++ resolv_conf="search ${new_domain_name}\n"
> + fi
> + for nameserver in $new_domain_name_servers; do
> +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
> ++ resolv_conf="${resolv_conf}nameserver ${nameserver}\n"
> + done
> +
> +- mv /etc/resolv.conf.dhclient /etc/resolv.conf
> ++ echo -e "${resolv_conf}" > /etc/resolv.conf
> + elif [ "x${new_dhcp6_name_servers}" != x ] ; then
> + cat /dev/null > /etc/resolv.conf.dhclient6
> + chmod 644 /etc/resolv.conf.dhclient6
The above two calling should be removed,
Sorry for the missing.
I have updated
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-dhcpclient
Not resend V4.
//Hongxu
> ++ resolv_conf=""
> +
> + if [ "x${new_dhcp6_domain_search}" != x ] ; then
> +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
> ++ resolv_conf="search ${new_dhcp6_domain_search}\n"
> + fi
> + shopt -s nocasematch
> + for nameserver in ${new_dhcp6_name_servers} ; do
> +@@ -59,11 +59,11 @@ make_resolv_conf() {
> + else
> + zone_id=
> + fi
> +- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
> ++ resolv_conf="${resolv_conf}nameserver ${nameserver}$zone_id\n"
> + done
> + shopt -u nocasematch
> +
> +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
> ++ echo -e "${resolv_conf}" > /etc/resolv.conf
> + fi
> + }
> +
> +--
> +1.8.1.2
> +
> diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb b/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb
> index 08db41b..d823350 100644
> --- a/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb
> +++ b/meta/recipes-connectivity/dhcp/dhcp_4.2.5-P1.bb
> @@ -1,11 +1,10 @@
> require dhcp.inc
>
> -PR = "r1"
> -
> SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
> file://fix-external-bind.patch \
> file://link-with-lcrypto.patch \
> file://fixsepbuild.patch \
> + file://dhclient-script-drop-resolv.conf.dhclient.patch \
> "
>
> SRC_URI[md5sum] = "f68e3c1f00a9af5742bc5e71d567cf93"
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-05 9:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 8:52 [PATCH V3 0/1] dhcp-client: fix invoke dhclient-script failed on Read-only file system Hongxu Jia
2014-03-05 8:52 ` [PATCH 1/1] " Hongxu Jia
2014-03-05 9:08 ` Hongxu Jia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox