Commit Graph

7099 Commits

Author SHA1 Message Date
Colin Walters
3625130ec0
Merge pull request #3323 from cgwalters/copydir-no-xattrs
deploy: Don't copy xattrs for devicetree
2024-10-21 08:02:32 -04:00
Colin Walters
72202df98f 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>
2024-10-18 11:32:42 -04:00
Colin Walters
f7018d84de
Merge pull request #3316 from ruihe774/readonly-cmdline
prepare-root: allow `sysroot.readonly=true` with kernel cmdline `ro`
2024-10-10 14:40:48 -04:00
Dan Nicholson
6dc8b87346
Merge pull request #3322 from cgwalters/tweak-commit-assertion
commit: Give a better error message for unhandled file type
2024-10-10 17:33:29 +02:00
Colin Walters
f11e6a4ae0 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.
2024-10-10 12:54:33 +00:00
Misaki Kasumi
5b6d208801 prepare-root: allow sysroot.readonly=true with kernel cmdline ro 2024-10-10 20:38:34 +08:00
Eric Curtin
a54518e4d9
Merge pull request #3317 from cgwalters/minor-overlay-tweaks
checkout: Add commentary around whiteout "quoting"
2024-10-02 14:13:26 +01:00
Colin Walters
fdfeb0ba7b checkout: Add commentary around whiteout "quoting"
Signed-off-by: Colin Walters <walters@verbum.org>
2024-10-01 17:07:59 -04:00
Eric Curtin
9ca8b4604d
Merge pull request #3311 from cgwalters/curl-minor
curl: Add more assertions for curl return values
2024-09-23 22:13:30 +01:00
Eric Curtin
199d062191
Merge pull request #3313 from cgwalters/fix-readthedocs
rust-bindings: Fix readthedocs.io link
2024-09-23 12:57:54 +01:00
Colin Walters
64af3bc059 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>
2024-09-23 10:19:53 +00:00
Colin Walters
772df8f600 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.
2024-09-19 14:29:20 -04:00
Colin Walters
688ced3901
Merge pull request #3309 from cgwalters/release
Release 2024.8
2024-09-19 09:58:54 -04:00
Colin Walters
a902afff65 Post-release version bump 2024-09-19 08:01:10 -04:00
Colin Walters
05d36e056d Release 2024.8 2024-09-19 07:53:45 -04:00
Dan Nicholson
e560092f54
Merge pull request #3307 from cgwalters/curl-reorder-teardown
curl: Make socket callback during cleanup into no-op
2024-09-18 21:36:13 -06:00
Colin Walters
05442f2a92
Merge pull request #3306 from cgwalters/curl-assert
curl: Assert that curl_multi_assign worked
2024-09-18 18:34:08 -04:00
Colin Walters
4d755a8522 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>
2024-09-18 17:41:41 -04:00
Colin Walters
472d9d493a 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>
2024-09-18 13:22:55 -04:00
Colin Walters
2945165ffe
Merge pull request #3305 from dbnicholson/pages-fixes
workflow/docs: Fix deployments
2024-09-15 16:39:38 -04:00
Dan Nicholson
8d1373bdd7 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.
2024-09-15 14:01:19 -06:00
Colin Walters
558f260554
Merge pull request #3300 from travier/main-static-config-null
bootloader/grub2: Handle empty static configs
2024-09-15 13:01:52 -04:00
Colin Walters
6a337d6f8a
Merge pull request #3302 from HuijingHei/fix-version
spec: %autorelease can't be resolved by COPR
2024-09-15 13:01:38 -04:00
Colin Walters
1e430366b7
Merge pull request #3304 from dbnicholson/pages-redux
Redo pages workflow
2024-09-15 13:01:19 -04:00
Dan Nicholson
6d590db379 Redo pages workflow 2024-09-15 10:19:06 -06:00
HuijingHei
339fc34766
spec: %autorelease can't be resolved by COPR
Fix copr build error:
`line 11: Possible unexpanded macro in: Release: %autorelease`
2024-09-14 11:16:50 +08:00
Timothée Ravier
508a8b61ac 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
2024-09-14 00:34:24 +02:00
Timothée Ravier
b18e78bfb8
Merge pull request #3301 from travier/main-github-artifact-v4
github/workflows/tests: Update actions/upload-artifact to v4
2024-09-14 00:34:08 +02:00
Timothée Ravier
db4be85546 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>
2024-09-13 14:45:34 -04:00
Eric Curtin
81867f0444
Merge pull request #3287 from cgwalters/fix-memleak
lib/traverse: Fix minor memory leak
2024-09-07 01:30:25 +01:00
Colin Walters
413b0ad00e
Merge pull request #3292 from dbnicholson/var-slave-shared
switchroot: Stop making /sysroot mount private
2024-09-06 19:35:19 -04:00
Colin Walters
bd5b4adccd 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>
2024-09-06 18:52:33 -04:00
Dan Nicholson
2973ec5910 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
2024-09-06 15:49:49 -06:00
Dan Nicholson
fae8941196 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.
2024-09-06 15:49:43 -06:00
Eric Curtin
fbb1cc7e38
Merge pull request #3290 from cgwalters/include-grub-stderr
grub2: Show output when run in systemd by default
2024-09-03 15:36:26 +01:00
Colin Walters
cdbe93dc9b 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>
2024-09-03 08:55:35 -04:00
Eric Curtin
4207d92365
Merge pull request #3285 from cgwalters/drop-deploy-print
tests: Attempt to update auto-prune test
2024-08-30 21:40:33 +01:00
Colin Walters
4f46d06ba8 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>
2024-08-30 15:00:27 -04:00
Eric Curtin
2b01c93cd9
Merge pull request #3283 from cgwalters/fix-more-coverity-dirname
sysroot: Make coverity happy with dirname+strdup
2024-08-16 00:26:52 -04:00
Colin Walters
62284ea3ec
Merge pull request #3284 from cgwalters/even-more-readlinkat
commit/payload-link: Ensure we don't overrun target_checksum size
2024-08-15 13:42:20 -04:00
Colin Walters
7683eb5aa4 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>
2024-08-15 12:15:50 -04:00
Colin Walters
70430fe02b sysroot: Make coverity happy with dirname+strdup
Similar to d528083cae - 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>
2024-08-15 11:29:22 -04:00
Colin Walters
0d5e554b69
Merge pull request #3282 from cgwalters/drop-deploy-print
deploy: Log to journal for boot space, not stderr
2024-08-14 16:50:43 -04:00
Colin Walters
3d07a808ce 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>
2024-08-14 09:09:15 -04:00
Colin Walters
28c184f244
Merge pull request #3281 from cgwalters/fix-readlinkat-payload-link
repo: NUL terminate readlinkat result
2024-08-09 16:10:05 -04:00
Colin Walters
f08cea998e repo: NUL terminate readlinkat result
Coverity was correctly complaining about this.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-29 17:14:12 -04:00
Colin Walters
d260d918dd tests: Add a payload link unit test
Motivated by changing this code.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-29 17:08:03 -04:00
Colin Walters
5dac2adef6
Merge pull request #3280 from cgwalters/release
Release 2024.7
2024-07-19 07:10:51 -04:00
Colin Walters
68679e03b3 Post-release version bump
Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-18 17:55:21 -04:00
Colin Walters
4941d9cd0d Release 2024.7
Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-18 17:55:21 -04:00