5477 Commits

Author SHA1 Message Date
Colin Walters
0554beb4c2 Release 2022.3 v2022.3 2022-05-04 13:50:06 -04:00
Dan Nicholson
7fffc2e91e
Merge pull request #2593 from smcv/txn-refcount
Fix abort-on-error behaviour of transactions
2022-04-30 10:34:12 -06:00
Simon McVittie
71304e854c repo: Correctly initialize refcount of temporary transaction
Previously, the reference count was left uninitialized as a result of
bypassing the constructor, and the intended abort-on-error usually
wouldn't have happened.

Fixes: 8a9737a "repo/private: move OstreeRepoAutoTransaction to a boxed type"
Resolves: https://github.com/ostreedev/ostree/issues/2592
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-30 12:53:42 +01:00
Simon McVittie
540e60c3e3 repo: Factor out _ostree_repo_auto_transaction_new()
This will allow the direct allocation in
ostree_repo_prepare_transaction() to be replaced with a call to this
function, avoiding breaking encapsulation.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-30 12:20:11 +01:00
Jonathan Lebon
9cdd981250
Merge pull request #2589 from cgwalters/ostree-boot-complete 2022-04-26 13:33:08 -04:00
Colin Walters
d3d3e4ea13 Add an ostree-boot-complete.service to propagate staging failures
Quite a while ago we added staged deployments, which solved
a bunch of issues around the `/etc` merge.  However...a persistent
problem since then is that any failures in that process that
happened in the *previous* boot are not very visible.

We ship custom code in `rpm-ostree status` to query the previous
journal.  But that has a few problems - one is that on systems
that have been up a while, that failure message may even get
rotated out.  And second, some systems may not even have a persistent
journal at all.

A general thing we do in e.g. Fedora CoreOS testing is to check
for systemd unit failures.  We do that both in our automated tests,
and we even ship code that displays them on ssh logins.  And beyond
that obviously a lot of other projects do the same; it's easy via
`systemctl --failed`.

So to make failures more visible, change our `ostree-finalize-staged.service`
to have an internal wrapper around the process that "catches" any
errors, and copies the error message into a file in `/boot/ostree`.

Then, a new `ostree-boot-complete.service` looks for this file on
startup and re-emits the error message, and fails.

It also deletes the file.  The rationale is to avoid *continually*
warning.  For example we need to handle the case when an upgrade
process creates a new staged deployment.  Now, we could change the
ostree core code to delete the warning file when that happens instead,
but this is trying to be a conservative change.

This should make failures here much more visible as is.
2022-04-26 13:02:46 -04:00
Colin Walters
98587a72db
Merge pull request #2588 from cgwalters/ostree-and-ima
docs: Add new IMA document
2022-04-21 18:13:07 -04:00
Colin Walters
b070e0f54a Update docs/ima.md
Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
2022-04-21 16:24:57 -04:00
Colin Walters
614d30acf3 docs: Add new IMA document
Now that the fixed code for `ima-sign` landed in
https://github.com/ostreedev/ostree-rs-ext/pull/283
2022-04-21 12:04:33 -04:00
Dan Nicholson
8491a12102
Merge pull request #2584 from cgwalters/fix-ci
ci: Mask zincati for synthetic update
2022-04-20 19:03:16 -06:00
Colin Walters
b92dbc49f0 ci: Mask zincati for synthetic update
Our CI started falling over because coreos-assembler checks
for units stuck activating as of https://github.com/coreos/coreos-assembler/pull/2810

Really need to centralize the code for this and fix the root
problem, but...not today.

xref https://github.com/coreos/coreos-assembler/pull/2814
2022-04-20 20:23:10 -04:00
Colin Walters
d75b934c59
Merge pull request #2583 from cgwalters/curl-check-setopt
fetcher/curl: Consistently check return value `curl_easy_setopt`
2022-04-20 20:22:12 -04:00
Colin Walters
4fd0d6b4c1 fetcher/curl: Consistently check return value curl_easy_setopt
Static analyzers don't like when we only check it sometimes.

And we definitely want to know if any of these are failing.
2022-04-20 15:16:22 -04:00
Colin Walters
688f0c4eea
Merge pull request #2578 from lucab/ups/move-fixture
tests: move fixture to fix installed tests
2022-04-12 11:47:07 -04:00
Luca BRUNO
7e83726faa
tests: move fixture to fix installed tests
This moves around the packed archive for bare-split-xattrs mode,
in order to fix installed tests.
2022-04-12 09:53:54 +00:00
Colin Walters
f21944da1c
Merge pull request #2577 from dbnicholson/man-html
Publish man pages
2022-04-09 15:46:25 -04:00
Dan Nicholson
9b6a8171c5 docs: Publish man pages
Make a copy of `man/html` to `docs/man` and then configure Jekyll to
include it verbatim like the API docs. A link is added to the main index
and the necessary commands are added to the github docs workflow.
2022-04-08 19:25:32 -06:00
Dan Nicholson
8032e89d33 man: Create an HTML index
This provides something that can serve at the root of the HTML man pages
tree.
2022-04-08 19:25:32 -06:00
Dan Nicholson
d5061dcf82 man: Use custom XSL stylesheet for HTML output
This allows using a template stolen from systemd to turn references into
links.
2022-04-08 19:25:32 -06:00
Dan Nicholson
61deb167da man: Allow building HTML man pages
Add a --enable-man-html configure option to build HTML man pages using a
different stylesheet. The HTML pages aren't installed as I don't know
what purpose they'd serve on an actual installation.
2022-04-08 19:25:32 -06:00
Dan Nicholson
f396873d36 man: Remove unnecessary nbsp's from ostree man page
I really don't know what these were for. In both man and HTML output
with a recent version of the Docbook XSL, the command synopses are
already indented. I don't see any reason why they'd need to be manually
indented more.
2022-04-08 19:25:32 -06:00
Jonathan Lebon
59c6934e74
Merge pull request #2576 from cgwalters/archive-handle-null-link 2022-04-04 14:32:52 -04:00
Colin Walters
2346d5f4d5 libarchive: Handle archive_entry_symlink() returning NULL
The `archive_entry_symlink()` API can definitely return `NULL`,
reading through the libarchive sources.

I hit this in the wild when using old ostree-ext to try to unpack
a chunked archive.

I didn't try to characterize this more, and sorry no unit test right
now.
2022-04-04 10:25:35 -04:00
Colin Walters
fdfb353f19
Merge pull request #2569 from WOnder93/finalize-deployment-selinux-policy
deploy: Try to rebuild policy in new deployment if needed
2022-03-28 20:55:07 -04:00
Colin Walters
c58a4fe661 deploy: Be a bit more verbose about SELinux bits
Let's log when we don't find the expected CLI argument which
will help debug things.
2022-03-28 17:46:59 -04:00
Ondrej Mosnacek
edb4f38934 deploy: Try to rebuild policy in new deployment if needed
Whenever the user has SELinux enabled and has any local
modules/modifications installed, it is necessary to rebuild the policy
in the final deployment, otherwise ostree will leave the binary policy
files unchanged from last deployment as it detects difference against
the base content (in rpm-ostree case this is the RPM content).

To avoid the situation where the policy binaries go stale once any local
customization of the policy is made, try to rebuild the policy as part
of sysroot_finalize_deployment(). Use the special
--rebuild-if-modules-changed switch, which detects if the input module
files have changed relative to last time the policy was built and skips
the most time-consuming part of the rebuild process if modules are
unchanged (thus making this a relatively cheap operation if the user
hasn't made any modifications to the shipped policy).

As suggested by Jonathan Lebon, this uses bubblewrap (via
g_spawn_sync()) to perform the rebuild inside the deployment's
filesystem tree, which also means that ostree will have a runtime
dependency on bubblewrap.

Partially addresses: https://github.com/coreos/fedora-coreos-tracker/issues/701

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-03-28 17:18:03 -04:00
Colin Walters
86741ad18a
Merge pull request #2573 from jtojnar/single-bin-coreutils-extensions
tests/test-cli-extensions: Fix with single-binary coreutils
2022-03-28 11:11:55 -04:00
Jan Tojnar
1898019fac tests/test-cli-extensions: Fix with single-binary coreutils
On systems where `coreutils` are built with `--enable-single-binary=symlinks` like Nix,
`/usr/bin/env` is symlinked to `/usr/bin/coreutils` and uses `argv[0]` to determine which program to run.
Since the `test-cli-extensions.sh` created a new symlink named `ostree-env`,
coreutils would be confused about the utility to choose, so running it would fail:

	ostree-env: unknown program ‘ostree-env’
	Try 'ostree-env --help' for more information.

Fixes: https://github.com/ostreedev/ostree/issues/2553
2022-03-26 10:55:42 +01:00
Jonathan Lebon
574d35bbdf
Merge pull request #2566 from cgwalters/ci-update 2022-03-14 15:24:23 -04:00
Jonathan Lebon
73bc62cac3
Merge pull request #2528 from cgwalters/test-crate-update 2022-03-14 15:20:54 -04:00
Colin Walters
afdc84b97b Update to sh-inline 0.2
Syncing up with the latest.
2022-03-14 09:54:48 -04:00
Colin Walters
e6f92f76fa ci: Update docs workflow to use fcos-buildroot
This way we can also use `./ci/installdeps.sh` which avoids yet
another list of dependencies.
2022-03-14 09:27:07 -04:00
Colin Walters
089b821098 ci: Disable Ubuntu LTS
It doesn't have a new enough glib.
2022-03-14 09:21:15 -04:00
Colin Walters
6ba254ab11
Merge pull request #2551 from q66/guri
lib: bump glib requirement to 2.66 and port to GUri
2022-03-14 08:52:51 -04:00
Daniel Kolesa
aca9e8e6a7 glib: bump glib requirement to 2.66 and port to GUri
This removes the old SoupURI copypasta from previous generation
of libsoup and opens up a path for a simple libsoup3 port.
2022-03-12 04:44:18 +01:00
Colin Walters
75ae283f23 Update to rand 0.8
Part of general crate updates.
2022-03-11 15:34:59 -05:00
Colin Walters
fba7efb6da Update to ostree-ext 0.6
Part of general crate updates.
2022-03-11 15:33:02 -05:00
Colin Walters
34d1bcc68a Update to nix 0.23
Part of general crate updates.
2022-03-11 15:32:27 -05:00
Colin Walters
b6d1119f91 tests: Stop using inventory crate
I was reading this thread
https://internals.rust-lang.org/t/from-life-before-main-to-common-life-in-main/16006/30
and that reminded me about this code, which it turns out actually
doesn't compile with my default local cargo config:
```
$ cat ~/.cargo/config
[target.x86_64-unknown-linux-gnu]
rustflags = ["-Ctarget-cpu=native", "-C", "link-arg=-fuse-ld=lld"]

[profile.release]
incremental = true
$ cargo b
...
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/var/srv/walters/src/github/ostreedev/ostree/target/debug/deps/ostree_test-4ca8e730f9dc6ffc.10325uqlhkyr5uol.rcgu.o" "/var/srv/walte"
  = note: ld.lld: error: undefined symbol: __start_linkme_NONDESTRUCTIVE_TESTS
          >>> referenced by 22nn09lfsklfqvyy
          >>>               /var/srv/walters/src/github/ostreedev/ostree/target/debug/deps/ostree_test-4ca8e730f9dc6ffc.22nn09lfsklfqvyy.rcgu.o:(ostree_tes)

```

For now let's just go back to having a static list of functions.
We don't have *too* many of those.
2022-03-11 14:53:29 -05:00
Luca Bruno
2f11977da5
Merge pull request #2563 from cgwalters/tmpfiles-run
tmpfiles: Create `/run/ostree`
2022-03-11 18:54:49 +00:00
Colin Walters
0d020a7145 tmpfiles: Create /run/ostree
This is referenced by 9645cee4f2/lib/src/globals.rs (L16)
specifically used for the (container image) pull secret in
`/run/ostree/auth.json`.

Let's pre-create the directory so users don't have to.

Motivated by https://github.com/openshift/machine-config-operator/pull/3007#discussion_r824172564
2022-03-11 13:08:23 -05:00
Luca Bruno
087f850227
Merge pull request #2564 from damdo/patch-1
README.md: update ostree-rs language binding link
2022-03-11 17:57:26 +00:00
Damiano Donati
039d86c63b
README.md: update ostree-rs language binding link
According to the description on https://gitlab.com/fkrull/ostree-rs/ the repository is now moved to https://github.com/ostreedev/ostree-rs
2022-03-11 11:12:43 +00:00
Luca Bruno
0d6e66b57a
Merge pull request #2562 from josepht/main
Add Fedora Kinoite link to index.md also.
2022-03-10 21:05:02 +00:00
Joe Talbott
faa8ed547b Add Fedora Kinoite link to index.md also. 2022-03-09 08:58:12 -05:00
Colin Walters
566fa59753
Merge pull request #2561 from pwithnall/pull-leak
ostree-repo-pull: Take correct out path on error
2022-03-08 11:22:42 -05:00
Philip Withnall
8cc8e68768 ostree-repo-pull: Take correct out path on error
Like every other error return path in this function, jump to the `out`
label on error here. Returning directly will cause leaks.

Spotted by reading the code, not actually necessarily encountered in the
wild.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-08 15:36:27 +00:00
Colin Walters
775ff6e687
Merge pull request #2560 from smcv/sigpipe
test-prune: Read to the end of cut(1) output
2022-03-08 10:29:11 -05:00
Colin Walters
21a083db69
Merge pull request #2559 from smcv/shebang
Fix shebang in s390x-se-luks-gencpio
2022-03-08 09:46:07 -05:00
Simon McVittie
92ca2c7794 test-prune: Read to the end of cut(1) output
If we use head(1) to take only the first two lines, then cut(1) and
earlier pipeline entries are killed by SIGPIPE (if they have not already
terminated), and that's flagged as an error under `set -o pipefail`.
Use an equivalent sed command to take exactly the second line, but
without SIGPIPE.

Signed-off-by: Simon McVittie <smcv@debian.org>

Gbp-Pq: Name test-prune-Read-to-the-end-of-cut-1-output.patch
2022-03-07 23:03:33 +00:00