Commit Graph

37 Commits

Author SHA1 Message Date
Marcin Skarbek 274f0dbeb5 don't ignore zd* block devices 2018-08-27 14:13:25 +02:00
Keith Busch 9eb0fc32d6 rules: Add by-id symlinks for persistent memory
This patch adds a by-id symlink to persistent memory namespace if it
exports a uuid attribute. The result looks like the following example:

 # ls -l /dev/disk/by-id/*
 lrwxrwxrwx 1 root root 13 Jul  9 15:24 pmem-206dcdfe-69b7-4e86-a01b-f540621ce62e -> ../../pmem1.2
 lrwxrwxrwx 1 root root 13 Jul  9 15:24 pmem-73840bf1-4e74-4ba4-a9c8-8248934c07c8 -> ../../pmem1.1
 lrwxrwxrwx 1 root root 13 Jul  9 15:24 pmem-8137bdfd-3c4d-4b26-b326-21da3d4cd4e5 -> ../../pmem1.4
 lrwxrwxrwx 1 root root 13 Jul  9 15:24 pmem-f43d1b6e-3300-46cb-8afc-06d66a7c16f6 -> ../../pmem1.3

Signed-off-by: Keith Busch <keith.busch@intel.com>
2018-07-10 09:55:57 +02:00
Milan Broz f2bd752215 udev: create /dev/disk/by-label symlink for LUKS2 (#8998)
LUKS2 header supports to device label and blkid since 2.32 version
already supports this option.

Persistent udev storage rules should create symlink for this label.

For older devices this value is not set so changed rule should be compatible.
2018-05-15 16:51:07 +02:00
gwendalcr e2c2d70ba7 rules: Add MODEL_ID for NVMe device (#7037)
To mimic MODEL_ID variable built for ATA and SCSI devices, add rules
to add MODEL_ID variable for NVMe devices.

TEST: Check on a system with NVMe device that MODEL_ID variable is
present:
 udevadm info --query=all -n /dev/nvme0n1p1 | grep ID_MODEL
and
 udevadm info --query=all -n /dev/nvme0n1p1 | grep ID_MODEL
return:
E: ID_MODEL=SAMSUNG...
2017-10-10 10:03:38 +02:00
Michael Grzeschik dbbf424c8b rules: ubi mtd - add link to named partitions (#6750)
[zjs:
- rebase onto recent master
- drop signed-off-by]
2017-09-14 14:53:07 +02:00
George McCollister 4e3f07029a rules: Handle MMC boot partitions by-path correctly (#6026)
Many eMMC devices have separate boot partitions that aren't part of the
normal partition table that show up as /dev/mmcblk[0-9]boot[0-9]. These
partitions are generally small (128KB to 16MB) and typically hold a boot
loader, boot loader data or a recovery image. Match these and create
-boot%n by-path symlinks.

Prior to this change by-path symlinks for the main device would be
incorrectly linked to one of the boot partitions.

For instance before:
/dev/disk/by-path/platform-219c000.usdhc linked to /dev/mmcblk1boot1

Now:
/dev/disk/by-path/platform-219c000.usdhc links to /dev/mmcblk1
/dev/disk/by-path/platform-219c000.usdhc-boot0 links to /dev/mmcblk1boot0
/dev/disk/by-path/platform-219c000.usdhc-boot1 links to /dev/mmcblk1boot1

On systems that support multiple SD/MMC devices it can be essential to
have by-path links to these devices since device names vary depending on
which other devices are connected.
2017-05-25 22:13:50 -04:00
Viktor Mihajlovski fb92fbb1b1 udev: Use parent bus id for virtio disk builtin path-id (#5500)
The builtin path id for virtio block devices has been changed
to use the bus id without a prefix "virtio-pci" to be
compatible with all virtio transport types.

In order to not break existing setups, the by-path symlinks for
virtio block devices on the PCI bus are reintroduced by udev rules.
The virtio-pci symlinks are considered to be deprecated and
should be replaced by the native PCI symlinks.

Example output for a virtio disk in PCI slot 7:
 $ ls  /dev/disk/by-path
 pci-0000:00:07.0
 pci-0000:00:07.0-part1
 virtio-pci-0000:00:07.0
 virtio-pci-0000:00:07.0-part1

See also
[1] https://lists.freedesktop.org/archives/systemd-devel/2017-February/038326.html
[2] https://lists.freedesktop.org/archives/systemd-devel/2017-March/038397.html

This reverts f073b1b but keeps the same symlinks for compatibility.
2017-03-01 15:30:17 -05:00
Keith Busch 5c1be4f730 Export NVMe WWID udev attribute (#5348)
We need this for multipath support without relying on NVMe to SCSI
translations.

Signed-off-by: Keith Busch <keith.busch@intel.com>
2017-02-17 08:46:06 +01:00
Lennart Poettering 01af8c019a gpt-auto-generator: support LUKS encrypted root partitions
Previously, we supported GPT auto-discovery for /home and /srv, but not
for the root partition. Add that, too.

Fixes: #859
2016-12-21 19:09:30 +01:00
Kieran Colford 471b9850ee rules: consider MMC device partitions with partition number > 9 (#4831)
Add entries for extra partitions found on MMC devices (common in Chromebooks).
2016-12-06 10:46:13 +01:00
Martin Pitt 561d496d0b rules: add persistent links for nbd devices (#4785)
https://bugs.debian.org/837999
2016-12-01 16:22:47 -05:00
Michal Sekletar a5110c9030 rules: introduce disk/by-id (model_serial) symlinks for NVMe drives (#3974)
$ ls -l /dev/disk/by-id/nvme*
lrwxrwxrwx. 1 root root 13 Aug 17 04:25 /dev/disk/by-id/nvme-HUSPR3216AHP301_STM0001B6780 -> ../../nvme0n1
lrwxrwxrwx. 1 root root 15 Aug 17 04:25 /dev/disk/by-id/nvme-HUSPR3216AHP301_STM0001B6780-part1 -> ../../nvme0n1p1

https://github.com/systemd/systemd/issues/1453
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=779ff75617099f4defe14e20443b95019a4c5ae8
2016-08-17 14:10:28 +02:00
Rusty Bird 542127ea96 rules: UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG property (#3714)
Sometimes, the persistent storage rules should be skipped for a subset
of devices. For example, the Qubes operating system prevents dom0 from
parsing untrusted block device content (such as filesystem metadata) by
shipping a custom 60-persistent-storage.rules, patched to bail out early
if the device name matches a hardcoded pattern.

As a less brittle and more flexible alternative, this commit adds a line
to the two relevant .rules files which makes them test the value of the
UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG device property, modeled
after the various DM_UDEV_DISABLE_*_RULES_FLAG properties.
2016-07-15 18:47:42 +02:00
bgbhpe f3bc4ccc2e rules: block: add support for pmem devices (#3683)
Persistent memory devices can be exposed as block devices as /dev/pmemN
and /dev/pmemNs.  pmemN is the raw device and is byte-addressable from
within the kernel and when mmapped by applications from a DAX-mounted
file system.  pmemNs has the block translation table (BTT) layered on top,
offering atomic sector/block access.  Both pmemN and pmemNs are expected
to contain file systems.

blkid(8) and lsblk(8) seem to correctly report on pmemN and pmemNs.
systemd v219 will populate /dev/disk/by-uuid/ when, for example, mkfs is
used on pmem, but systemd v228 does not.

Add pmem to the whitelist.
2016-07-08 17:43:56 +02:00
Lennart Poettering a4e9499d8d rules: block - add scm block devices to whitelist (#3494)
Since the introduction of the whitelist in 60-persistent-storage.rules
block device symlinks are no longer created for scm block devices.

Add scm to the whitelist.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
2016-06-10 15:19:26 +02:00
Uwe Kleine-König cf1d3efce9 rules: add /dev/disk/by-partuuid symlinks also for dos partition tables
blkid reports PARTUUID values also for partitions that are defined by a
dos partitioning scheme. Instead of limiting the partitioning scheme to
"gpt or dos" just drop the test for the partitioning scheme and trust
blkid to do the right thing.
2016-05-19 08:37:20 +02:00
Ming Lin 427a28ecbe rules: add NVMe rules (#3136)
Add NVMe rules using the "wwid" attribute.

root@target:~# cat /sys/block/nvme0n1/wwid
eui.3825004235000591

root@target:~# ls /dev/disk/by-id/ -l |grep nvme
lrwxrwxrwx 1 root root 13 Apr 27 16:08 nvme-eui.3825004235000591 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part2 -> ../../nvme0n1p2
2016-04-29 13:02:57 +02:00
Thomas Meyer 7519d221e0 UML: Fix block device setup
User mode linux block devices start with ubd, e.g. ubda, ubdb, etc..
2015-08-09 18:07:55 +02:00
Kay Sievers 604f02add6 rules: block - add dasd to whitelist 2015-07-05 16:22:30 +02:00
Cédric Delmas ba27fb2111 Process cciss devices
Do not skip the persistent storage rules for cciss devices
2015-06-29 09:54:58 +02:00
Alex Crawford fb2d301085 rules: re-add cciss rules
The original commit (1aff206) doesn't explain why these were removed.
This adds them back since they are in fact needed.
2015-06-10 15:49:41 -07:00
Alex Crawford bb5c512de2 rules: whitelist xvd* devices
Xen disks need to be whitelisted as well.
2015-06-08 18:22:21 -07:00
Ed Swierk ff2aa01e61 Add /dev/xvd* to 60-persistent-storage whitelist
Without this, systemd-udevd does not create persistent storage symlinks
for xen block devices.
2015-06-03 08:08:37 -07:00
David Mohr 19672f1e5f udev: Bring back persistant storage symlinks for bcache
https://bugs.debian.org/787367
2015-06-01 11:44:52 +02:00
Mantas Mikulėnas afa91a7231 rules: storage - support MemoryStick (non-Pro) cards
These are handled by a different driver than MemoryStick Pro.
2015-03-24 23:34:58 +01:00
Kay Sievers 174470fbf1 rules: storage - whitelist partitioned MS & MMC devices
On Mon, Mar 23, 2015 at 8:55 AM, Mantas Mikulėnas <grawity@gmail.com> wrote:
> On Tue, Mar 17, 2015 at 11:50 PM, Kay Sievers <kay@vrfy.org> wrote:
>> On Tue, Mar 17, 2015 at 5:00 PM, Mantas Mikulėnas <grawity@gmail.com>
>> wrote:
>> > Accidentally dropped in 1aff20687f.
>> > ---
>> >  rules/60-persistent-storage.rules | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> > +KERNEL!="loop*|mmcblk[0-9]*|mspblk[0-9]*|nvme*|sd*|sr*|vd*",
>> > GOTO="persistent_storage_end"
>>
>> We can't do that, we need to ignore the mmc*rpmb devices:
>>
>> http://cgit.freedesktop.org/systemd/systemd/commit/?id=b87b01cf83947f467f3c46d9831cd67955fc46b9
>>
>> Maybe "mmcblk*[0-9]" will work?
>
> Yeah, that would probably work (the names are like mmcblk0p1 etc.)
2015-03-24 23:28:25 +01:00
Tom Gundersen c6e20ceb09 rules: storage - don't apply rules to remove events
This line was accidentally lost in 52346b5f54.
2015-03-24 15:23:49 +01:00
Kay Sievers 52346b5f54 rules: move block device rules to its own rules file 2015-03-12 16:09:46 +01:00
Kay Sievers 1aff20687f rules: storage - relace blacklist with explicit whitelist
Newly added kernel drivers repeatedly pass our blacklist and
cause trouble for the devices, because they do not expect to
be examined by udev's default rules which include blkid.

This turns the blacklist into a whitelist. Device type which
need support for additional symlinks need to be added to the
whitelist now.

Note, that the by-id, by-path symlinks are only intended for
hotpluggable devices. There is no reason for exotic, or for
statically configured devices to provide them.
2015-03-12 15:16:00 +01:00
Martin Pitt 0c13be389f rules: simplify mmc RPMB handling
We don't actually want a by-path/ symlink for MMC RPMB devices, so just add
them to the blacklist. This will prevent creating wrong by-path links and
blkid'ing those.
2015-02-13 10:59:38 +01:00
Martin Pitt b87b01cf83 rules: Fix by-path of mmc RPMB partitions and don't blkid them
Linux 3.10+ exposes RPMB (Replay Protected Memory Block) partitions of MMC
devices [1] ; trying to read them with blkid or other unspecific means will
cause kernel buffer I/O errors and timeouts. So don't run blkid on these.

Also ensure that /dev/disk/by-path creates proper symlinks and exposes the
-rpmb partition separately, instead of letting the "normal" partition symlink
point to the rpbm device (this is a race condition).

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=090d25fe224c0

https://launchpad.net/bugs/1333140
2015-02-13 08:39:07 +01:00
Lennart Poettering 98b2f766b2 gpt-auto-generator: rename root device node symlink to /dev/gpt-auto-root
Before it was placed in /dev/disk/by-id, which makes it a bit too much
API. However, it's mostly an implementation detail for now, hence move
it out of the stable block device dir.
2014-03-11 17:43:41 +01:00
Lennart Poettering 329f7803ee udev: automatically create a symlink /dev/disk/by-id/gpt-auto-root if there's a suitable root partition 2014-03-07 03:30:30 +01:00
Jan Engelhardt 73e231abde doc: update punctuation
Resolve spotted issues related to missing or extraneous commas, dashes.
2014-02-17 19:03:07 -05:00
Jóhann B. Guðmundsson 99bd4af0c7 udev: add zram to the list of devices inappropriate for symlinks
udev seems to have a race condition with swapon to see which can open
/dev/zram0 first, causing swapon to fail. Seems to be most noticeable
on arm devices one out of every 7 times or something.
2014-02-05 19:29:33 -05:00
Kay Sievers 17e588a4f2 rules: there is no "ata" subsystem for ATA device 2013-01-28 03:53:33 +01:00
Kay Sievers 3e2147858f move imported udev into place 2012-04-04 05:05:07 +02:00
Renamed from src/udev/rules/60-persistent-storage.rules (Browse further)