New upstream version 2018.7
This commit is contained in:
commit
97a0aa1a42
199 files changed
+1261
-49717
No files matched your search
@@ -151,14 +151,17 @@ main(int argc, char *argv[])
|
||||
if (chdir (deploy_path) < 0)
|
||||
err (EXIT_FAILURE, "failed to chdir to deploy_path");
|
||||
|
||||
/* Default to true, but in the systemd case, default to false because it's handled by
|
||||
* ostree-system-generator. */
|
||||
bool mount_var = true;
|
||||
/* In the systemd case, this is handled by ostree-system-generator by default */
|
||||
#ifndef HAVE_SYSTEMD_AND_LIBMOUNT
|
||||
/* file in /run can override that behaviour */
|
||||
if (lstat (INITRAMFS_MOUNT_VAR, &stbuf) < 0)
|
||||
mount_var = false;
|
||||
#ifdef HAVE_SYSTEMD_AND_LIBMOUNT
|
||||
mount_var = false;
|
||||
#endif
|
||||
|
||||
/* file in /run can override the default behaviour so that we definitely mount /var */
|
||||
if (lstat (INITRAMFS_MOUNT_VAR, &stbuf) == 0)
|
||||
mount_var = true;
|
||||
|
||||
/* Link to the deployment's /var */
|
||||
if (mount_var && mount ("../../var", "var", NULL, MS_MGC_VAL|MS_BIND, NULL) < 0)
|
||||
err (EXIT_FAILURE, "failed to bind mount ../../var to var");
|
||||
@@ -207,8 +210,9 @@ main(int argc, char *argv[])
|
||||
|
||||
|
||||
/* We only stamp /run now if we're running in an initramfs, i.e. we're
|
||||
* not pid 1. Otherwise it's handled later via ostree-remount.service.
|
||||
* not pid 1. Otherwise it's handled later via ostree-system-generator.
|
||||
* https://mail.gnome.org/archives/ostree-list/2018-March/msg00012.html
|
||||
* https://github.com/ostreedev/ostree/pull/1675
|
||||
*/
|
||||
if (!running_as_pid1)
|
||||
touch_run_ostree ();
|
||||
|
||||
@@ -46,13 +46,8 @@ main(int argc, char *argv[])
|
||||
struct stat stbuf;
|
||||
int i;
|
||||
|
||||
/* See comments in ostree-prepare-root.c for this.
|
||||
*
|
||||
* This service is triggered via
|
||||
* ConditionKernelCommandLine=ostree
|
||||
* but it's a lot easier for various bits of userspace to check for
|
||||
* a file versus parsing the kernel cmdline. So let's ensure
|
||||
* the stamp file is created here too.
|
||||
/* When systemd is in use this is normally created via the generator, but
|
||||
* we ensure it's created here as well for redundancy.
|
||||
*/
|
||||
touch_run_ostree ();
|
||||
|
||||
@@ -94,7 +89,7 @@ main(int argc, char *argv[])
|
||||
/* It's a mounted, read-only fs; remount it */
|
||||
if (mount (target, target, NULL, MS_REMOUNT | MS_SILENT, NULL) < 0)
|
||||
{
|
||||
/* Also ignore ENINVAL - if the target isn't a mountpoint
|
||||
/* Also ignore EINVAL - if the target isn't a mountpoint
|
||||
* already, then assume things are OK.
|
||||
*/
|
||||
if (errno != EINVAL)
|
||||
|
||||
@@ -41,14 +41,6 @@ static const char *arg_dest_late = "/tmp";
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
/* Important: if this isn't an ostree-booted system, do nothing; people could
|
||||
* have the package installed as a dependency for flatpak or whatever.
|
||||
*/
|
||||
{ struct stat stbuf;
|
||||
if (fstatat (AT_FDCWD, "/run/ostree-booted", &stbuf, 0) < 0)
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* We conflict with the magic ostree-mount-deployment-var file for ostree-prepare-root */
|
||||
{ struct stat stbuf;
|
||||
if (fstatat (AT_FDCWD, INITRAMFS_MOUNT_VAR, &stbuf, 0) == 0)
|
||||
@@ -67,9 +59,22 @@ main(int argc, char *argv[])
|
||||
if (argc > 3)
|
||||
arg_dest_late = argv[3];
|
||||
|
||||
/* If we're installed on a system which isn't using OSTree for boot (e.g.
|
||||
* package installed as a dependency for flatpak or whatever), silently
|
||||
* exit so that we don't error, but at the same time work where switchroot
|
||||
* is PID 1 (and so hasn't created /run/ostree-booted).
|
||||
*/
|
||||
char *ostree_cmdline = read_proc_cmdline_ostree ();
|
||||
if (!ostree_cmdline)
|
||||
errx (EXIT_FAILURE, "Failed to find ostree= kernel argument");
|
||||
exit (EXIT_SUCCESS);
|
||||
|
||||
/* See comments in ostree-prepare-root.c for this.
|
||||
*
|
||||
* It's a lot easier for various bits of userspace to check for
|
||||
* a file versus parsing the kernel cmdline. So let's ensure
|
||||
* the stamp file is created here too.
|
||||
*/
|
||||
touch_run_ostree ();
|
||||
|
||||
{ g_autoptr(GError) local_error = NULL;
|
||||
if (!ostree_cmd__private__()->ostree_system_generator (ostree_cmdline, arg_dest, NULL, arg_dest_late, &local_error))
|
||||
|
||||
Reference in new issue
Block a user