chiark / gitweb /
rules_generator: add KERNEL=="<netifname>*" to generated rules
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 13 Mar 2008 15:31:14 +0000 (16:31 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 13 Mar 2008 15:31:14 +0000 (16:31 +0100)
Some boxes, like the PS3, have multiple independent hardware
interfaces, all sharing the same MAC address. If they have
different interface names base names, we can distinguish them
that way.

extras/rule_generator/write_net_rules

index 9b66c938f39380c1b6970f57b1447fe263192de5..765e56f6d3ef5b9fab2dcc375dd13feb69016453 100644 (file)
@@ -102,6 +102,7 @@ if [ "$INTERFACE_NAME" ]; then
 else
        # if a rule using the current name already exists, find a new name
        basename=${INTERFACE%%[0-9]*}
 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"
        if interface_name_taken; then
                INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
                echo "INTERFACE_NEW=$INTERFACE"