From 867af7282b2eccab53727714172b1081532ca8de Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 7 Jan 2020 18:53:31 +0100 Subject: [PATCH] unit: make sure to pull in modprobe@loop.service when RootImage= is used with DeviceAllow= Fixes: #14214 --- src/core/unit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/unit.c b/src/core/unit.c index 03b4b57273..399a8cf655 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; } } -- 2.25.1