From: Colin Walters Date: Thu, 13 Jul 2023 11:28:07 +0000 (-0400) Subject: remount: Don't overwrite /run/ostree-booted X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2^2~56^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=77acad246e104a1e553dad4c86ab333e884f8df5;p=ostree.git remount: Don't overwrite /run/ostree-booted Since it should always be written in the initramfs. --- diff --git a/src/switchroot/ostree-remount.c b/src/switchroot/ostree-remount.c index 80f8ad34..2563d08b 100644 --- a/src/switchroot/ostree-remount.c +++ b/src/switchroot/ostree-remount.c @@ -81,10 +81,15 @@ do_remount (const char *target, bool writable) int main (int argc, char *argv[]) { - /* When systemd is in use this is normally created via the generator, but - * we ensure it's created here as well for redundancy. + /* We really expect that nowadays that everything is done in the initramfs, + * but historically we created this file here, so we'll continue to do be + * sure here it exists. This code should be removed at some point though. */ - touch_run_ostree (); + { + int fd = open (OSTREE_PATH_BOOTED, O_EXCL | O_CREAT | O_WRONLY | O_NOCTTY | O_CLOEXEC, 0640); + if (fd != -1) + (void)close (fd); + } /* 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