chiark / gitweb /
rules_generator: net rules - always add KERNEL== match to generated rules
authorKay Sievers <kay.sievers@vrfy.org>
Mon, 14 Apr 2008 22:21:51 +0000 (00:21 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 14 Apr 2008 22:21:51 +0000 (00:21 +0200)
extras/rule_generator/75-persistent-net-generator.rules
extras/rule_generator/write_net_rules

index 2aa3076a5932c8b6add2b7f54bbe6231ecacf0e5..85a4c5b55b14a55acd017de78e3028ce7113b347 100644 (file)
@@ -18,7 +18,7 @@ SUBSYSTEM!="net", GOTO="persistent_net_generator_end"
 NAME=="?*", GOTO="persistent_net_generator_end"
 
 # device name whitelist
-KERNEL!="eth*|ath*|wlan*[0-9]|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"
+KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"
 
 # ignore Xen virtual interfaces
 SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
index 765e56f6d3ef5b9fab2dcc375dd13feb69016453..322398bce4b3b277a8910df2e1f32e10a7a6c134 100644 (file)
@@ -92,6 +92,9 @@ if [ -z "$match" ]; then
        exit 1
 fi
 
+basename=${INTERFACE%%[0-9]*}
+match="$match, KERNEL==\"$basename*\""
+
 if [ "$INTERFACE_NAME" ]; then
        # external tools may request a custom name
        COMMENT="$COMMENT (custom name provided by external tool)"
@@ -101,8 +104,6 @@ if [ "$INTERFACE_NAME" ]; then
        fi
 else
        # if a rule using the current name already exists, find a new name
-       basename=${INTERFACE%%[0-9]*}
-       match="$match, KERNEL==\"$basename*\""
        if interface_name_taken; then
                INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
                echo "INTERFACE_NEW=$INTERFACE"