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.
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),