From: Yu Watanabe Date: Tue, 4 Feb 2025 04:26:25 +0000 (+0900) Subject: man/udevadm: add examples to get predictable interface name and persistent device... X-Git-Tag: v258-rc1~1386^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F36284%2Fhead;p=thirdparty%2Fsystemd.git man/udevadm: add examples to get predictable interface name and persistent device node symlinks Closes #23661. --- diff --git a/man/udevadm.xml b/man/udevadm.xml index c9e58e9cf57..4e1255bf4d6 100644 --- a/man/udevadm.xml +++ b/man/udevadm.xml @@ -879,7 +879,10 @@ devpath|file|unit - Simulate a udev event run for the given device, and print debug output. + + Simulate a udev event run for the given device, and print debug output. The option + may be useful for parsing the final result. See also Example section. + @@ -1293,6 +1296,36 @@ # udevadm lock -d /dev/sda1 dd if=fs.raw of=/dev/sda1 + + + Predict Network Interface Renaming + + To predict a network interface name, udevadm test can be used: + + $ udevadm test /sys/class/net/wlan0 --json=pretty 2>/dev/null | jq .networkInterface.name +"wlp59s0" + + + + Predict Symbolic links of a Device Node + + To predict symbolic links to a device node, udevadm test can be used: + + $ udevadm test /dev/nvme0n1p1 --json=pretty 2>/dev/null | jq .node.symlinks +[ + "/dev/disk/by-diskseq/1-part1", + "/dev/disk/by-id/nvme-WDC_PC_SN720_SDAQNTW-512G-1001_192290802247-part1", + "/dev/disk/by-id/nvme-WDC_PC_SN720_SDAQNTW-512G-1001_192290802247_1-part1", + "/dev/disk/by-id/nvme-eui.1922908022470001001b448b44ccb9d6-part1", + "/dev/disk/by-path/pci-0000:3c:00.0-nvme-1-part/by-partnum/1", + "/dev/disk/by-path/pci-0000:3c:00.0-nvme-1-part1" +] +$ udevadm test /dev/input/event3 --json=pretty 2>/dev/null | jq .node.symlinks +[ + "/dev/input/by-path/platform-i8042-serio-0-event-kbd" +] + +