mkinitrd unification across distributions
 help / color / mirror / Atom feed
From: Anton Blanchard <anton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 1/3] Handle upper case MAC addresses in ifname option
Date: Tue, 27 Dec 2011 09:08:27 +1100	[thread overview]
Message-ID: <20111226220903.564739340@samba.org> (raw)

[-- Attachment #1: udev_mac_lowercase.patch --]
[-- Type: text/plain, Size: 1798 bytes --]

While the documentation states that ifname MAC addresses must be
lower case, we silently accept upper case ones and fail later on
when udev doesn't rename the device.

Instead of adding sanity checking on the MAC address just convert
it to lower case and remove the requirement completely.

---

Index: dracut/modules.d/40network/parse-ifname.sh
===================================================================
--- dracut.orig/modules.d/40network/parse-ifname.sh	2011-12-27 09:01:08.000000000 +1100
+++ dracut/modules.d/40network/parse-ifname.sh	2011-12-27 09:02:05.420745541 +1100
@@ -25,7 +25,8 @@ parse_ifname_opts() {
     case $# in
         7)
             ifname_if=$1
-            ifname_mac=$2:$3:$4:$5:$6:$7
+            # udev requires MAC addresses to be lower case
+            ifname_mac=`echo $2:$3:$4:$5:$6:$7 | tr '[:upper:]' '[:lower:]'`
             ;;
         *)
             die "Invalid arguments for ifname="
Index: dracut/dracut.cmdline.7.xml
===================================================================
--- dracut.orig/dracut.cmdline.7.xml	2011-12-27 09:01:11.507776290 +1100
+++ dracut/dracut.cmdline.7.xml	2011-12-27 09:02:05.424745613 +1100
@@ -464,7 +464,6 @@ This parameter can be specified multiple
           <term><envar>ifname=</envar><replaceable>&lt;interface&gt;</replaceable>:<replaceable>&lt;MAC&gt;</replaceable></term>
           <listitem>
             <para>Assign network device name &lt;interface&gt; (ie eth0) to the NIC with MAC &lt;MAC&gt;.
-Note letters in the MAC-address must be lowercase!
 <remark>Note: If you use this option you <emphasis remap="B">must</emphasis> specify an ifname= argument for all interfaces used in ip= or fcoe= arguments.</remark>
 This parameter can be specified multiple times.</para>
           </listitem>


             reply	other threads:[~2011-12-26 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-26 22:08 Anton Blanchard [this message]
2011-12-26 22:08 ` [PATCH 2/3] server-id in ip= is not optional Anton Blanchard
     [not found]   ` <20111226220903.656046366-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-01-23 11:05     ` Harald Hoyer
2011-12-26 22:08 ` [PATCH 3/3] ip= server-id should be server-IP Anton Blanchard
     [not found]   ` <20111226220903.738439469-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-01-23 11:05     ` Harald Hoyer
     [not found] ` <20111226220903.564739340-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2011-12-29  9:06   ` [PATCH 1/3] Handle upper case MAC addresses in ifname option David Dillow
2012-01-23 11:04   ` Harald Hoyer

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=20111226220903.564739340@samba.org \
    --to=anton-eunubhrolfbytjvyw6ydsg@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