Re: /run/ostree-booted missing after upgrade to 2018.03



On Thu, Mar 22, 2018 at 1:42 PM, Alex Kiernan <alex kiernan gmail com> wrote:
On Thu, Mar 22, 2018 at 1:39 PM, Colin Walters <walters verbum org> wrote:


On Thu, Mar 22, 2018, at 9:32 AM, Alex Kiernan wrote:
I've just flipped to 2018.03 (from .02) and I seem to have lost
/run/ostree-booted after that (so everything think's I'm not ostree
booted).

OK, this is almost certainly from
https://github.com/ostreedev/ostree/pull/1497 specifically:
https://github.com/ostreedev/ostree/pull/1497/commits/e8a7ef14fa386cc5e1affba1bb4ad2fa9e046c4a


Yeah, that's the one I was staring at.

I just flipped back to 2018.02 - I don't have /run/ostree-booted on
that either. Will try this patch now - thanks for the quick response!


No dice... I also patched touch_run_ostree() so I get the error:

ostree-prepare-root: failed to create /run/ostree-booted: Read-only file system

Which figures as bootargs includes 'ro'.

If I apply this patch instead:

diff --git a/src/switchroot/ostree-prepare-root.c
b/src/switchroot/ostree-prepare-root.c
index 0b04189..4f6b106 100644
--- a/src/switchroot/ostree-prepare-root.c
+++ b/src/switchroot/ostree-prepare-root.c
@@ -60,8 +60,10 @@ touch_run_ostree (void)
   /* We ignore failures here in case /run isn't mounted...not much we
    * can do about that, but we don't want to fail.
    */
-  if (fd == -1)
+  if (fd == -1) {
+    warn("failed to create /run/ostree-booted");
     return;
+  }
   (void) close (fd);
 }

@@ -205,8 +207,6 @@ main(int argc, char *argv[])
         err (EXIT_FAILURE, "failed to bind mount (class:readonly) /usr");
     }

-  touch_run_ostree ();
-
   if (strcmp(root_mountpoint, "/") == 0)
     {
       /* pivot_root rotates two mount points around.  In this instance . (the
@@ -217,6 +217,8 @@ main(int argc, char *argv[])
        * reality attempting mount --move would fail with EBUSY. */
       if (pivot_root (".", "sysroot") < 0)
         err (EXIT_FAILURE, "failed to pivot_root to deployment");
+      if (mount ("tmpfs", "/run", "tmpfs", 0, NULL) < 0)
+        err (EXIT_FAILURE, "failed to mount tmpfs on /run");
     }
   else
     {
@@ -246,6 +248,8 @@ main(int argc, char *argv[])
         err (EXIT_FAILURE, "failed to MS_MOVE %s to %s", deploy_path,
root_mountpoint);
     }

+  touch_run_ostree ();
+
   /* The /sysroot mount needs to be private to avoid having a mount
for e.g. /var/cache
    * also propagate to /sysroot/ostree/deploy/$stateroot/var/cache
    *

Then I do get /run/ostree-booted (and a system that believes it was
ostree booted), but obviously that's a fairly significant change with
respect to /run.

-- 
Alex Kiernan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]