]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup-generator: use systemd-makefs for implementation of "swap" and "tmp" options 15836/head
authorLennart Poettering <lennart@poettering.net>
Mon, 18 May 2020 16:37:02 +0000 (18:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 May 2020 18:50:03 +0000 (20:50 +0200)
This way we can take benefit of the correct block device locking we just
added.

I was thinking whether to instead pull in a regular
systemd-makefs@.service instance, but I couldn't come up with a reason
to, and thus opted for just doing the minimal patch and just replacing
the simply mkfs calls.

Fixes: #10179
Replaces: #13162

src/cryptsetup/cryptsetup-generator.c

index 20c752d88db24705ece07b6fbeb4417faffd6c26..5724f88d0a4cd1f218bead9ac300f875e38b483c 100644 (file)
@@ -367,12 +367,12 @@ static int create_disk(
 
         if (tmp)
                 fprintf(f,
-                        "ExecStartPost=/sbin/mke2fs '/dev/mapper/%s'\n",
+                        "ExecStartPost=" ROOTLIBEXECDIR "/systemd-makefs ext2 '/dev/mapper/%s'\n",
                         name_escaped);
 
         if (swap)
                 fprintf(f,
-                        "ExecStartPost=/sbin/mkswap '/dev/mapper/%s'\n",
+                        "ExecStartPost=" ROOTLIBEXECDIR "/systemd-makefs swap '/dev/mapper/%s'\n",
                         name_escaped);
 
         if (keydev)