From: Lennart Poettering Date: Tue, 7 Jan 2020 17:53:31 +0000 (+0100) Subject: unit: make sure to pull in modprobe@loop.service when RootImage= is used with DeviceA... X-Git-Tag: v245-rc1~168^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=867af7282b2eccab53727714172b1081532ca8de;p=thirdparty%2Fsystemd.git unit: make sure to pull in modprobe@loop.service when RootImage= is used with DeviceAllow= Fixes: #14214 --- diff --git a/src/core/unit.c b/src/core/unit.c index 03b4b57273a..399a8cf655b 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -4324,6 +4324,11 @@ int unit_patch_contexts(Unit *u) { r = cgroup_add_device_allow(cc, "block-blkext", "rwm"); if (r < 0) return r; + + /* Make sure "block-loop" can be resolved, i.e. make sure "loop" shows up in /proc/devices */ + r = unit_add_two_dependencies_by_name(u, UNIT_AFTER, UNIT_WANTS, "modprobe@loop.service", true, UNIT_DEPENDENCY_FILE); + if (r < 0) + return r; } }