<div dir="ltr"><div>Hello,</div><div><br></div><div>A recent change to udev prevented loop partitions (ex. /dev/loop0p2) from being managed by systemd. I'd like to modify the rule to match only what was intended, loop devices that aren't yet attached to anything.</div>
<div><br></div><div>git format-patch below. I've never submitted a patch before, please let me know if I did this wrong.</div><div><br></div><div><br></div><div>SYSTEMD_READY is currently set to 0 for all loop devices (loop[0-9]*)</div>
<div>that do not have a backing_file. Partitioned loop devices (ex. loop0p1),</div><div>however, are matched by this rule and excluded by systemd even though</div><div>they are active devices.</div><div><br></div><div>This change adds an additional check to the rule, ensuring that only</div>
<div>top level loop devices (loop[0-9]+$) are excluded from systemd.</div><div>---</div><div> rules/<a href="http://99-systemd.rules.in">99-systemd.rules.in</a> | 2 +-</div><div> 1 file changed, 1 insertion(+), 1 deletion(-)</div>
<div><br></div><div>diff --git a/rules/<a href="http://99-systemd.rules.in">99-systemd.rules.in</a> b/rules/<a href="http://99-systemd.rules.in">99-systemd.rules.in</a></div><div>index c3ef81b..aa435c4 100644</div><div>--- a/rules/<a href="http://99-systemd.rules.in">99-systemd.rules.in</a></div>
<div>+++ b/rules/<a href="http://99-systemd.rules.in">99-systemd.rules.in</a></div><div>@@ -23,7 +23,7 @@ SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state",</div>
<div> SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"</div><div> </div><div> # Ignore loop devices that don't have any file attached</div>
<div>-SUBSYSTEM=="block", KERNEL=="loop[0-9]*", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0"</div><div>+SUBSYSTEM=="block", KERNEL=="loop[0-9]*", ENV{DEVTYPE}=="disk", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0"</div>
<div> </div><div> # Ignore nbd devices in the "add" event, with "change" the nbd is ready</div><div> ACTION=="add", SUBSYSTEM=="block", KERNEL=="nbd*", ENV{SYSTEMD_READY}="0"</div>
<div>-- </div><div>2.0.3</div><div><br></div><div><br></div><div><div>Why add the check I did?</div><div>inactive loop devices have a DEVTYPE of disk and no backing file</div><div>active loop devices have a DEVTYPE of disk and a backing file</div>
<div>active loop partitions (loop*p*) have a DEVTYPE of partition and no backing file</div><div><br></div><div>So, this change selects on both a DEVTYPE of disk and no backing file, so we only get inactive loop devices, and not loop partitions, that might just happen to be my root partition.</div>
</div><div><br></div><div>Thanks!</div><div><br></div><div>Kevin</div><div><br></div></div>