diff options
| author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-04-12 09:49:19 (GMT) |
|---|---|---|
| committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-04-12 10:01:59 (GMT) |
| commit | 8b023317c16f3aa07b26a251bf6618716148ff29 (patch) | |
| tree | 4ac1d30360566bc0eecda3046435f5498322e0ce | |
| parent | a65bb9aafe03768b97e80cd91ef6997c04ff4adc (diff) | |
73-special-net-names.rules: Further refine ibmveth naming
Don't greedily chop off everything before a 0, as that breaks with vio
addresses like "30001002". Instead, just chop off the first four digits (bus
number) and chop off leading zeros (avoids calling sed or other external
programs, and there are at most four of them).
| -rw-r--r-- | debian/extra/rules/73-special-net-names.rules | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/debian/extra/rules/73-special-net-names.rules b/debian/extra/rules/73-special-net-names.rules index db3ff09..e2fb130 100644 --- a/debian/extra/rules/73-special-net-names.rules +++ b/debian/extra/rules/73-special-net-names.rules @@ -4,6 +4,6 @@ ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", ATT # ibmveth devices' $DEVPATH number is tied to (virtual) hardware (slot id # selected in the HMC), thus this provides a reliable naming (e. g. -# "/devices/vio/30000002/net/eth1"); the bus number ('3') is irrelevant, and -# there should only ever be one bus. -ACTION=="add", SUBSYSTEM=="net", NAME=="", DRIVERS=="ibmveth", PROGRAM="/bin/sh -ec 'D=${DEVPATH#*/vio/}; D=${D%%%%/*}; D=${D##*0}; echo ${D:-0}'", NAME="ibmveth$result" +# "/devices/vio/30000002/net/eth1"); we ignore the bus number, as +# there should only ever be one bus, and then remove leading zeros +ACTION=="add", SUBSYSTEM=="net", NAME=="", DRIVERS=="ibmveth", PROGRAM="/bin/sh -ec 'D=${DEVPATH#*/vio/}; D=${D%%%%/*}; D=${D#????}; D=${D#0}; D=${D#0}; D=${D#0}; D=${D#0}; echo ${D:-0}'", NAME="ibmveth$result" |
