Ninjatrappeur's systemd working tree
Go to file
Lidong Zhong 9b3278d907 udev: rename the persistent link for ATA devices
ATA devices should use the ATA ids like port number and (possibly)
master/slave or multiplier id, not the generic SCSI ID.
Currently only port number is included in the link. With this patch
the link would be able to support more cases, which are a) when the
device is behind a port multiplexer b) the distinction between master
and slave (distinguished by target id).

I tried to verify scenario a) with this patch, but I failed to find a
machine with PMP SATA devices attached. But the link below
https://github.com/systemd/systemd/issues/3943
could show what's the difference. Here is my test for scenario b)

Current version:
linux-ql21:~ # ll /sys/class/block/sd[ab]
lrwxrwxrwx 1 root root 0 May  8 20:46 /sys/class/block/sda ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:0/3:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 May  8 20:46 /sys/class/block/sdb ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:1/3:0:1:0/block/sdb
linux-ql21:~ # ll /dev/disk/by-path/pci-0000\:00\:01.1-ata-1
lrwxrwxrwx 1 root root 9 May  8 20:44
/dev/disk/by-path/pci-0000:00:01.1-ata-1 -> ../../sdb
linux-ql21:~ # udevadm info /sys/class/block/sda |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1
E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-path/pci-0000:00:01.1-ata-1
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
linux-ql21:~ # udevadm info /sys/class/block/sdb |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1
E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-path/pci-0000:00:01.1-ata-1

After patch applied:
linux-ql21:~ # ll /sys/class/block/sd[ab]
lrwxrwxrwx 1 root root 0 May  8 21:07 /sys/class/block/sda ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:0/3:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 May  8 21:07 /sys/class/block/sdb ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:1/3:0:1:0/block/sdb
linux-ql21:~ # ll /dev/disk/by-path/pci-0000\:00\:01.1-ata-*
lrwxrwxrwx 1 root root  9 May  8 21:07
/dev/disk/by-path/pci-0000:00:01.1-ata-1.0 -> ../../sda
lrwxrwxrwx 1 root root  9 May  8 21:07
/dev/disk/by-path/pci-0000:00:01.1-ata-1.1 -> ../../sdb
linux-ql21:~ # udevadm info /sys/class/block/sda |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1.0
E: DEVLINKS=/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/ata-VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-path/pci-0000:00:01.1-ata-1.0
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
linux-ql21:~ # udevadm info /sys/class/block/sdb |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1.1
E: DEVLINKS=/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/ata-VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-path/pci-0000:00:01.1-ata-1.1

Changelog:
v5: add another parameter compat_link in handle_scsi()
v4: comment for ID_PATH_ATA_COMPAT
    get string length with pointer difference
    (suggested by Franck Bui<fbui@suse.com>)
v3: creating compatible link from env
    variables type change
v2: remove udev rules modification for compatible link
    setup a test scenario of master/slave ATA devices
v1: initial patch
2020-05-21 09:58:06 +02:00
.github cifuzz: protect forks from CIFuzz 2020-05-19 08:12:07 +02:00
.lgtm/cpp-queries lgtm: complain about accept() [people should use accept4() instead, due to O_CLOEXEC] 2019-04-10 20:03:38 +02:00
.mkosi Tidy up the Fedora mkosi Package list 2020-05-13 08:23:51 +02:00
catalog catalog,po: update Polish translation 2020-05-04 17:13:02 +02:00
coccinelle tree-wide: formatting tweaks reported by Coccinelle 2020-04-21 23:21:04 +02:00
docs Merge pull request #15661 from hundeboll/mount-read-write-only 2020-05-20 15:48:04 +02:00
factory/etc home: add pam_systemd_home.so PAM hookup 2020-01-28 22:36:41 +01:00
hwdb.d hwdb: fix microphone shortcut on HP EliteBook 840 G1 2020-05-15 09:09:08 +02:00
man Merge pull request #15854 from poettering/call-method-ret-error 2020-05-20 15:12:37 -07:00
modprobe.d Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
network network: add TUN/TAP vt-* network rule for VMs 2020-04-17 19:15:00 +02:00
po catalog,po: update Polish translation 2020-05-04 17:13:02 +02:00
presets preset: let's clean up preset list a bit 2020-04-07 19:01:00 +02:00
rules.d udev: rename the persistent link for ATA devices 2020-05-21 09:58:06 +02:00
semaphoreci ci: install fdisk on Debian 2020-05-14 04:24:49 +03:00
shell-completion shell-completion/zsh: update systemd-analyze completions 2020-04-27 08:40:15 +02:00
src udev: rename the persistent link for ATA devices 2020-05-21 09:58:06 +02:00
sysctl.d sysctl: enable coredump for suid binaries 2020-04-07 15:28:46 +02:00
sysusers.d sysusers,tmpfiles: re-create systemd-network, systemd-resolve and systemd-timesync 2018-07-16 17:11:50 +02:00
test Merge pull request #15865 from evverx/ubsan-to-the-rescue 2020-05-21 03:17:20 +03:00
tmpfiles.d pstore: introduce tmpfiles.d/systemd-pstore.conf 2020-05-15 23:15:26 +02:00
tools man: put all pages which mention a specifier in the index 2020-05-07 16:30:10 +02:00
travis-ci fuzzit: turn on the pointer-overflow check 2020-05-20 16:07:26 +02:00
units allow removal of initrd services 2020-05-19 10:19:18 +02:00
xorg scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.clang-format Improve help for clang-format 2020-04-25 09:39:31 +02:00
.ctags editors: Prevent ctags from following symlinks 2019-02-15 11:01:20 -08:00
.dir-locals.el scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.editorconfig scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore gitignore: add nspawn image lock and mkosi temporary files 2018-09-07 20:00:22 +02:00
.lgtm.yml lgtm: drop the TMPDIR/meson workaround 2020-03-03 20:27:42 +01:00
.mailmap NEWS: update contributors list 2020-03-03 08:31:06 +01:00
.travis.yml travis: add missing closing quote sign 2019-11-24 13:15:20 +03:00
.vimrc scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile build-sys: Fix Makefile wrapper for install target (#6548) 2017-08-07 11:29:20 +02:00
NEWS NEWS: retroactively document Family= 2020-05-19 16:21:52 +02:00
README coredump: add zstandard support for coredumps 2020-05-04 10:59:43 +02:00
README.md README: add a CIFuzz badge 2020-05-19 08:12:23 +02:00
TODO update TODO 2020-05-19 19:58:26 +02:00
azure-pipelines.yml Free up some resources on Azure Pipelines 2019-07-17 13:28:38 +09:00
configure treewide: more portable bash shebangs 2020-03-05 17:27:07 +01:00
meson.build build-system: build the fuzz targets with both ASan and UBSan 2020-05-20 16:07:13 +02:00
meson_options.txt allow removal of initrd services 2020-05-19 10:19:18 +02:00
mkosi.build mkosi: Unify environment for unit tests 2020-04-22 10:35:12 +02:00
mkosi.default mkosi: create .mkosi directory 2016-10-06 11:53:58 -04:00
zanata.xml po: add basic fedora.zanata.org configuration 2018-02-19 13:56:57 +01:00

README.md

Systemd

System and Service Manager

Count of open issues over time Count of open pull requests over time Semaphore CI Build Status
Coverity Scan Status
Fuzzit Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
Travis CI Build Status
Language Grade: C/C++
CentOS CI Build Status
Build Status
Packaging status

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.

Stable branches with backported patches are available in the stable repo.