Skip to content
Snippets Groups Projects
Commit 8b023317 authored by Martin Pitt's avatar Martin Pitt
Browse files

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).
parent a65bb9aa
Branches
Tags
No related merge requests found
......@@ -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"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment