From: Colin Walters Date: Tue, 24 Oct 2023 14:40:51 +0000 (-0400) Subject: bootloader/zipl: No-op if run as non-root X-Git-Tag: archive/raspbian/2023.8-1+rpi1^2~9^2^2~19^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=75c7e51a8bedb5edeadb9f54e84ccfff2adcc755;p=ostree.git bootloader/zipl: No-op if run as non-root Closes: https://github.com/ostreedev/ostree/issues/3084 Not the most elegant fix but should get the job done. --- diff --git a/src/libostree/ostree-bootloader-zipl.c b/src/libostree/ostree-bootloader-zipl.c index c0a2a145..4579a894 100644 --- a/src/libostree/ostree-bootloader-zipl.c +++ b/src/libostree/ostree-bootloader-zipl.c @@ -381,6 +381,12 @@ _ostree_bootloader_zipl_post_bls_sync (OstreeBootloader *bootloader, int bootver { OstreeBootloaderZipl *self = OSTREE_BOOTLOADER_ZIPL (bootloader); + // This can happen in a unit testing environment; at some point what we want to do here + // is move all of the zipl logic to a systemd unit instead that's keyed of + // ostree-finalize-staged.service. + if (getuid () != 0) + return TRUE; + /* Note that unlike the grub2-mkconfig backend, we make no attempt to * chroot(). */