~josvaz/vmbuilder/jenkins_kvm-wala-autoupdates

« back to all changes in this revision

Viewing changes to templates/img-extra-nets.tmpl

  • Committer: Jose Vazquez
  • Date: 2016-11-16 17:28:24 UTC
  • mfrom: (773.1.3 jenkins_kvm-ethx)
  • Revision ID: jose.vazquez@canonical.com-20161116172824-2xzx19g27sp4qacm
Enhance udev rule: skip eth0 and do RUN

The udev expressions are not full regex, eth[1-9]* just means:
'eth' followed by a number 1-9 and 'zero or more chars'
That will NOT match eth0 (or eth0something) but will match eth1 to eth99
(and will also match things like eth2xd)

Also looking at udev man RUN is more appropriate as it is an action,
while PROGRAM is still part of the matching filters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
    # Place an udev rule to call the script when an net device is added
83
83
    cat << EOF > ${mp}/etc/udev/rules.d/10-net-device-added.rules
84
84
# Run /usr/local/sbin/ephemeral_eth.sh every time a network device is added
85
 
ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth[0-9]*", PROGRAM="/usr/local/sbin/ephemeral_eth.sh %k"
 
85
ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth[1-9]*", RUN="/usr/local/sbin/ephemeral_eth.sh %k"
86
86
EOF
87
87
}
88
88