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
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
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.
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
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
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
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
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).
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!
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
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
Deprecate the old 75-persistent-net-generator.rules.
See the ML discussion for details:
https://lists.debian.org/debian-devel/2015/05/msg00170.htmlhttps://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
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.
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)
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.
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: #717405Closes: #706221
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
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
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