From: Daan De Meyer Date: Fri, 23 Sep 2022 07:55:26 +0000 (+0200) Subject: shared: Don't try to generate read-only filesystem that we don't support X-Git-Tag: v252-rc1~103^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F24794%2Fhead;p=thirdparty%2Fsystemd.git shared: Don't try to generate read-only filesystem that we don't support We need explicit support to generate read-only filesystems, since we always need to pass a source tree to the mkfs binary to populate the filesystem. As such, let's add an explicit check to return a recognizable error when users try to generate a read-only filesystem that we don't support. --- diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c index c8e31aeb96e..8161dbf825f 100644 --- a/src/shared/mkfs-util.c +++ b/src/shared/mkfs-util.c @@ -123,6 +123,10 @@ int make_filesystem( return log_error_errno(SYNTHETIC_ERRNO(EPROTONOSUPPORT), "mksquashfs binary not available."); if (r < 0) return log_error_errno(r, "Failed to determine whether mksquashfs binary exists: %m"); + } else if (fstype_is_ro(fstype)) { + return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), + "Don't know how to create read-only file system '%s', refusing.", + fstype); } else { if (root) return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),