]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Handle upper case MAC addresses in ifname option
authorAnton Blanchard <anton@samba.org>
Mon, 26 Dec 2011 22:08:27 +0000 (09:08 +1100)
committerHarald Hoyer <harald@redhat.com>
Mon, 23 Jan 2012 08:48:34 +0000 (09:48 +0100)
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.

dracut.cmdline.7.xml
modules.d/40network/parse-ifname.sh

index 8a49056ff76a931050ce5854f2ec6b40d6603712..9357e25a01fd48fcdffa1790ae51ecf22af918d5 100644 (file)
@@ -464,7 +464,6 @@ This parameter can be specified multiple times.</para>
           <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>
index 4c3c70e44ed506fc74fe402a52846b749688c12b..26e6084d82d7b4cf11a23917f9842707241dc6b9 100755 (executable)
@@ -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="