mkinitrd unification across distributions
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Cong Wang <amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [RFC PATCH 3/3] Avoid generating udev rules for vlan interface
Date: Mon, 21 May 2012 18:19:04 +0800	[thread overview]
Message-ID: <4FBA1698.3090006@gmail.com> (raw)
In-Reply-To: <4FBA0E7E.1070004-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On 05/21/2012 05:44 PM, Harald Hoyer wrote:
> Am 21.05.2012 11:31, schrieb Cong Wang:
>> On 05/21/2012 05:25 PM, Harald Hoyer wrote:
>>>> -        printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
>>>> ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if"
>>>> +        #Hack: vlan device has the same mac address with its physical device
>>>> +        [ -e /tmp/vlan.info ]&&   source /tmp/vlan.info
>>>> +        if [ "$ifname_if" != "$vlanname" ]; then
>>>> +            printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
>>>> ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if"
>>>> +        fi
>>>>        done
>>>>
>>>>        # Rename non named interfaces out of the way for named ones.
>>>
>>> Maybe one of the /sys attributes indicate, that it is a vlan interface?
>>
>> Hmm... I tried DRIVERS!="8021q", then I got:
>>
>> SUBSYSTEM=="net", ACTION=="add", DRIVERS!="8021q", ATTR{address}=="%s",
>> ATTR{type}=="1" NAME="eth0"
>>
>> SUBSYSTEM=="net", ACTION=="add", DRIVERS!="8021q", ATTR{address}=="%s",
>> ATTR{type}=="1" NAME="eth0.2"
>>
>> So, eth0 will be still renamed to eth0.2. :(
>
>
> DEVPATH!="*/virtual/*" should help

The problem is not in udev rules themselves, the problem is we generate 
two same lines for eth0 and eth0.2, even with DEVPATH!="*/virtual/*" we 
will have:

SUBSYSTEM=="net", ACTION=="add", DEVPATH!="*/virtual/*", 
ATTR{address}=="%s", ATTR{type}=="1" NAME="eth0"

SUBSYSTEM=="net", ACTION=="add", DEVPATH!="*/virtual/*", 
ATTR{address}=="%s", ATTR{type}=="1" NAME="eth0.2"

eth0 will be still override. Thus, we should only generate one line for 
eth0, and let ip/vconfig to name the eth0.2 upon eth0.

The reason why we have two lines is that I passed two ifname= cmdline, 
one for eth0 and the other for eth0.2, this is required by ip=, all 
interfaces in ip= should be passed in ifname= too.


Thanks!

  parent reply	other threads:[~2012-05-21 10:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21  9:14 [RFC PATCH 1/3] Add vlan support in network module Cong Wang
     [not found] ` <1337591686-31875-1-git-send-email-amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-21  9:14   ` [RFC PATCH 2/3] Remove netroot check in cmdline parsing code Cong Wang
2012-05-21  9:14   ` [RFC PATCH 3/3] Avoid generating udev rules for vlan interface Cong Wang
     [not found]     ` <1337591686-31875-3-git-send-email-amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-21  9:25       ` Harald Hoyer
     [not found]         ` <4FBA09F7.4030003-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-21  9:31           ` Cong Wang
     [not found]             ` <4FBA0B8D.1070708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-21  9:44               ` Harald Hoyer
     [not found]                 ` <4FBA0E7E.1070004-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-21 10:19                   ` Cong Wang [this message]
     [not found]                     ` <4FBA1698.3090006-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-21 11:27                       ` Harald Hoyer
     [not found]                         ` <4FBA26A1.6010109-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-22  1:43                           ` Cong Wang
     [not found]                             ` <4FBAEF49.60108-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-22  9:32                               ` Harald Hoyer
     [not found]                                 ` <4FBB5D3D.2080101-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-22 13:43                                   ` Cong Wang
     [not found]                                     ` <4FBB97E7.6060804-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-23  9:45                                       ` Harald Hoyer
     [not found]                                         ` <4FBCB1AC.907-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-24  4:50                                           ` Cong Wang
2012-05-21  9:22   ` [RFC PATCH 1/3] Add vlan support in network module Harald Hoyer
     [not found]     ` <4FBA094B.5040303-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-21  9:26       ` Cong Wang

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=4FBA1698.3090006@gmail.com \
    --to=xiyou.wangcong-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@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