All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 40network: Copy the customize dhcp config
@ 2014-09-12  5:27 Minfei Huang
       [not found] ` <1410499671-31253-1-git-send-email-mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Minfei Huang @ 2014-09-12  5:27 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Minfei Huang

It is not available to valid the following customize dhcp config
/etc/dhclient.conf in the initram environment.

supersede domain-name "machine.test.group";
supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;

The dracut doesnot acquire the customize dhcp config from
/etc/dhclient.conf file when construct the initram image.

Copy the customize config to make the config availably in the
initram environment by dhcp.

Signed-off-by: Minfei Huang <mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 modules.d/40network/module-setup.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index ae1f43f..76761f5 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -67,6 +67,15 @@ installkernel() {
         ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
 }
 
+setup_custom_dhclient() {
+    _dhclient_file="/etc/dhclient.conf"
+
+    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
+
+    [ ! -e $_dhclient_file ] && return
+    cat $_dhclient_file | grep ^supersede >> ${initdir}/$_dhclient_file
+}
+
 # called by dracut
 install() {
     local _arch _i _dir
@@ -79,7 +88,7 @@ install() {
     inst_script "$moddir/netroot.sh" "/sbin/netroot"
     inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
     inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
-    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
+    setup_custom_dhclient
     inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
     inst_hook pre-udev 60 "$moddir/net-genrules.sh"
     inst_hook cmdline 91 "$moddir/dhcp-root.sh"
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] 40network: Copy the customize dhcp config
       [not found] ` <1410499671-31253-1-git-send-email-mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-09-12 13:35   ` Vivek Goyal
       [not found]     ` <20140912133530.GB32421-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Vivek Goyal @ 2014-09-12 13:35 UTC (permalink / raw)
  To: Minfei Huang; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On Fri, Sep 12, 2014 at 01:27:51PM +0800, Minfei Huang wrote:
> It is not available to valid the following customize dhcp config
> /etc/dhclient.conf in the initram environment.
> 
> supersede domain-name "machine.test.group";
> supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
> 
> The dracut doesnot acquire the customize dhcp config from
> /etc/dhclient.conf file when construct the initram image.
> 
> Copy the customize config to make the config availably in the
> initram environment by dhcp.
> 
> Signed-off-by: Minfei Huang <mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Can you give more information about the problem here. Why only look
for "supercede" options only. What about rest of the options in
dhclient.conf?

Thanks
Vivek

> ---
>  modules.d/40network/module-setup.sh | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
> index ae1f43f..76761f5 100755
> --- a/modules.d/40network/module-setup.sh
> +++ b/modules.d/40network/module-setup.sh
> @@ -67,6 +67,15 @@ installkernel() {
>          ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
>  }
>  
> +setup_custom_dhclient() {
> +    _dhclient_file="/etc/dhclient.conf"
> +
> +    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
> +
> +    [ ! -e $_dhclient_file ] && return
> +    cat $_dhclient_file | grep ^supersede >> ${initdir}/$_dhclient_file
> +}
> +
>  # called by dracut
>  install() {
>      local _arch _i _dir
> @@ -79,7 +88,7 @@ install() {
>      inst_script "$moddir/netroot.sh" "/sbin/netroot"
>      inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
>      inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
> -    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
> +    setup_custom_dhclient
>      inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
>      inst_hook pre-udev 60 "$moddir/net-genrules.sh"
>      inst_hook cmdline 91 "$moddir/dhcp-root.sh"
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 40network: Copy the customize dhcp config
       [not found]     ` <20140912133530.GB32421-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-09-15  1:59       ` minfei
       [not found]         ` <A76B1C96-974B-4A3D-BAE5-CBD231FB35DC-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: minfei @ 2014-09-15  1:59 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA


On Sep 12, 2014, at 21:35, Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:

> On Fri, Sep 12, 2014 at 01:27:51PM +0800, Minfei Huang wrote:
>> It is not available to valid the following customize dhcp config
>> /etc/dhclient.conf in the initram environment.
>> 
>> supersede domain-name "machine.test.group";
>> supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
>> 
>> The dracut doesnot acquire the customize dhcp config from
>> /etc/dhclient.conf file when construct the initram image.
>> 
>> Copy the customize config to make the config availably in the
>> initram environment by dhcp.
>> 
>> Signed-off-by: Minfei Huang <mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 
> Can you give more information about the problem here. Why only look
> for "supercede" options only. What about rest of the options in
> dhclient.conf?
> 
> Thanks
> Vivek

Maybe the supercede is the frequently options which is customised.  But I think
I should not ignore the customised dhcp configuration /etc/dhclient.conf instead of
using the default dhcp configuration in dracut source directory.

Of course it will be fine to append all of the configuration customised dhclient.conf
to the default configuration by constructing the initram image. 

> 
>> ---
>> modules.d/40network/module-setup.sh | 11 ++++++++++-
>> 1 file changed, 10 insertions(+), 1 deletion(-)
>> 
>> diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
>> index ae1f43f..76761f5 100755
>> --- a/modules.d/40network/module-setup.sh
>> +++ b/modules.d/40network/module-setup.sh
>> @@ -67,6 +67,15 @@ installkernel() {
>>         ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
>> }
>> 
>> +setup_custom_dhclient() {
>> +    _dhclient_file="/etc/dhclient.conf"
>> +
>> +    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
>> +
>> +    [ ! -e $_dhclient_file ] && return
>> +    cat $_dhclient_file | grep ^supersede >> ${initdir}/$_dhclient_file
>> +}
>> +
>> # called by dracut
>> install() {
>>     local _arch _i _dir
>> @@ -79,7 +88,7 @@ install() {
>>     inst_script "$moddir/netroot.sh" "/sbin/netroot"
>>     inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
>>     inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
>> -    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
>> +    setup_custom_dhclient
>>     inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
>>     inst_hook pre-udev 60 "$moddir/net-genrules.sh"
>>     inst_hook cmdline 91 "$moddir/dhcp-root.sh"
>> -- 
>> 1.8.3.1
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe initramfs" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

— 
Minfei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 40network: Copy the customize dhcp config
       [not found]         ` <A76B1C96-974B-4A3D-BAE5-CBD231FB35DC-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-10-24  7:19           ` Harald Hoyer
       [not found]             ` <5449FD91.6070700-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Harald Hoyer @ 2014-10-24  7:19 UTC (permalink / raw)
  To: minfei, Vivek Goyal; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

On 15.09.2014 03:59, minfei wrote:
> 
> On Sep 12, 2014, at 21:35, Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> 
>> On Fri, Sep 12, 2014 at 01:27:51PM +0800, Minfei Huang wrote:
>>> It is not available to valid the following customize dhcp config
>>> /etc/dhclient.conf in the initram environment.
>>>
>>> supersede domain-name "machine.test.group";
>>> supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
>>>
>>> The dracut doesnot acquire the customize dhcp config from
>>> /etc/dhclient.conf file when construct the initram image.
>>>
>>> Copy the customize config to make the config availably in the
>>> initram environment by dhcp.
>>>
>>> Signed-off-by: Minfei Huang <mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>
>> Can you give more information about the problem here. Why only look
>> for "supercede" options only. What about rest of the options in
>> dhclient.conf?
>>
>> Thanks
>> Vivek
> 
> Maybe the supercede is the frequently options which is customised.  But I think
> I should not ignore the customised dhcp configuration /etc/dhclient.conf instead of
> using the default dhcp configuration in dracut source directory.
> 
> Of course it will be fine to append all of the configuration customised dhclient.conf
> to the default configuration by constructing the initram image. 


Hmmm, maybe simply do this?

-    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
+    inst_simple -H -o "/etc/dhclient.conf"
+    cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 40network: Copy the customize dhcp config
       [not found]             ` <5449FD91.6070700-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-10-24  8:25               ` minfei
  0 siblings, 0 replies; 5+ messages in thread
From: minfei @ 2014-10-24  8:25 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: Vivek Goyal, initramfs-u79uwXL29TY76Z2rM5mHXA

On 10/24/14 at 09:19am, Harald Hoyer wrote:
> On 15.09.2014 03:59, minfei wrote:
> > 
> > On Sep 12, 2014, at 21:35, Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > 
> >> On Fri, Sep 12, 2014 at 01:27:51PM +0800, Minfei Huang wrote:
> >>> It is not available to valid the following customize dhcp config
> >>> /etc/dhclient.conf in the initram environment.
> >>>
> >>> supersede domain-name "machine.test.group";
> >>> supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
> >>>
> >>> The dracut doesnot acquire the customize dhcp config from
> >>> /etc/dhclient.conf file when construct the initram image.
> >>>
> >>> Copy the customize config to make the config availably in the
> >>> initram environment by dhcp.
> >>>
> >>> Signed-off-by: Minfei Huang <mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> >>
> >> Can you give more information about the problem here. Why only look
> >> for "supercede" options only. What about rest of the options in
> >> dhclient.conf?
> >>
> >> Thanks
> >> Vivek
> > 
> > Maybe the supercede is the frequently options which is customised.  But I think
> > I should not ignore the customised dhcp configuration /etc/dhclient.conf instead of
> > using the default dhcp configuration in dracut source directory.
> > 
> > Of course it will be fine to append all of the configuration customised dhclient.conf
> > to the default configuration by constructing the initram image. 
> 
> 
> Hmmm, maybe simply do this?
> 
> -    inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
> +    inst_simple -H -o "/etc/dhclient.conf"
> +    cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"

Thank you for your review.
We will test and correct it.

Minfei
Thanks

> 
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-24  8:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12  5:27 [PATCH] 40network: Copy the customize dhcp config Minfei Huang
     [not found] ` <1410499671-31253-1-git-send-email-mhuang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-12 13:35   ` Vivek Goyal
     [not found]     ` <20140912133530.GB32421-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-15  1:59       ` minfei
     [not found]         ` <A76B1C96-974B-4A3D-BAE5-CBD231FB35DC-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-24  7:19           ` Harald Hoyer
     [not found]             ` <5449FD91.6070700-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-24  8:25               ` minfei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.