mkinitrd unification across distributions
 help / color / mirror / Atom feed
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Radek Vykydal <rvykydal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] Generate correct ifcfg file for vlan= option.
Date: Wed, 31 Jul 2013 15:50:49 +0200	[thread overview]
Message-ID: <51F91639.80308@redhat.com> (raw)
In-Reply-To: <1375276700-22881-1-git-send-email-rvykydal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On 07/31/2013 03:18 PM, Radek Vykydal wrote:
> ---
>  modules.d/45ifcfg/write-ifcfg.sh | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
> index 2e78c49..dcb2aef 100755
> --- a/modules.d/45ifcfg/write-ifcfg.sh
> +++ b/modules.d/45ifcfg/write-ifcfg.sh
> @@ -9,6 +9,10 @@ if [ -e /tmp/bridge.info ]; then
>      . /tmp/bridge.info
>  fi
>  
> +if [ -e /tmp/vlan.info ]; then
> +    . /tmp/vlan.info
> +fi
> +
>  mkdir -m 0755 -p /tmp/ifcfg/
>  mkdir -m 0755 -p /tmp/ifcfg-leases/
>  
> @@ -103,6 +107,9 @@ for netup in /tmp/net.*.did-setup ; do
>      # $netif can't be bridge and bond at the same time
>          bond=yes
>      fi
> +    if [ "$netif" = "$vlanname" ]; then
> +        vlan=yes
> +    fi
>      cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
>      {
>          echo "# Generated by dracut initrd"
> @@ -149,7 +156,7 @@ for netup in /tmp/net.*.did-setup ; do
>      } > /tmp/ifcfg/ifcfg-$netif
>  
>      # bridge needs different things written to ifcfg
> -    if [ -z "$bridge" ] && [ -z "$bond" ]; then
> +    if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
>          # standard interface
>          {
>              if [ -n "$macaddr" ]; then
> @@ -164,6 +171,15 @@ for netup in /tmp/net.*.did-setup ; do
>          } >> /tmp/ifcfg/ifcfg-$netif
>      fi
>  
> +    if [ -n "$vlan" ] ; then
> +        {
> +            echo "TYPE=Vlan"
> +            echo "NAME=\"$netif\""
> +            echo "VLAN=yes"
> +            echo "PHYSDEV=\"$phydevice\""
> +        } >> /tmp/ifcfg/ifcfg-$netif
> +    fi
> +
>      if [ -n "$bond" ] ; then
>          # bond interface
>          {
> 

thanks! pushed!

      parent reply	other threads:[~2013-07-31 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 13:18 [PATCH] Generate correct ifcfg file for vlan= option Radek Vykydal
     [not found] ` <1375276700-22881-1-git-send-email-rvykydal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-07-31 13:50   ` Harald Hoyer [this message]

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=51F91639.80308@redhat.com \
    --to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rvykydal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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