From 5022fab15fc16204d163883ca818fd6092dc919c Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 20 Jul 2023 22:26:40 +0100 Subject: [PATCH 1/2] Revert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks" This reverts commit f5e46b9e09d4ff3f1e6ee6e3a90adc704780a661. --- test/units/testsuite-50.sh | 42 -------------------------------------- 1 file changed, 42 deletions(-) diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index b97766a1e2..efdbe6ac74 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -470,48 +470,6 @@ mount -t ddi "${image}.gpt" "$T" -o ro,X-mount.mkdir,discard umount -R "$T" rmdir "$T" -LOOP="$(systemd-dissect --attach --loop-ref=waldo "${image}.raw")" - -# Wait until the symlinks we want to test are established -udevadm trigger -w "$LOOP" - -# Check if the /dev/loop/* symlinks really reference the right device -test /dev/loop/by-ref/waldo -ef "$LOOP" - -if [ "$(stat -c '%Hd:%Ld' "${image}.raw")" != '?d:?d' ] ; then - # Old stat didn't know the %Hd and %Ld specifiers and turned them into ?d - # instead. Let's simply skip the test on such old systems. - test "$(stat -c '/dev/loop/by-inode/%Hd:%Ld-%i' "${image}.raw")" -ef "$LOOP" -fi - -# Detach by loopback device -systemd-dissect --detach "$LOOP" - -# Test long reference name. -# Note, sizeof_field(struct loop_info64, lo_file_name) == 64, -# and --loop-ref accepts upto 63 characters, and udev creates symlink -# based on the name when it has upto _62_ characters. -name="$(for _ in {1..62}; do echo -n 'x'; done)" -LOOP="$(systemd-dissect --attach --loop-ref="$name" "${image}.raw")" -udevadm trigger -w "$LOOP" - -# Check if the /dev/loop/by-ref/$name symlink really references the right device -test "/dev/loop/by-ref/$name" -ef "$LOOP" - -# Detach by the /dev/loop/by-ref symlink -systemd-dissect --detach "/dev/loop/by-ref/$name" - -name="$(for _ in {1..63}; do echo -n 'x'; done)" -LOOP="$(systemd-dissect --attach --loop-ref="$name" "${image}.raw")" -udevadm trigger -w "$LOOP" - -# Check if the /dev/loop/by-ref/$name symlink does not exist -test ! -e "/dev/loop/by-ref/$name" - -# Detach by backing inode -systemd-dissect --detach "${image}.raw" -(! systemd-dissect --detach "${image}.raw") - # check for confext functionality mkdir -p /run/confexts/test/etc/extension-release.d echo "ID=_any" >/run/confexts/test/etc/extension-release.d/extension-release.test From 9915cc60868c77e7e8cecb669ddb90516dffc7df Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 20 Jul 2023 22:28:13 +0100 Subject: [PATCH 2/2] Revert "udev: add /dev/loop/ symlinks" Turns out this causes a regression and breaks losetup. It will need to be reworked in conjunction with util-linux changes. Fixes https://github.com/systemd/systemd/issues/28475 This reverts commit 5ac52d1f7b7cd11cad8b5c2e9812d7ee7560a517. --- rules.d/60-persistent-storage.rules.in | 9 --------- 1 file changed, 9 deletions(-) diff --git a/rules.d/60-persistent-storage.rules.in b/rules.d/60-persistent-storage.rules.in index 337f421120..b3c222a268 100644 --- a/rules.d/60-persistent-storage.rules.in +++ b/rules.d/60-persistent-storage.rules.in @@ -148,13 +148,4 @@ ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/ # the right device, to access specific disks in a race-free fashion) ENV{DISKSEQ}=="?*", ENV{ID_IGNORE_DISKSEQ}!="1", SYMLINK+="disk/by-diskseq/$env{DISKSEQ}$env{.PART_SUFFIX}" -# Create symlinks that allow referencing loopback devices by their backing file's inode number -ENV{ID_LOOP_BACKING_DEVICE}!="", ENV{ID_LOOP_BACKING_INODE}!="", SYMLINK+="loop/by-inode/$env{ID_LOOP_BACKING_DEVICE}-$env{ID_LOOP_BACKING_INODE}$env{.PART_SUFFIX}" - -# Similar, but uses the .lo_file_name field of the loopback device (note that -# this is basically just a free-form string passed from userspace to the kernel -# when the device is created, it is not necessarily a file system path like the -# "loop/backing_file" sysfs attribute, which is always an absolute path) -ENV{ID_LOOP_BACKING_FILENAME_ENC}!="", SYMLINK+="loop/by-ref/$env{ID_LOOP_BACKING_FILENAME_ENC}$env{.PART_SUFFIX}" - LABEL="persistent_storage_end"