]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkfs-util: Redirect mksquashfs output to /dev/null
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 14 Mar 2023 13:32:37 +0000 (14:32 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 15 Mar 2023 00:21:36 +0000 (00:21 +0000)
The -quiet option for mksquashfs was added somewhat recently so to
support older versions, let's redirect stdout of mksquashfs to
/dev/null instead.

src/shared/mkfs-util.c

index 6c259009af4cbe65d2a715b031436d8ae8739c26..bfaa4d1b55b311aeed66f5ccee1e265f4f331ee4 100644 (file)
@@ -455,14 +455,16 @@ int make_filesystem(
                                 "-U", vol_id,
                                 node);
 
-        else if (streq(fstype, "squashfs"))
+        else if (streq(fstype, "squashfs")) {
 
                 argv = strv_new(mkfs,
                                 root, node,
-                                "-quiet",
                                 "-noappend");
 
-        else if (streq(fstype, "erofs"))
+                /* mksquashfs -quiet option is pretty new so let's redirect stdout to /dev/null instead. */
+                stdio_fds[1] = -EBADF;
+
+        } else if (streq(fstype, "erofs"))
 
                 argv = strv_new(mkfs,
                                 "-U", vol_id,