prepare-root: It's not necessary to make /var slave anymore

This commit is contained in:
Misaki Kasumi 2024-12-20 18:55:47 +08:00
parent d25cd57052
commit d472e60e03
2 changed files with 1 additions and 11 deletions

View File

@ -238,7 +238,7 @@ fstab_generator (const char *ostree_target, const bool is_aboot, const char *nor
"[Mount]\n"
"Where=%s\n"
"What=%s\n"
"Options=bind,slave,shared\n",
"Options=bind\n",
var_dst, var_src))
return FALSE;

View File

@ -640,16 +640,6 @@ main (int argc, char *argv[])
if (umount2 (var_dir, MNT_DETACH) < 0)
err (EXIT_FAILURE, "failed to umount %s", var_dir);
/* To avoid having submounts of /var propagate into $stateroot/var, the
* mount is made with slave+shared propagation. See the comment in
* ostree-impl-system-generator.c when /var isn't mounted in the
* initramfs for further explanation.
*/
if (mount (NULL, TMP_SYSROOT "/var", NULL, MS_SLAVE | MS_SILENT, NULL) < 0)
err (EXIT_FAILURE, "failed to change /var to slave mount");
if (mount (NULL, TMP_SYSROOT "/var", NULL, MS_SHARED | MS_SILENT, NULL) < 0)
err (EXIT_FAILURE, "failed to change /var to slave+shared mount");
}
/* This can be used by other things to signal ostree is in use */