#define _OSTREE_SYSROOT_READONLY_STAMP "/run/ostree-sysroot-ro.stamp"
#define _OSTREE_COMPOSEFS_ROOT_STAMP "/run/ostree-composefs-root.stamp"
+#define OTCORE_SYSROOT_NOT_WRITEABLE \
+ "sysroot.readonly=true requires %s to be writable at this point, the cmdline should contain rw " \
+ "but not ro, if that is not the case this is likely the issue"
+
#define autofree __attribute__ ((cleanup (cleanup_free)))
static inline int
if (sysroot_readonly)
{
if (!sysroot_currently_writable)
- errx (EXIT_FAILURE, "sysroot.readonly=true requires %s to be writable at this point",
- root_arg);
+ errx (EXIT_FAILURE, OTCORE_SYSROOT_NOT_WRITEABLE, root_arg);
/* Pass on the fact that we discovered a readonly sysroot to ostree-remount.service */
int fd = open (_OSTREE_SYSROOT_READONLY_STAMP, O_WRONLY | O_CREAT | O_CLOEXEC, 0644);
if (fd < 0)
if (sysroot_readonly)
{
if (!sysroot_currently_writable)
- errx (EXIT_FAILURE, "sysroot.readonly=true requires %s to be writable at this point",
- root_arg);
+ errx (EXIT_FAILURE, OTCORE_SYSROOT_NOT_WRITEABLE, root_arg);
}
/* Pass on the state for use by ostree-prepare-root */
g_variant_builder_add (&metadata_builder, "{sv}", OTCORE_RUN_BOOTED_KEY_SYSROOT_RO,