Commit Graph

5498 Commits

Author SHA1 Message Date
Felix Krull 116f0dea86 Try implementing traverse_commit by hand 2022-05-06 12:53:53 -04:00
Felix Krull 5e8753b369 Generate functions and constants 2022-05-06 12:53:53 -04:00
Felix Krull 306046f572 Integrate docs into source
TODO properly document those steps
2022-05-06 12:53:53 -04:00
Felix Krull 19fef71592 Add as much of Repo as easily possible 2022-05-06 12:53:53 -04:00
Felix Krull 62f8310dea Add additional 'new' method to Repo 2022-05-06 12:53:53 -04:00
Felix Krull 449899b16f Add a test/sample program 2022-05-06 12:53:52 -04:00
Felix Krull 1ea604a531 Add a prelude module for star imports 2022-05-06 12:53:52 -04:00
Felix Krull 4c51e595f0 Add some basic types and regenerate 2022-05-06 12:53:52 -04:00
Felix Krull 45eab127a6 Generate 2022-05-06 12:53:52 -04:00
Felix Krull 8950188bce Add build files for libostree 2022-05-06 12:53:52 -04:00
Felix Krull 0c45c2ec82 Start describing libostree 2022-05-06 12:53:52 -04:00
Felix Krull 5c2d700d51 Add manual definition for stat 2022-05-06 12:53:52 -04:00
Felix Krull c47eb77001 Update names and dependencies 2022-05-06 12:53:52 -04:00
Felix Krull 7e2c82b1b1 Add external libraries and regenerate 2022-05-06 12:53:52 -04:00
Felix Krull 03abeebb89 Add initial gir output 2022-05-06 12:53:52 -04:00
Felix Krull 804b1107b5 Add config file and gir files
Not sure if I want to keep the gir files in the repo
2022-05-06 12:53:52 -04:00
Joseph Marrero Corchado b6b94ba55c
Merge pull request #2598 from lucab/ups/without-systemd-fix
lib/ostree-sysroot-deploy: add a missing include for stdint.h
2022-05-06 07:45:02 -04:00
Luca BRUNO 83956daeee
ci/github: add a job for --without-libsystemd 2022-05-06 10:07:24 +00:00
Luca BRUNO 4b7fc4f1e9
lib/ostree-sysroot-deploy: add a missing include for stdint.h 2022-05-06 10:07:23 +00:00
Jonathan Lebon df44271624
Merge pull request #2596 from cgwalters/release-2022-3 2022-05-04 14:55:37 -04:00
Colin Walters 3583143cf0 configure: post-release version bump 2022-05-04 13:51:45 -04:00
Colin Walters 0554beb4c2 Release 2022.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