From: Anton Blanchard <anton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] Handle upper case MAC addresses in ifname option
Date: Mon, 31 Oct 2011 22:28:58 +1100 [thread overview]
Message-ID: <20111031222858.63cdc814@kryten> (raw)
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-10-31 21:35:17.107601600 +1100
+++ dracut/modules.d/40network/parse-ifname.sh 2011-10-31 21:35:18.199621240 +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.kernel.7.xml
===================================================================
--- dracut.orig/dracut.kernel.7.xml 2011-10-31 21:58:49.353246994 +1100
+++ dracut/dracut.kernel.7.xml 2011-10-31 22:05:47.840887387 +1100
@@ -456,7 +456,6 @@ This parameter can be specified multiple
<term><envar>ifname=</envar><replaceable><interface></replaceable>:<replaceable><MAC></replaceable></term>
<listitem>
<para>Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
-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-10-31 11:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20111031222858.63cdc814@kryten \
--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