1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

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.
This commit is contained in:
Daan De Meyer 2022-09-23 09:55:26 +02:00
parent eb43379cec
commit eaec699494

View File

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