composefs: Hard error except on ENOENT even in "optional" case
authorColin Walters <walters@verbum.org>
Mon, 21 Aug 2023 21:19:35 +0000 (17:19 -0400)
committerColin Walters <walters@verbum.org>
Fri, 25 Aug 2023 19:23:06 +0000 (15:23 -0400)
commit38880bff01a4ed858b8b3d53aa00057b27d5bfc9
tree24dd2606de2433da6ee4601763b424712e546ed3
parente952b1bf1413feb21eb0cc9e2514eb9e1895f2cf
composefs: Hard error except on ENOENT even in "optional" case

Since we enabled composefs at build time, the default (non-composefs)
case now always prints
`composefs: Optional support failed: No such file or directory`
But that's normal and expected.

Rework things here so that in the very special case where
we are in "maybe/optional" mode and we get ENOENT, then we
output a much more normal-looking message that doesn't include
the string "failed".

Now on the flip side - if I have explicitly enabled signature
checking, I think we *do* want to make that fatal even if
composefs is in "maybe" mode.

(This part is more debatable; perhaps we should just disallow
 the case of "maybe" + signatures at all; but I think this is
 an improvement in that direction)
src/switchroot/ostree-prepare-root.c