Commit Graph

45 Commits

Author SHA1 Message Date
Michael Biebl
a66d122048 Stop setting up device symlinks for CD-RW/DVD drives
Those udev rules were a Debian specific workaround that were mainly
added for compat with older software which wasn't able to automatically
discover those types of devices. Those rules didn't provide
stable/predictable names though, so remove them.

Closes: #991639
2021-07-31 19:32:56 +02:00
Michael Biebl
dcd337b646 Make it easier to override MAC based name policy for USB network adapters
Replace 73-usb-net-by-mac.rules with 73-usb-net-by-mac.link. The .link
file provides the same functionality but makes it easier to set a custom
name for USB network adapters via the systemd.link mechanism.

Closes: #941636
Thanks: Benjamin Poirier
2019-12-02 18:07:33 +01:00
Dan Streetman
8797c07910 d/extra/rules/73-special-net-names.rules: use $$ instead of $ in PROGRAM= value
The use of the '$' character in PROGRAM="" values is supposed to be doubled
if it is intended for use by the program being run, instead of as a
substitution variable for udev to replace before running the program; i.e.
it should be '$$' if udev should pass a single '$' in its place to the
program command line.

However, if the variable it precedes isn't a valid substitution variable
name, it is left in place for the program to evaluate.  So, while not
correct per the 'man udev' documentation, this udev rule's use of single
'$' characters has (and still currently does) work correctly.

However, since commit d7aee41db35f808bca92d4910bf6e52cec3f8e59, un-doubled
use of '$' characters like this has resulted in a warning message being printed:
[   17.560125] systemd-udevd[132]: /lib/udev/rules.d/73-special-net-names.rules:14 Invalid value "/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}'" for PROGRAM (char 16: invalid substitution type), ignoring, but please fix it.

This corrects the rule to use $$ instead.

Also, just to note, the rule already correctly doubles the '%' chars
that it uses.
2019-09-05 06:10:13 +00:00
Michael Biebl
bae57a28ad d/e/r/73-usb-net-by-mac.rules: skip if iface name was provided by user-space
See https://github.com/systemd/systemd/issues/12858 and
https://lkml.org/lkml/2014/7/10/88

Gbp-Dch: Short
2019-08-31 15:32:39 +00:00
Michael Biebl
395b4a77f2 d/e/r/73-usb-net-by-mac.rules: import net.ifnames only for network devices
Closes: #934589
2019-08-31 15:32:39 +00:00
Michael Biebl
655e466caf Drop debian/extra/rules/70-debian-uaccess.rules
Up-to-date udev rules for U2F devices are shipped in libu2f-udev
nowadays.

Closes: #889665
2018-02-09 23:32:13 +01:00
Nicolas Braud-Santoni
19c9134649 debian/extra/rules: Use updated U2F ruleset
This ruleset comes from Yubico's libu2f-host.

Closes: #824532
2017-07-03 18:49:27 +02:00
Martin Pitt
b04c4add2b Disable 99-default.link instead of the udev rule for disabling persistent interface names
Disabling 80-net-setup-link.rules will also cause ID_NET_DRIVER to not be set
any more, which breaks 80-container-ve.network and matching on driver name in
general. So disable the actual default link policy instead.

Still keep testing for 80-net-setup-link.rules in the upgrade fix and
73-usb-net-by-mac.rules to keep the desired behaviour on systems which already
disabled ifnames via that udev rule.

See https://lists.freedesktop.org/archives/systemd-devel/2016-November/037805.html
2016-11-15 08:53:06 +01:00
Martin Pitt
9e202a3291 73-usb-net-by-mac.rules: Split kernel command line import line
Reportedly this makes the rule actually work on some platforms. Thanks Alp
Toker!

LP: #1593379
2016-09-19 22:36:59 +02:00
Martin Pitt
b42e1f8af2 73-usb-net-by-mac.rules: Test for disabling 80-net-setup-link.rules more efficiently
Do not run readlink for *every* uevent, this should (at most) be done for USB
network devices, so move that test after that.

Also, stop calling readlink at all and just test if
/etc/udev/rules.d/80-net-setup-link.rules exists -- a common way to disable an
udev rule is to just "touch" it in /etc/udev/rule.d/ (i. e. empty file), and if
the rule is customized we cannot really predict anyway if the user wants
MAC-based USB net names or not.

LP: #1615021
2016-08-24 06:41:11 +02:00
Martin Pitt
93e26ec832 debian/extra/rules/73-usb-net-by-mac.rules: Disable when /etc/udev/rules.d/80-net-setup-link.rules is a symlink to /dev/null
To be consistent with the documented way to disable ifnames.

Closes: #824491
LP: #1593379
2016-06-30 13:07:11 +02:00
Martin Pitt
b9824a6c0f debian/extra/rules/70-debian-uaccess.rules: Add some more FIDO u2f devices from different vendors
Thanks Atoyama Tokanawa.

(See LP: #1387908)
2016-05-17 07:44:54 +02:00
Martin Pitt
845af7b797 73-special-net-names.rule: Name the IBM integrated management module virtual USB network card "ibmimm"
Thanks Marco d'Itri!
2016-05-11 23:10:37 +02:00
Martin Pitt
b3e7c6ee79 73-usb-net-by-mac.rules: Disable when net.ifnames=0 is specified on the kernel command line
To be consistent with disabling the *.link files.
2016-05-11 23:07:10 +02:00
Martin Pitt
b72e3d3b27 Split out udev rule to name USB network interfaces by MAC address into 73-usb-net-by-mac.rules
With that it is easier to disable.

Closes: #824025
2016-05-11 22:48:37 +02:00
Martin Pitt
09b5bcb064 Make FIDO U2F dongles accessible to the user session
This avoids having to install libu2f-host0 (which isn't discoverable at all) to
make those devices work.

Add this to debian/extra/rules/70-debian-uaccess.rules, as we might get similar
rules in the future. This was rejected upstream at
https://github.com/systemd/systemd/issues/102 because in some future this
should move to a proper kernel driver. Keep this downstream until that happens
and Chrome & friends move over to that.

LP: #1387908
2016-05-02 14:48:13 -05:00
Martin Pitt
efbe5b3e93 Set MAC based name for USB network interfaces only for universally administered (i. e. stable) MACs
Stop doing this for locally administered (i. e. randomly generated) ones. These
devices have no intrinsic stable properties, so use the default location based
names for those.

Drop /lib/systemd/network/90-mac-for-usb.link (as link files don't currently
support globs for MACAddress=) and replace with an udev rule in
/lib/udev/rules.d/73-special-net-names.rules.

Closes: #812575
LP: #1574483
2016-04-25 10:32:20 +02:00
Martin Pitt
8b023317c1 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).
2016-04-12 12:01:59 +02:00
Martin Pitt
3dee9daaf6 73-special-net-names.rules: Refine ibmveth naming
Stop assuming that the bus number always starts with '3', e. g. QEMU defaults
to '7'. Instead, now always just cut off the bus number prefix.  This assumes
that we won't get *two* virtual buses with conflicting device numbers, but
having multiple buses has never been observed.

If a device has number 'x000000', name it "ibmveth0" instead of just "ibmveth".

Add missing ' to terminate the sh -c '' command.

Thanks to Adam Conrad!
2016-04-12 10:32:33 +02:00
Martin Pitt
e9b0aa0f25 debian/extra/rules/73-special-net-names.rules: Add DEVPATH number based naming schema for ibmveth devices
ibmveth devices' $DEVPATH number usually starts with '3' and is tied to
(virtual) hardware (slot id selected in the HMC), thus this provides a reliable
naming. E. g. "/devices/vio/30000002/net/eth1" gets named "ibmveth2".

LP: #1561096
2016-04-11 23:51:56 +02:00
Martin Pitt
4bd57cb812 Rename debian/extra/rules/73-idrac.rules to 73-special-net-names.rules
It is going to get rules for other devices. Also install it into the initramfs.
2016-04-11 23:30:40 +02:00
Martin Pitt
ce90464a93 Drop net.agent, 80-networking.rules, and ifup@.service
These moved to ifupdown 0.8.5 now. Add Breaks: to earlier versions.
2016-01-02 10:03:56 +01:00
Martin Pitt
792d45a0a0 Fix CD/DVD symlinks
debian/extra/rules/80-debian-compat.rules: Remember which device got the
"cdrw", "dvd", or "dvdrw" symlink to avoid changing links on device events.

Drop the rule for the "cdrom" symlink as that is already created in
60-cdrom_id.rules.

Closes: #774080
2015-12-27 19:43:21 +01:00
Martin Pitt
4e853c368a Drop dsl-modem.agent
It hasn't been maintained/tested for many years, few if any people actually use
this, and this doesn't belong into udev.
2015-07-08 11:14:23 +02:00
Martin Pitt
47d7095cbd 80-networking.rules: Only call agents for add|remove
They don't handle other events, and net.agent just logs an error message. Avoid
wasted cycles on calling these scripts for change|move.
2015-06-17 14:42:49 +02:00
Martin Pitt
972bbc8e26 Switch to net.ifnames persistant network interfaces
Deprecate the old 75-persistent-net-generator.rules.

See the ML discussion for details:
     https://lists.debian.org/debian-devel/2015/05/msg00170.html
     https://lists.debian.org/debian-devel/2015/06/msg00018.html

  - Drop Make-net.ifnames-opt-in-instead-of-opt-out.patch, to use
    net.ifnames by default.
  - Revert-udev-network-device-renaming-immediately-give.patch: Adjust
    patch comment.
  - Drop 75-persistent-net-generator.rules, write_net_rules helper and
    rule_generator.functions.
  - Adjust udev's README.Debian accordingly, and describe the migration.
    This needs to happen manually as there is no robust way of doing this
    automatically.
  - Add udev NEWS file for announcing this change and pointing to udev's
    README.
  - udev.postinst: Drop write_interfaces_rules().
  - udev.postinst: Disable net.ifnames on systems which did not support
    75-persistent-net-generator.rules (most importantly, virtualized guests)
    to avoid changing network interface names on upgrade.

LP: #1454254
2015-06-15 20:09:57 +02:00
Martin Pitt
b378f1df66 Add debian/extra/rules/80-debian-compat.rules
This replaces three of our patches. These are independent udev rules to change
device permissions and add CD/DVD symlinks for compatibility with earlier
Debian releases.
2015-06-02 07:50:20 +02:00
Martin Pitt
183a860e1a 75-persistent-net-generator.rules: Fix rules for ibmveth
It's a driver, not a subsystem.

LP: #1437375
2015-05-05 15:14:42 +02:00
Martin Pitt
565eb746c3 Add userspace firmware loader stub
Reinstate a debian/extra/rules/50-firmware.rules which immediately tells the
kernel that userspace firmware loading failed. Otherwise it tries for a minute
to call the userspace helper (if CONFIG_FW_LOADER_USER_HELPER is enabled) in
vain, which causes long delays with devices which have a range of possible
firmware versions. (LP: #1398458)
2014-12-02 18:53:08 +01:00
Martin Pitt
37f4673cf5 75-persistent-net-generator.rules: Add new MS Azure MAC prefix 00:25:ae
LP: #1367883
2014-09-12 07:47:37 +02:00
Martin Pitt
e8f7d56d06 75-persistent-net-generator.rules: Fix matches of HyperV
LP: #1361272
2014-08-26 08:25:17 +02:00
Martin Pitt
9b81d900f6 75-persistent-net-generator.rules: Adjust Ravello interfaces
They don't violate the assignment schema, they should just not be persistent.
Thanks to Boris Figovsky.

Closes: #747475
LP: #1317776
2014-08-05 08:14:13 +02:00
Martin Pitt
7d0f5f5d98 Rename PowerEdge idrac network interfaces
On Dell PowerEdge systems, the iDRAC7 and later support a USB Virtual NIC for
management. Name this interface "idrac" to avoid confusion with "real" network
interfaces.
2014-04-27 10:56:36 +02:00
Marco d'Itri
ce7be9b190 Add more CD/DVD aliases to 60-cdrom_id.rules 2014-04-26 19:43:49 +02:00
Martin Pitt
4ce5b1f1e4 Drop our Debian specific 50-udev-default.rules and 91-permissions.rules
Use the upstream rules with a patch for the remaining Debian specific default
device permissions. Many thanks to Marco d'Itri for researching which
Debian-specific rules are obsolete!

Amongst other things, this now also reads the hwdb info for USB devices and
gets rid of some syntax errors.

Closes: #717405
Closes: #706221
2014-04-26 16:26:43 +02:00
Martin Pitt
5284b53b9d Drop our Debian specific 80-drivers.rules
Use the upstream rules with a patch for the sg module (see #657948). These now
stop calling modprobe and use the kmod builtin, giving some nice boot speed
improvement.

Closes: #717404
2014-04-26 14:32:15 +02:00
Martin Pitt
c114f9af15 Drop our Debian specific 60-persistent-storage{,-tape}.rules
Move to using the upstream rules. They are compatible and do a superset of the
functionality.

In our 60-persistent-storage.rules:
- hd* rules are obsolete (only using PATA drivers these days with SCSI)
- id_dasd is obsolete (not in any package on any arch in any release)
- id_edd in Debian seems to not exist. Dell's edd package ships these rules by
  itself
- ID_SCSI_COMPAT isn't set by id_scsi any more, thus rules are obsolete
2014-04-26 13:56:36 +02:00
Martin Pitt
9ba585861f Add new block of Windows Azure ethernet hardware address to 75-persistent-net-generator.rules
LP: #1274348
2014-04-26 13:39:17 +02:00
Martin Pitt
2bcb06e041 debian/extra/rules/75-persistent-net-generator.rules: Add Ravello systems
This is a cloud provider with VMs.

http://hwaddress.com/mac/2CC260-000000.html
https://launchpad.net/bugs/1099278
2013-11-07 10:22:13 +01:00
Michael Biebl
59d77869d4 Small documentation tweak, add reference to upstream docs 2013-09-11 23:56:43 +02:00
Michael Biebl
b08062333d Only import net.ifaces cmdline property for network devices
otherwise the property is set for all devices.
2013-08-09 13:48:15 +02:00
Michael Stapelberg
e5206e9751 Skip 75-persistent-net-generator.rules if net.ifnames==1 2013-07-19 00:03:12 +02:00
Michael Stapelberg
1862d150b3 remove edd_id, not shipped upstream anymore
removed upstream with commit 4774868cca
2013-07-18 19:29:19 +02:00
Michael Stapelberg
6a1547f157 drop custom firmware.agent, we use the upstream builtin now
The upstream one is called in 50-firmware.rules
2013-07-18 19:29:19 +02:00
Michael Biebl
b56f8637a1 Merge remaining files from udev 175-7
The patches from udev were either merged upstream, applied directly,
added as files to debian/extra/ or dropped:

- debian/patches/commit-4b50a3d
  Applied upstream in 4b50a3d004
- debian/patches/fix_gtkdoc_oot
  Fixed upstream
- debian/patches/libudevpc_no_librt
  Fixed upstream in e712ffcce6
- debian/patches/vio_type
  Dropped for now.
- debian/patches/debian_rules
  Added as debian/extra/rules/*
- debian/patches/extra_agents
  Added as debian/extra/*.agent and debian/extra/hotplug.functions
- debian/patches/extra_initramfs
  Added as debian/extra/initramfs.*
- debian/patches/extra_installer
  Added as debian/extra/udev.*
- debian/patches/extra_modprobeconf
  Added as debian/extra/fbdev-blacklist.conf and
  debian/extra/make-fbdev-blacklist
- debian/patches/extra_misc
  Added as debian/extra/links.conf and debian/extra/create_static_nodes
- debian/patches/dont-build-some-helpers
  Dropped, since we will use the upstream firmware agent now
- debian/patches/libgudev_in_usr
  Applied as 418b0a2d41
- debian/patches/rules_compat_qemu
  Dropped, only needed for kernel versions <= 2.6.32
- debian/patches/use_run_tmpfs
  Dropped, since wheezy /run is mandatory
- debian/patches/dev_root_rule
  Dropped, discouraged upstream
- debian/patches/udevd_in_sbin
  Dropped, we will use the $libexec path now in the .service file and
  provide compat symlinks
- udev_conf_comments
  Applied as c82d84e916
2013-07-18 18:57:39 +02:00