mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-20 18:09:21 +03:00
Merge pull request #3129 from cgwalters/fix-unlock-composefs-compat
prepare-root: Fix composefs + ostree admin unlock --hotfix compat
This commit is contained in:
commit
9faf55699a
@ -644,18 +644,11 @@ main (int argc, char *argv[])
|
|||||||
= "lowerdir=" TMP_SYSROOT
|
= "lowerdir=" TMP_SYSROOT
|
||||||
"/usr,upperdir=.usr-ovl-upper,workdir=" OTCORE_HOTFIX_USR_OVL_WORK;
|
"/usr,upperdir=.usr-ovl-upper,workdir=" OTCORE_HOTFIX_USR_OVL_WORK;
|
||||||
|
|
||||||
/* Except overlayfs barfs if we try to mount it on a read-only
|
unsigned long mflags = MS_SILENT;
|
||||||
* filesystem. For this use case I think admins are going to be
|
// Propagate readonly state
|
||||||
* okay if we remount the rootfs here, rather than waiting until
|
if (!sysroot_currently_writable)
|
||||||
* later boot and `systemd-remount-fs.service`.
|
mflags |= MS_RDONLY;
|
||||||
*/
|
if (mount ("overlay", TMP_SYSROOT "/usr", "overlay", mflags, usr_ovl_options) < 0)
|
||||||
if (path_is_on_readonly_fs (TMP_SYSROOT))
|
|
||||||
{
|
|
||||||
if (mount (TMP_SYSROOT, TMP_SYSROOT, NULL, MS_REMOUNT | MS_SILENT, NULL) < 0)
|
|
||||||
err (EXIT_FAILURE, "failed to remount rootfs writable (for overlayfs)");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mount ("overlay", TMP_SYSROOT "/usr", "overlay", MS_SILENT, usr_ovl_options) < 0)
|
|
||||||
err (EXIT_FAILURE, "failed to mount /usr overlayfs");
|
err (EXIT_FAILURE, "failed to mount /usr overlayfs");
|
||||||
}
|
}
|
||||||
else if (!using_composefs)
|
else if (!using_composefs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user