static int list_devices(void) {
enum {
COLUMN_NODE,
+ COLUMN_DISKSEQ,
COLUMN_PATH,
COLUMN_MODEL,
COLUMN_WWN,
if (r < 0)
return log_error_errno(r, "Failed to add property match: %m");
- table = table_new("node", "path", "model", "wwn", "fstype", "label", "uuid");
+ table = table_new("node", "diskseq", "path", "model", "wwn", "fstype", "label", "uuid");
if (!table)
return log_oom();
(void) sd_device_get_devname(d, &x);
break;
+ case COLUMN_DISKSEQ: {
+ uint64_t ds;
+
+ r = sd_device_get_diskseq(d, &ds);
+ if (r < 0) {
+ log_debug_errno(r, "Failed to get diskseq of block device, ignoring: %m");
+ r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
+ } else
+ r = table_add_cell(table, NULL, TABLE_UINT64, &ds);
+ if (r < 0)
+ return table_log_add_error(r);
+
+ continue;
+ }
+
case COLUMN_PATH:
(void) sd_device_get_property_value(d, "ID_PATH", &x);
break;
# systemd-mount --list and systemd-umount require the loopback block device is initialized by udevd.
udevadm settle --timeout 30
assert_in "/dev/loop.* ext4 +sd-mount-test" "$(systemd-mount --list --full)"
-LOOP_AUTO=$(systemd-mount --list --full --no-legend | awk '$6 == "sd-mount-test" { print $1 }')
+LOOP_AUTO=$(systemd-mount --list --full --no-legend | awk '$7 == "sd-mount-test" { print $1 }')
LOOP_AUTO_DEVPATH=$(udevadm info --query property --property DEVPATH --value "$LOOP_AUTO")
systemd-umount "$WORK_DIR/simple.img"
# Wait for 'change' uevent for the device with DISK_MEDIA_CHANGE=1.