From: Rongqing Li <rongqing.li@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH][resend][v2] dhcp: make dhclient to get configuration for other programs
Date: Mon, 27 Jul 2015 08:55:44 +0800 [thread overview]
Message-ID: <55B58190.7020409@windriver.com> (raw)
In-Reply-To: <1437114709-26291-1-git-send-email-rongqing.li@windriver.com>
ping
-Roy
On 2015年07月17日 14:31, rongqing.li@windriver.com wrote:
> From: Li Wang <li.wang@windriver.com>
>
> Make dhclient to run /etc/dhcp/dhclient.d/*.sh, and get the configuration
> for ntp, nis or other programes
>
> These codes are from redhat rpm package.
>
> Signed-off-by: Li Wang <li.wang@windriver.com>
> Signed-off-by: Roy Li <rongqing.li@windriver.com>
> ---
> .../dhcp/dhcp/dhcp-add-exec-script-function.patch | 101 +++++++++++++++++++++
> meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb | 1 +
> meta/recipes-connectivity/dhcp/files/dhclient.conf | 1 +
> 3 files changed, 103 insertions(+)
> create mode 100644 meta/recipes-connectivity/dhcp/dhcp/dhcp-add-exec-script-function.patch
>
> diff --git a/meta/recipes-connectivity/dhcp/dhcp/dhcp-add-exec-script-function.patch b/meta/recipes-connectivity/dhcp/dhcp/dhcp-add-exec-script-function.patch
> new file mode 100644
> index 0000000..73b3ce4
> --- /dev/null
> +++ b/meta/recipes-connectivity/dhcp/dhcp/dhcp-add-exec-script-function.patch
> @@ -0,0 +1,101 @@
> +[PATCH] dhcp: add exec script function
> +
> +Upstream-Statue: Pending
> +
> +Make dhclient to run /etc/dhcp/dhclient.d/*.sh, and get the configuration
> +for ntp, nis or other programes
> +
> +These codes are from redhat rpm packages.
> +
> +Signed-off-by: Li Wang <li.wang@windriver.com>
> +Signed-off-by: Roy Li <rongqing.li@windriver.com>
> +---
> + client/scripts/linux | 25 ++++++++++++++++++++++++-
> + 1 file changed, 24 insertions(+), 1 deletion(-)
> +
> +diff --git a/client/scripts/linux b/client/scripts/linux
> +index 232a0aa..bdb5e22 100755
> +--- a/client/scripts/linux
> ++++ b/client/scripts/linux
> +@@ -24,6 +24,8 @@
> +
> + # 'ip' just looks too weird. /sbin/ip looks less weird.
> + ip=/sbin/ip
> ++ETCDIR="/etc/dhcp"
> ++export SAVEDIR=/var/lib/dhclient
> +
> + make_resolv_conf() {
> + if [ x"$new_domain_name_servers" != x ]; then
> +@@ -80,6 +82,20 @@ exit_with_hooks() {
> + exit $exit_status
> + }
> +
> ++execute_client_side_configuration_scripts() {
> ++# execute any additional client side configuration scripts we have
> ++ if [ "${1}" == "config" ] || [ "${1}" == "restore" ]; then
> ++ for f in ${ETCDIR}/dhclient.d/*.sh ; do
> ++ if [ -x ${f} ]; then
> ++ subsystem="${f%.sh}"
> ++ subsystem="${subsystem##*/}"
> ++ . ${f}
> ++ "${subsystem}_${1}"
> ++ fi
> ++ done
> ++ fi
> ++}
> ++
> + # Invoke the local dhcp client enter hooks, if they exist.
> + if [ -f /etc/dhclient-enter-hooks ]; then
> + exit_status=0
> +@@ -198,11 +214,14 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
> + ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
> + fi
> + make_resolv_conf
> ++ execute_client_side_configuration_scripts "config"
> + exit_with_hooks 0
> + fi
> +
> + if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
> + || [ x$reason = xSTOP ]; then
> ++ execute_client_side_configuration_scripts "restore"
> ++
> + if [ x$alias_ip_address != x ]; then
> + # Turn off alias interface.
> + ${ip} -4 addr flush dev ${interface} label ${interface}:0
> +@@ -281,7 +300,7 @@ if [ x$reason = xBOUND6 ] ; then
> +
> + # Check for nameserver options.
> + make_resolv_conf
> +-
> ++ execute_client_side_configuration_scripts "config"
> + exit_with_hooks 0
> + fi
> +
> +@@ -299,6 +318,7 @@ if [ x$reason = xRENEW6 ] || [ x$reason = xREBIND6 ] ; then
> + make_resolv_conf
> + fi
> +
> ++ execute_client_side_configuration_scripts "config"
> + exit_with_hooks 0
> + fi
> +
> +@@ -310,6 +330,7 @@ if [ x$reason = xDEPREF6 ] ; then
> + ${ip} -f inet6 addr change ${new_ip6_address}/${new_ip6_prefixlen} \
> + dev ${interface} scope global preferred_lft 0
> +
> ++ execute_client_side_configuration_scripts "config"
> + exit_with_hooks 0
> + fi
> +
> +@@ -318,6 +339,8 @@ if [ x$reason = xEXPIRE6 -o x$reason = xRELEASE6 -o x$reason = xSTOP6 ] ; then
> + exit_with_hooks 2;
> + fi
> +
> ++ execute_client_side_configuration_scripts "restore"
> ++
> + ${ip} -f inet6 addr del ${old_ip6_address}/${old_ip6_prefixlen} \
> + dev ${interface}
> +
> +--
> +1.9.1
> +
> diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb b/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
> index b4a05fc..a73d31f 100644
> --- a/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
> +++ b/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
> @@ -6,6 +6,7 @@ SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
> file://fixsepbuild.patch \
> file://dhclient-script-drop-resolv.conf.dhclient.patch \
> file://replace-ifconfig-route.patch \
> + file://dhcp-add-exec-script-function.patch \
> "
>
> SRC_URI[md5sum] = "5a284875dd2c12ddd388416d69156a67"
> diff --git a/meta/recipes-connectivity/dhcp/files/dhclient.conf b/meta/recipes-connectivity/dhcp/files/dhclient.conf
> index 0e6dcf9..0f7d42f 100644
> --- a/meta/recipes-connectivity/dhcp/files/dhclient.conf
> +++ b/meta/recipes-connectivity/dhcp/files/dhclient.conf
> @@ -17,6 +17,7 @@
> #supersede domain-name "fugue.com home.vix.com";
> #prepend domain-name-servers 127.0.0.1;
> request subnet-mask, broadcast-address, time-offset, routers,
> + nis-domain, nis-servers, domain-search, ntp-servers,
> domain-name, domain-name-servers, host-name,
> netbios-name-servers, netbios-scope;
> #require subnet-mask, domain-name-servers;
>
--
Best Reagrds,
Roy | RongQing Li
next prev parent reply other threads:[~2015-07-27 0:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 6:31 [PATCH][resend][v2] dhcp: make dhclient to get configuration for other programs rongqing.li
2015-07-27 0:55 ` Rongqing Li [this message]
2015-08-10 2:09 ` Rongqing Li
2015-08-20 7:17 ` Rongqing Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55B58190.7020409@windriver.com \
--to=rongqing.li@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox