ostree.git
13 months agoNew upstream version 2024.9
Simon McVittie [Mon, 11 Nov 2024 22:16:52 +0000 (22:16 +0000)]
New upstream version 2024.9

13 months agoRelease 2024.9
Colin Walters [Tue, 29 Oct 2024 20:50:11 +0000 (16:50 -0400)]
Release 2024.9

Signed-off-by: Colin Walters <walters@verbum.org>
13 months agoMerge pull request #3334 from cgwalters/fix-composefs-default-docs
Colin Walters [Mon, 4 Nov 2024 22:27:09 +0000 (17:27 -0500)]
Merge pull request #3334 from cgwalters/fix-composefs-default-docs

prepare-root: Fix composefs docs

13 months agoMerge pull request #3331 from cgwalters/verity-no-verity
Colin Walters [Mon, 4 Nov 2024 21:10:39 +0000 (16:10 -0500)]
Merge pull request #3331 from cgwalters/verity-no-verity

checkout: Only verify digest if repo requires fsverity

13 months agobootupd-static: Drop this test
Colin Walters [Mon, 4 Nov 2024 19:28:13 +0000 (14:28 -0500)]
bootupd-static: Drop this test

It breaks due to https://bugzilla.redhat.com/show_bug.cgi?id=2308594

13 months agoprepare-root: Fix composefs docs
Colin Walters [Mon, 4 Nov 2024 18:48:56 +0000 (13:48 -0500)]
prepare-root: Fix composefs docs

In practice in ostree-sysroot-deploy.c we only react to having
`composefs = yes`; the docs mention `maybe` but that never did
anything.

The value is wrong in the code too, but I'm not touching
that here to avoid conflating changes - the main thing to fix
is the docs because here `maybe == no`.

Signed-off-by: Colin Walters <walters@verbum.org>
13 months agocheckout: Only verify digest if repo requires fsverity
Colin Walters [Wed, 30 Oct 2024 14:07:26 +0000 (10:07 -0400)]
checkout: Only verify digest if repo requires fsverity

Fixes a regression from the previous commit; in
the case where the target repo doesn't have composefs in
signed mode there's no reason to verify the digest
at checkout time because we aren't verifying it at
boot time either.

The regression is in cases that use rpm-ostree e.g.
where as of recently we unconditionally add the composefs
digest, but for e.g. FCOS we aren't deploying with fsverity
enabled.

Closes: https://github.com/ostreedev/ostree/issues/3330
Signed-off-by: Colin Walters <walters@verbum.org>
13 months agoMerge pull request #3333 from smcv/gpg-2-2-45
Colin Walters [Thu, 31 Oct 2024 12:15:24 +0000 (08:15 -0400)]
Merge pull request #3333 from smcv/gpg-2-2-45

tests: Work around GPG 2.2.45 error behaviour when revoking an expired key

13 months agotests: Work around GPG 2.2.45 error behaviour when revoking an expired key
Simon McVittie [Thu, 31 Oct 2024 10:54:13 +0000 (10:54 +0000)]
tests: Work around GPG 2.2.45 error behaviour when revoking an expired key

In GPG 2.2.45, a diagnostic message about the only trusted key having
already expired causes this import to produce exit status 2, but the
import still succeeds (the key is still revoked).

Bug: https://dev.gnupg.org/T7351
Bug-Debian: https://bugs.debian.org/1086140

13 months agoMerge pull request #3332 from cgwalters/fixups-for-fcos-composefs-default
Colin Walters [Wed, 30 Oct 2024 18:37:59 +0000 (14:37 -0400)]
Merge pull request #3332 from cgwalters/fixups-for-fcos-composefs-default

tests: Skip checking for immutable bit on composefs

13 months agotests: Skip checking for immutable bit on composefs
Colin Walters [Wed, 30 Oct 2024 17:00:35 +0000 (13:00 -0400)]
tests: Skip checking for immutable bit on composefs

Needed changing after FCOS switch.

Signed-off-by: Colin Walters <walters@verbum.org>
13 months agoMerge pull request #3326 from cgwalters/hack-deploy-no-verity
Colin Walters [Tue, 29 Oct 2024 19:09:59 +0000 (15:09 -0400)]
Merge pull request #3326 from cgwalters/hack-deploy-no-verity

deploy: Don't recompute verity checksums if not enabled

13 months agodeploy: Don't recompute verity checksums if not enabled
Colin Walters [Sun, 27 Oct 2024 14:20:29 +0000 (10:20 -0400)]
deploy: Don't recompute verity checksums if not enabled

This fixes a truly horrific performance bug when
composefs is enabled, but fsverity is not supported
by the filesystem. We'd fall back to doing *userspace*
checksumming of all files at deployment time which was absolutely
not expected or required.

There's really an immense amount of technical debt
here, such as the confusion between `ex-integity.composefs`
vs the prepare-root config, how we handle "torn" states
where some objects don't have verity enabled but some do,
etc.

The ostree composefs state has two modes:

- signed: We need to enforce fsverity
- unsigned: Best effort resilience

So we fix this by making the deploy path to make verity
"opportunistic" - if the ioctl gives us the data, then we
add it to the composefs.

However, this code path is also invoked when we're
computing the expected composefs digest to inject
as commit metadata, and *that* API must work regardless
of whether the target repo has fsverity enabled as
it may operate on a build server.

One lucky thing in all of this: When I went to add
the "checkout composefs" API I added a stub `GVariant`
for options extensibility, which we now use.

Signed-off-by: Colin Walters <walters@verbum.org>
13 months agoMerge pull request #3323 from cgwalters/copydir-no-xattrs
Colin Walters [Mon, 21 Oct 2024 12:02:32 +0000 (08:02 -0400)]
Merge pull request #3323 from cgwalters/copydir-no-xattrs

deploy: Don't copy xattrs for devicetree

13 months agodeploy: Don't copy xattrs for devicetree
Colin Walters [Fri, 18 Oct 2024 12:41:05 +0000 (08:41 -0400)]
deploy: Don't copy xattrs for devicetree

xref: https://github.com/coreos/fedora-coreos-tracker/issues/1808

For the kernel/initramfs that we copy to `/boot`
we use an explicit relabeling today, ignoring the source SELinux
context.

When we added handling for devicetree it reuse the `copy_dir_recurse`
we have for `etc` handling, and that copied the source xattrs.

Let's ensure that the devicetree is also `boot_t` by *not* copying
xattrs and relying on the default labeling.

Signed-off-by: Colin Walters <walters@verbum.org>
14 months agoMerge pull request #3316 from ruihe774/readonly-cmdline
Colin Walters [Thu, 10 Oct 2024 18:40:48 +0000 (14:40 -0400)]
Merge pull request #3316 from ruihe774/readonly-cmdline

prepare-root: allow `sysroot.readonly=true` with kernel cmdline `ro`

14 months agoMerge pull request #3322 from cgwalters/tweak-commit-assertion
Dan Nicholson [Thu, 10 Oct 2024 15:33:29 +0000 (17:33 +0200)]
Merge pull request #3322 from cgwalters/tweak-commit-assertion

commit: Give a better error message for unhandled file type

14 months agocommit: Give a better error message for unhandled file type
Colin Walters [Thu, 10 Oct 2024 12:54:33 +0000 (12:54 +0000)]
commit: Give a better error message for unhandled file type

xref https://github.com/ostreedev/ostree/issues/3319

It'd be useful to know what file type is being hit here; I believe
this code path should be unreachable.

14 months agoprepare-root: allow sysroot.readonly=true with kernel cmdline ro
Misaki Kasumi [Thu, 10 Oct 2024 12:38:34 +0000 (20:38 +0800)]
prepare-root: allow sysroot.readonly=true with kernel cmdline ro

14 months agoMerge pull request #3317 from cgwalters/minor-overlay-tweaks
Eric Curtin [Wed, 2 Oct 2024 13:13:26 +0000 (14:13 +0100)]
Merge pull request #3317 from cgwalters/minor-overlay-tweaks

checkout: Add commentary around whiteout "quoting"

14 months agocheckout: Add commentary around whiteout "quoting"
Colin Walters [Tue, 1 Oct 2024 21:07:17 +0000 (17:07 -0400)]
checkout: Add commentary around whiteout "quoting"

Signed-off-by: Colin Walters <walters@verbum.org>
14 months agoMerge pull request #3311 from cgwalters/curl-minor
Eric Curtin [Mon, 23 Sep 2024 21:13:30 +0000 (22:13 +0100)]
Merge pull request #3311 from cgwalters/curl-minor

curl: Add more assertions for curl return values

14 months agoMerge pull request #3313 from cgwalters/fix-readthedocs
Eric Curtin [Mon, 23 Sep 2024 11:57:54 +0000 (12:57 +0100)]
Merge pull request #3313 from cgwalters/fix-readthedocs

rust-bindings: Fix readthedocs.io link

14 months agorust-bindings: Fix readthedocs.io link
Colin Walters [Mon, 23 Sep 2024 09:34:49 +0000 (09:34 +0000)]
rust-bindings: Fix readthedocs.io link

It should now point at GH pages.

Closes: https://github.com/ostreedev/ostree/issues/3312
Signed-off-by: Colin Walters <walters@verbum.org>
14 months agoNew upstream version 2024.8
Simon McVittie [Sat, 21 Sep 2024 17:43:37 +0000 (18:43 +0100)]
New upstream version 2024.8

14 months agocurl: Add more assertions for curl return values
Colin Walters [Thu, 19 Sep 2024 18:29:20 +0000 (14:29 -0400)]
curl: Add more assertions for curl return values

Followup to the previous curl fixes; if we'd had an assertion
earlier debugging the failure would have been more obvious.

All of these are "should not fail" cases so asserting is
right.

14 months agoMerge pull request #3309 from cgwalters/release
Colin Walters [Thu, 19 Sep 2024 13:58:54 +0000 (09:58 -0400)]
Merge pull request #3309 from cgwalters/release

Release 2024.8

14 months agoPost-release version bump
Colin Walters [Thu, 19 Sep 2024 12:00:41 +0000 (08:00 -0400)]
Post-release version bump

14 months agoRelease 2024.8
Colin Walters [Thu, 19 Sep 2024 11:52:27 +0000 (07:52 -0400)]
Release 2024.8

14 months agoMerge pull request #3307 from cgwalters/curl-reorder-teardown
Dan Nicholson [Thu, 19 Sep 2024 03:36:13 +0000 (21:36 -0600)]
Merge pull request #3307 from cgwalters/curl-reorder-teardown

curl: Make socket callback during cleanup into no-op

14 months agoMerge pull request #3306 from cgwalters/curl-assert
Colin Walters [Wed, 18 Sep 2024 22:34:08 +0000 (18:34 -0400)]
Merge pull request #3306 from cgwalters/curl-assert

curl: Assert that curl_multi_assign worked

14 months agocurl: Make socket callback during cleanup into no-op
Colin Walters [Wed, 18 Sep 2024 17:41:59 +0000 (13:41 -0400)]
curl: Make socket callback during cleanup into no-op

Because curl_multi_cleanup may invoke callbacks, we effectively have
some circular references going on here. See discussion in

https://github.com/curl/curl/issues/14860

Basically what we do is the socket callback libcurl may invoke into a no-op when
we detect we're finalizing. The data structures are owned by this object and
not by the callbacks, and will be destroyed below. Note that
e.g. g_hash_table_unref() may itself invoke callbacks, which is where
some data is cleaned up.

Signed-off-by: Colin Walters <walters@verbum.org>
14 months agocurl: Assert that curl_multi_assign worked
Colin Walters [Wed, 18 Sep 2024 17:21:27 +0000 (13:21 -0400)]
curl: Assert that curl_multi_assign worked

ref https://github.com/ostreedev/ostree/issues/3299

This won't fix that issue, but *if* this assertion triggers
it should give us a better idea of the possible codepaths
where it is happening.

Signed-off-by: Colin Walters <walters@verbum.org>
15 months agoMerge pull request #3305 from dbnicholson/pages-fixes
Colin Walters [Sun, 15 Sep 2024 20:39:38 +0000 (16:39 -0400)]
Merge pull request #3305 from dbnicholson/pages-fixes

workflow/docs: Fix deployments

15 months agoworkflow/docs: Fix deployments
Dan Nicholson [Sun, 15 Sep 2024 19:59:36 +0000 (13:59 -0600)]
workflow/docs: Fix deployments

A couple fixes to make PRs and non-PRs work correctly:

* In a conditional expression, `true` or `false` are returned unless you
  terminate both sides in a ternary. That was causing 2 strings to be
  suffixed with `false` instead of an empty string.
* For a PR, we do actually want to cancel in progress runs since there's
  no danger of breaking an in progress deployment.
* For PRs, just use the same `github-pages-pr` name for the artifact.
  The important part is that it's not called `github-pages` where an in
  progress deployment could pick it up. Otherwise it can use the same
  name all the time.

15 months agoMerge pull request #3300 from travier/main-static-config-null
Colin Walters [Sun, 15 Sep 2024 17:01:52 +0000 (13:01 -0400)]
Merge pull request #3300 from travier/main-static-config-null

bootloader/grub2: Handle empty static configs

15 months agoMerge pull request #3302 from HuijingHei/fix-version
Colin Walters [Sun, 15 Sep 2024 17:01:38 +0000 (13:01 -0400)]
Merge pull request #3302 from HuijingHei/fix-version

spec: %autorelease can't be resolved by COPR

15 months agoMerge pull request #3304 from dbnicholson/pages-redux
Colin Walters [Sun, 15 Sep 2024 17:01:19 +0000 (13:01 -0400)]
Merge pull request #3304 from dbnicholson/pages-redux

Redo pages workflow

15 months agoRedo pages workflow
Dan Nicholson [Sun, 15 Sep 2024 16:12:16 +0000 (10:12 -0600)]
Redo pages workflow

15 months agospec: %autorelease can't be resolved by COPR
HuijingHei [Fri, 13 Sep 2024 15:05:28 +0000 (23:05 +0800)]
spec: %autorelease can't be resolved by COPR

Fix copr build error:
`line 11: Possible unexpanded macro in: Release: %autorelease`

15 months agobootloader/grub2: Handle empty static configs
Timothée Ravier [Fri, 13 Sep 2024 17:14:43 +0000 (19:14 +0200)]
bootloader/grub2: Handle empty static configs

In #3205, we introduced a check to skip re-generating the GRUB config if
we detect that static configs are in used by looking at bootupd's state.

Unfortunately this check is incomplete and does not account for present
but null entries in the JSON state file.

A proper fix would be to parse the JSON but this requires a larger code
change.

Fixes: https://github.com/ostreedev/ostree/issues/3295
Fixes: https://github.com/ostreedev/ostree/pull/3205
15 months agoMerge pull request #3301 from travier/main-github-artifact-v4
Timothée Ravier [Fri, 13 Sep 2024 22:34:08 +0000 (00:34 +0200)]
Merge pull request #3301 from travier/main-github-artifact-v4

github/workflows/tests: Update actions/upload-artifact to v4

15 months agogithub/workflows/tests: Update actions/{upload,download}-artifact to v4
Timothée Ravier [Fri, 13 Sep 2024 17:28:47 +0000 (19:28 +0200)]
github/workflows/tests: Update actions/{upload,download}-artifact to v4

See: https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/
See: https://github.blog/news-insights/product-news/get-started-with-v4-of-github-actions-artifacts/
Signed-off-by: Colin Walters <walters@verbum.org>
15 months agoMerge pull request #3287 from cgwalters/fix-memleak
Eric Curtin [Sat, 7 Sep 2024 00:30:25 +0000 (01:30 +0100)]
Merge pull request #3287 from cgwalters/fix-memleak

lib/traverse: Fix minor memory leak

15 months agoMerge pull request #3292 from dbnicholson/var-slave-shared
Colin Walters [Fri, 6 Sep 2024 23:35:19 +0000 (19:35 -0400)]
Merge pull request #3292 from dbnicholson/var-slave-shared

switchroot: Stop making /sysroot mount private

15 months agolib/traverse: Fix minor memory leak
Colin Walters [Tue, 20 Aug 2024 20:18:54 +0000 (16:18 -0400)]
lib/traverse: Fix minor memory leak

I was trying to check something with `-fsanitize=address`
and it warned about this memory leak. It's...subtle, basically
we were leaking when the same commit was added to the hash table.

But unfortunately fixing that then complicates ownership
over the return value; what we really want to use here is
`g_hash_table_steal_all_keys` but RHEL 9.4 is still rocking
`glib2-2.68.4` so we can't use it.

(Rust would mean we wouldn't have leaked anything here in the
 first place...)

Signed-off-by: Colin Walters <walters@verbum.org>
15 months agoswitchroot: Stop making /sysroot mount private
Dan Nicholson [Fri, 30 Aug 2024 00:19:30 +0000 (18:19 -0600)]
switchroot: Stop making /sysroot mount private

Back in 2b8d586c5, /sysroot was changed to be a private mount so that
submounts of /var do not propagate back to the stateroot /var. That's
laudible, but it makes /sysroot different than every other shared mount
in the root namespace. In particular, it means that submounts of
/sysroot do not propagate into separate mount namespaces.

Rather than make /sysroot private, make /var a slave+shared mount so
that it receives mount events from /sysroot but not vice versa. That
achieves the same effect of preventing /var submount events from
propagating back to /sysroot while allowing /sysroot mount events to
propagate forward like every other system mount. See
mount_namespaces(7)[1] and the linux shared subtrees[2] documentation
for details on slave+shared mount propagation.

When /var is mounted in the initramfs, this is accomplished with
mount(2) syscalls. When /var is mounted after switching to the real
root, the mount propagation flags are applied as options in the
generated var.mount unit. This depends on a mount(8) feature that has
been present since util-linux 2.23. That's available in RHEL 7 and every
non-EOL Debian and Ubuntu release. Applying the propagation from
var.mount fixes a small race, too. Previously, if a /var submount was
added before /sysroot was made private, it would have propagated back
into /sysroot. That was possible since ostree-remount.service orders
itself after var.mount but not before any /var submounts.

1. https://man7.org/linux/man-pages/man7/mount_namespaces.7.html
2. https://docs.kernel.org/filesystems/sharedsubtree.html

Fixes: #2086
15 months agotests: Add mount propagation test
Dan Nicholson [Fri, 30 Aug 2024 11:53:10 +0000 (05:53 -0600)]
tests: Add mount propagation test

This tests the current behavior of making /sysroot a private mount so
that submounts on /var do not propagate back to /sysroot. It also shows
how submounts of /sysroot do not propagate into separate mount
namespaces for the same reason.

15 months agoMerge pull request #3290 from cgwalters/include-grub-stderr
Eric Curtin [Tue, 3 Sep 2024 14:36:26 +0000 (15:36 +0100)]
Merge pull request #3290 from cgwalters/include-grub-stderr

grub2: Show output when run in systemd by default

15 months agogrub2: Show output when run in systemd by default
Colin Walters [Thu, 29 Aug 2024 18:19:03 +0000 (14:19 -0400)]
grub2: Show output when run in systemd by default

xref https://github.com/coreos/rpm-ostree/issues/5071

Hiding errors by default is painful. At least as of
recently in Fedora it looks like the command is nice
and quiet by default, I only see

```
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
```

Signed-off-by: Colin Walters <walters@verbum.org>
15 months agoMerge pull request #3285 from cgwalters/drop-deploy-print
Eric Curtin [Fri, 30 Aug 2024 20:40:33 +0000 (21:40 +0100)]
Merge pull request #3285 from cgwalters/drop-deploy-print

tests: Attempt to update auto-prune test

15 months agodeploy: Log to journal for boot space, not stderr
Colin Walters [Wed, 14 Aug 2024 13:07:32 +0000 (09:07 -0400)]
deploy: Log to journal for boot space, not stderr

bootc doesn't run as a systemd unit, and this pollutes stderr.

Signed-off-by: Colin Walters <walters@verbum.org>
16 months agoMerge pull request #3283 from cgwalters/fix-more-coverity-dirname
Eric Curtin [Fri, 16 Aug 2024 04:26:52 +0000 (00:26 -0400)]
Merge pull request #3283 from cgwalters/fix-more-coverity-dirname

sysroot: Make coverity happy with dirname+strdup

16 months agoMerge pull request #3284 from cgwalters/even-more-readlinkat
Colin Walters [Thu, 15 Aug 2024 17:42:20 +0000 (13:42 -0400)]
Merge pull request #3284 from cgwalters/even-more-readlinkat

commit/payload-link: Ensure we don't overrun target_checksum size

16 months agocommit/payload-link: Ensure we don't overrun target_checksum size
Colin Walters [Thu, 15 Aug 2024 16:14:33 +0000 (12:14 -0400)]
commit/payload-link: Ensure we don't overrun target_checksum size

This is another warning from recently changed code from Coverity:

```
1. Defect type: OVERRUN
16. libostree-2024.7/src/libostree/ostree-repo-commit.c:823:7: overrun-buffer-arg: Overrunning array "target_checksum" of 65 bytes by passing it to a function which accesses it at byte offset 258 using argument "size" (which evaluates to 259). [Note: The source code implementation of the function has been overridden by a builtin model.]
```

I think this can only happen if the repository is corrupt; the
data shouldn't be that long. But fix this by passing the max
length we expect; this will ignore the rest currently.

Signed-off-by: Colin Walters <walters@verbum.org>
16 months agosysroot: Make coverity happy with dirname+strdup
Colin Walters [Thu, 15 Aug 2024 15:28:45 +0000 (11:28 -0400)]
sysroot: Make coverity happy with dirname+strdup

Similar to d528083cae3492f9b9424f3c9830869af7b4cbd0 - I don't
believe we actually had a leak here because `dirname` always
returns the same start pointer, but this makes Coverity
happy.

Signed-off-by: Colin Walters <walters@verbum.org>
16 months agoMerge pull request #3282 from cgwalters/drop-deploy-print
Colin Walters [Wed, 14 Aug 2024 20:50:43 +0000 (16:50 -0400)]
Merge pull request #3282 from cgwalters/drop-deploy-print

deploy: Log to journal for boot space, not stderr

16 months agodeploy: Log to journal for boot space, not stderr
Colin Walters [Wed, 14 Aug 2024 13:07:32 +0000 (09:07 -0400)]
deploy: Log to journal for boot space, not stderr

bootc doesn't run as a systemd unit, and this pollutes stderr.

Signed-off-by: Colin Walters <walters@verbum.org>
16 months agoMerge pull request #3281 from cgwalters/fix-readlinkat-payload-link
Colin Walters [Fri, 9 Aug 2024 20:10:05 +0000 (16:10 -0400)]
Merge pull request #3281 from cgwalters/fix-readlinkat-payload-link

repo: NUL terminate readlinkat result

16 months agorepo: NUL terminate readlinkat result
Colin Walters [Mon, 29 Jul 2024 19:17:10 +0000 (15:17 -0400)]
repo: NUL terminate readlinkat result

Coverity was correctly complaining about this.

Signed-off-by: Colin Walters <walters@verbum.org>
16 months agotests: Add a payload link unit test
Colin Walters [Mon, 29 Jul 2024 21:05:46 +0000 (17:05 -0400)]
tests: Add a payload link unit test

Motivated by changing this code.

Signed-off-by: Colin Walters <walters@verbum.org>
16 months agoNew upstream version 2024.7
Simon McVittie [Mon, 22 Jul 2024 09:02:51 +0000 (10:02 +0100)]
New upstream version 2024.7

16 months agoMerge pull request #3280 from cgwalters/release
Colin Walters [Fri, 19 Jul 2024 11:10:51 +0000 (07:10 -0400)]
Merge pull request #3280 from cgwalters/release

Release 2024.7

16 months agoRelease 2024.7
Colin Walters [Thu, 18 Jul 2024 15:39:10 +0000 (11:39 -0400)]
Release 2024.7

Signed-off-by: Colin Walters <walters@verbum.org>
16 months agoPost-release version bump
Colin Walters [Thu, 18 Jul 2024 15:39:39 +0000 (11:39 -0400)]
Post-release version bump

Signed-off-by: Colin Walters <walters@verbum.org>
17 months agoMerge pull request #3277 from cgwalters/karg-disable-composefs
Colin Walters [Fri, 12 Jul 2024 00:08:38 +0000 (20:08 -0400)]
Merge pull request #3277 from cgwalters/karg-disable-composefs

prepare-root: Add ostree.prepare-root.composefs

17 months agoprepare-root: Add `ostree.prepare-root.composefs`
Colin Walters [Wed, 10 Jul 2024 20:38:48 +0000 (16:38 -0400)]
prepare-root: Add `ostree.prepare-root.composefs`

We have a use case for overriding the composefs state via
the kernel commandline; see e.g.
https://gitlab.com/fedora/bootc/tracker/-/issues/27

Signed-off-by: Colin Walters <walters@verbum.org>
17 months agoMerge pull request #3276 from cgwalters/parse-bool
Colin Walters [Thu, 11 Jul 2024 20:06:35 +0000 (16:06 -0400)]
Merge pull request #3276 from cgwalters/parse-bool

keyfile-utils: Add API to parse tristate strings

17 months agoprepare-root: Gather kernel cmdline early
Colin Walters [Wed, 10 Jul 2024 21:27:11 +0000 (17:27 -0400)]
prepare-root: Gather kernel cmdline early

Prep for parsing the composefs config from the kernel cmdline.
No functional changes intended.

17 months agokeyfile-utils: Add API to parse tristate strings
Colin Walters [Wed, 10 Jul 2024 21:21:57 +0000 (17:21 -0400)]
keyfile-utils: Add API to parse tristate strings

Prep for using this in multiple places. Add unit tests.

17 months agokeyfile-utils: Add API to parse tristate strings
Colin Walters [Wed, 10 Jul 2024 21:21:57 +0000 (17:21 -0400)]
keyfile-utils: Add API to parse tristate strings

Prep for using this in multiple places. Add unit tests.

17 months agoMerge pull request #3275 from ueno/wip/dueno/glib-2.44
Colin Walters [Wed, 10 Jul 2024 12:27:45 +0000 (08:27 -0400)]
Merge pull request #3275 from ueno/wip/dueno/glib-2.44

libostree: Remove compatibility code with GLib < 2.44

17 months agolibostree: Remove compatibility code with GLib < 2.44
Daiki Ueno [Wed, 10 Jul 2024 01:10:18 +0000 (10:10 +0900)]
libostree: Remove compatibility code with GLib < 2.44

As the build system has required GLib 2.44 since commit
eb09207e1abd7499bd92866cce1de6148d659a4a, the manual expansion of
G_DECLARE_INTERFACE and G_DECLARE_FINAL_TYPE is no longer necessary.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
17 months agoMerge pull request #3273 from cgwalters/drop-library-printf
Colin Walters [Mon, 8 Jul 2024 13:56:26 +0000 (09:56 -0400)]
Merge pull request #3273 from cgwalters/drop-library-printf

sysroot: Use journal rather than printf()

17 months agosysroot: Use journal rather than printf()
Colin Walters [Wed, 3 Jul 2024 14:37:02 +0000 (14:37 +0000)]
sysroot: Use journal rather than printf()

Fix the TODO here; this was making some bootc output
ugly.

Signed-off-by: Colin Walters <walters@verbum.org>
17 months agoMerge pull request #3265 from lukewarmtemp/2023.8-3-coverity-scan
Colin Walters [Thu, 27 Jun 2024 17:05:53 +0000 (13:05 -0400)]
Merge pull request #3265 from lukewarmtemp/2023.8-3-coverity-scan

2023.8-3 coverity scan

17 months agoprepare: Create global var for tmp_sysroot_etc
Luke Yang [Thu, 13 Jun 2024 18:41:27 +0000 (14:41 -0400)]
prepare: Create global var for tmp_sysroot_etc

Coverity points out that ""/sysroot.tmp/etc"" could be a copy-paste
error. This is mistake from coverity, but to supress the warning,
we create a global var, tmp_sysroot_etc, which replaces all
instances of TMP_SYSROOT "/etc".

17 months agorepo: Fix `dir_or_file_path` memory leak
Luke Yang [Wed, 12 Jun 2024 19:55:37 +0000 (15:55 -0400)]
repo: Fix `dir_or_file_path` memory leak

Coverity points out that we have a memory leak from
`g_strdup(dir_or_file_path)`. Make the duplication of the string a
temporary variable that is freed using `g_autofree`.

17 months agocommit: Null terminate `target_buf` var
Luke Yang [Wed, 12 Jun 2024 19:51:41 +0000 (15:51 -0400)]
commit: Null terminate `target_buf` var

Coverity points out that we are passing an unterminated string to
sprintf(). Fix by using snprintf() which stores the content as a C
string.

17 months agotree: Fix `name` memory leak
Luke Yang [Wed, 12 Jun 2024 19:50:54 +0000 (15:50 -0400)]
tree: Fix `name` memory leak

Coverity points out that we have a memory leak from `g_strdup(name)`.
`insert_child_mtree()` takes a const char * and duplicates it.
`name` can be passed directly to `insert_child_mtree()`.

17 months agoMerge pull request #3269 from cgwalters/fix-ordering
Colin Walters [Thu, 20 Jun 2024 15:54:23 +0000 (11:54 -0400)]
Merge pull request #3269 from cgwalters/fix-ordering

remount: Drop `Before=systemd-sysusers.service`

17 months agoMerge pull request #3270 from cgwalters/bump-runners
Colin Walters [Thu, 20 Jun 2024 15:23:27 +0000 (11:23 -0400)]
Merge pull request #3270 from cgwalters/bump-runners

ci: Bump bootc e2e to latest ubuntu, drop docker

17 months agoci: Bump bootc e2e to latest ubuntu, drop docker
Colin Walters [Tue, 18 Jun 2024 14:38:20 +0000 (10:38 -0400)]
ci: Bump bootc e2e to latest ubuntu, drop docker

As newer docker refuses to talk to ancient skopeo.
Update this to use podman directly, also add the missing `-v /dev:/dev`.

Signed-off-by: Colin Walters <walters@verbum.org>
17 months agoMerge pull request #3268 from ueno/wip/dueno/composefs-doc-fixes
Colin Walters [Thu, 20 Jun 2024 13:18:55 +0000 (09:18 -0400)]
Merge pull request #3268 from ueno/wip/dueno/composefs-doc-fixes

Minor cleanup related to composefs

17 months agoremount: Drop `Before=systemd-sysusers.service`
Colin Walters [Thu, 20 Jun 2024 13:18:08 +0000 (09:18 -0400)]
remount: Drop `Before=systemd-sysusers.service`

This created an ordering cycle, and I merged over red CI
for bad reasons.

17 months agorepo: Remove leftover OpenSSL includes
Daiki Ueno [Wed, 19 Jun 2024 19:41:18 +0000 (04:41 +0900)]
repo: Remove leftover OpenSSL includes

This removes OpenSSL includes for PKCS#7, previously used to generate
fs-verity builtin signatures.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
17 months agodocs/composefs: Fix reference to `ostree sign`
Daiki Ueno [Wed, 19 Jun 2024 19:40:32 +0000 (04:40 +0900)]
docs/composefs: Fix reference to `ostree sign`

Signed-off-by: Daiki Ueno <dueno@redhat.com>
17 months agoMerge pull request #3266 from ericcurtin/if-file-missing-on-relabel-continue
Colin Walters [Tue, 18 Jun 2024 18:14:02 +0000 (14:14 -0400)]
Merge pull request #3266 from ericcurtin/if-file-missing-on-relabel-continue

remount: ignore ENOENT error during SELinux relabeling

17 months agoremount: ignore ENOENT error during SELinux relabeling
Eric Curtin [Tue, 18 Jun 2024 14:06:12 +0000 (15:06 +0100)]
remount: ignore ENOENT error during SELinux relabeling

Ignore ENOENT error in selinux_restorecon to avoid failures when
temporary files created by systemd-sysusers in /etc are missing during
relabeling. This prevents errors such as:

  "Failed to relabel /etc/.#gshadowJzu4Rx: No such file or directory"

and allows the process to continue.

Co-Authored-By: Alexander Larsson <alexl@redhat.com>
Signed-off-by: Eric Curtin <ecurtin@redhat.com>
18 months agoNew upstream version 2024.6
Simon McVittie [Sat, 8 Jun 2024 15:05:25 +0000 (16:05 +0100)]
New upstream version 2024.6

18 months agoMerge pull request #3261 from cgwalters/validate-xattrs
Colin Walters [Tue, 4 Jun 2024 17:32:20 +0000 (13:32 -0400)]
Merge pull request #3261 from cgwalters/validate-xattrs

core: Validate that xattr names aren't empty

18 months agocore: Validate that xattr names aren't empty
Colin Walters [Sat, 1 Jun 2024 15:29:13 +0000 (11:29 -0400)]
core: Validate that xattr names aren't empty

In the ostree-ext codebase the test fixture was generating xattrs
without the trailing NUL byte.  This caused confusing errors
later.  Change the dirmeta validator to catch this.

The way GVariant represents bytestrings, the trailing NUL is there
on wire/disk so it can be there in memory too, but `g_variant_get_bytestring()`
will just return an empty `""` string if actually the value
has a missing NUL.

Signed-off-by: Colin Walters <walters@verbum.org>
18 months agoMerge pull request #3259 from cgwalters/c9s-buildroot
Colin Walters [Thu, 30 May 2024 16:46:14 +0000 (12:46 -0400)]
Merge pull request #3259 from cgwalters/c9s-buildroot

ci: Add buildroot to c9s build

18 months agoci: Add buildroot to c9s build
Colin Walters [Thu, 30 May 2024 15:05:20 +0000 (11:05 -0400)]
ci: Add buildroot to c9s build

Because composefs-devel isn't shipped in RHEL.

18 months agoMerge pull request #3258 from cgwalters/prepare-comments
Colin Walters [Thu, 30 May 2024 14:39:50 +0000 (10:39 -0400)]
Merge pull request #3258 from cgwalters/prepare-comments

docs: Describe `/boot/ostree`

18 months agodocs: Describe `/boot/ostree`
Colin Walters [Thu, 30 May 2024 13:42:24 +0000 (09:42 -0400)]
docs: Describe `/boot/ostree`

People get confused by the sha256 here being different
from the ostree commit hash.

18 months agoMerge pull request #3253 from cgwalters/prepare-comments
Eric Curtin [Thu, 23 May 2024 14:52:32 +0000 (16:52 +0200)]
Merge pull request #3253 from cgwalters/prepare-comments

prepare-root: Cleanup comments

18 months agoMerge pull request #3252 from cgwalters/checkout-cfs
Colin Walters [Thu, 23 May 2024 11:54:10 +0000 (07:54 -0400)]
Merge pull request #3252 from cgwalters/checkout-cfs

checkout: Add API to directly checkout composefs

18 months agoprepare-root: Cleanup comments
Colin Walters [Thu, 23 May 2024 01:05:08 +0000 (21:05 -0400)]
prepare-root: Cleanup comments

Mainly we can now drop the TODO for mounting `/` readonly - that's
handled by composefs.  Add a few other comments, typo fixes
while we're here.

Signed-off-by: Colin Walters <walters@verbum.org>
18 months agocheckout: Add API to directly checkout composefs
Colin Walters [Wed, 22 May 2024 22:16:48 +0000 (18:16 -0400)]
checkout: Add API to directly checkout composefs

We were missing the simple, obvious API and CLI to go
from ostree commit -> composefs.

Internally, we had `ostree_repo_checkout_composefs`
with the right "shape" mostly, except it had more code
in the deploy path to turn that into a composefs.

Add a straightforward public API that does what
the deploy code did before, and then the old
API becomes an explicitly internal helper with an `_`
prefix.

Goals:

- Lead towards a composefs-oriented future
- This makes the composefs logic more testable directly

Signed-off-by: Colin Walters <walters@verbum.org>