ostree.git
3 years agorepo: Correctly initialize refcount of temporary transaction
Simon McVittie [Sat, 30 Apr 2022 11:53:42 +0000 (12:53 +0100)]
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>
3 years agorepo: Factor out _ostree_repo_auto_transaction_new()
Simon McVittie [Sat, 30 Apr 2022 11:20:11 +0000 (12:20 +0100)]
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>
3 years agoMerge pull request #2589 from cgwalters/ostree-boot-complete
Jonathan Lebon [Tue, 26 Apr 2022 17:33:08 +0000 (13:33 -0400)]
Merge pull request #2589 from cgwalters/ostree-boot-complete

3 years agoAdd an `ostree-boot-complete.service` to propagate staging failures
Colin Walters [Fri, 22 Apr 2022 22:46:28 +0000 (18:46 -0400)]
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.

3 years agoMerge pull request #2588 from cgwalters/ostree-and-ima
Colin Walters [Thu, 21 Apr 2022 22:13:07 +0000 (18:13 -0400)]
Merge pull request #2588 from cgwalters/ostree-and-ima

docs: Add new IMA document

3 years agoUpdate docs/ima.md
Colin Walters [Thu, 21 Apr 2022 20:19:14 +0000 (16:19 -0400)]
Update docs/ima.md

Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
3 years agodocs: Add new IMA document
Colin Walters [Thu, 21 Apr 2022 16:04:33 +0000 (12:04 -0400)]
docs: Add new IMA document

Now that the fixed code for `ima-sign` landed in
https://github.com/ostreedev/ostree-rs-ext/pull/283

3 years agoMerge pull request #2584 from cgwalters/fix-ci
Dan Nicholson [Thu, 21 Apr 2022 01:03:16 +0000 (19:03 -0600)]
Merge pull request #2584 from cgwalters/fix-ci

ci: Mask zincati for synthetic update

3 years agoci: Mask zincati for synthetic update
Colin Walters [Thu, 21 Apr 2022 00:23:10 +0000 (20:23 -0400)]
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

3 years agoMerge pull request #2583 from cgwalters/curl-check-setopt
Colin Walters [Thu, 21 Apr 2022 00:22:12 +0000 (20:22 -0400)]
Merge pull request #2583 from cgwalters/curl-check-setopt

fetcher/curl: Consistently check return value `curl_easy_setopt`

3 years agofetcher/curl: Consistently check return value `curl_easy_setopt`
Colin Walters [Wed, 20 Apr 2022 19:16:22 +0000 (15:16 -0400)]
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.

3 years agoMerge pull request #2578 from lucab/ups/move-fixture
Colin Walters [Tue, 12 Apr 2022 15:47:07 +0000 (11:47 -0400)]
Merge pull request #2578 from lucab/ups/move-fixture

tests: move fixture to fix installed tests

3 years agotests: move fixture to fix installed tests
Luca BRUNO [Tue, 12 Apr 2022 09:53:54 +0000 (09:53 +0000)]
tests: move fixture to fix installed tests

This moves around the packed archive for bare-split-xattrs mode,
in order to fix installed tests.

3 years agoMerge pull request #2577 from dbnicholson/man-html
Colin Walters [Sat, 9 Apr 2022 19:46:25 +0000 (15:46 -0400)]
Merge pull request #2577 from dbnicholson/man-html

Publish man pages

3 years agodocs: Publish man pages
Dan Nicholson [Fri, 8 Apr 2022 21:30:07 +0000 (15:30 -0600)]
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.

3 years agoman: Create an HTML index
Dan Nicholson [Fri, 8 Apr 2022 22:51:59 +0000 (16:51 -0600)]
man: Create an HTML index

This provides something that can serve at the root of the HTML man pages
tree.

3 years agoman: Use custom XSL stylesheet for HTML output
Dan Nicholson [Fri, 8 Apr 2022 21:30:23 +0000 (15:30 -0600)]
man: Use custom XSL stylesheet for HTML output

This allows using a template stolen from systemd to turn references into
links.

3 years agoman: Allow building HTML man pages
Dan Nicholson [Fri, 21 May 2021 17:57:54 +0000 (11:57 -0600)]
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.

3 years agoman: Remove unnecessary nbsp's from ostree man page
Dan Nicholson [Sat, 9 Apr 2022 00:01:31 +0000 (18:01 -0600)]
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.

3 years agoMerge pull request #2576 from cgwalters/archive-handle-null-link
Jonathan Lebon [Mon, 4 Apr 2022 18:32:52 +0000 (14:32 -0400)]
Merge pull request #2576 from cgwalters/archive-handle-null-link

3 years agolibarchive: Handle `archive_entry_symlink()` returning NULL
Colin Walters [Mon, 4 Apr 2022 14:25:35 +0000 (10:25 -0400)]
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.

3 years agoMerge pull request #2569 from WOnder93/finalize-deployment-selinux-policy
Colin Walters [Tue, 29 Mar 2022 00:55:07 +0000 (20:55 -0400)]
Merge pull request #2569 from WOnder93/finalize-deployment-selinux-policy

deploy: Try to rebuild policy in new deployment if needed

3 years agodeploy: Be a bit more verbose about SELinux bits
Colin Walters [Mon, 28 Mar 2022 21:46:59 +0000 (17:46 -0400)]
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.

3 years agodeploy: Try to rebuild policy in new deployment if needed
Ondrej Mosnacek [Wed, 9 Mar 2022 14:27:11 +0000 (15:27 +0100)]
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>
3 years agoMerge pull request #2573 from jtojnar/single-bin-coreutils-extensions
Colin Walters [Mon, 28 Mar 2022 15:11:55 +0000 (11:11 -0400)]
Merge pull request #2573 from jtojnar/single-bin-coreutils-extensions

tests/test-cli-extensions: Fix with single-binary coreutils

3 years agotests/test-cli-extensions: Fix with single-binary coreutils
Jan Tojnar [Sat, 26 Mar 2022 09:50:45 +0000 (10:50 +0100)]
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
3 years agoMerge pull request #2566 from cgwalters/ci-update
Jonathan Lebon [Mon, 14 Mar 2022 19:24:23 +0000 (15:24 -0400)]
Merge pull request #2566 from cgwalters/ci-update

3 years agoMerge pull request #2528 from cgwalters/test-crate-update
Jonathan Lebon [Mon, 14 Mar 2022 19:20:54 +0000 (15:20 -0400)]
Merge pull request #2528 from cgwalters/test-crate-update

3 years agoUpdate to sh-inline 0.2
Colin Walters [Fri, 11 Mar 2022 20:37:15 +0000 (15:37 -0500)]
Update to sh-inline 0.2

Syncing up with the latest.

3 years agoci: Update docs workflow to use fcos-buildroot
Colin Walters [Mon, 14 Mar 2022 13:27:07 +0000 (09:27 -0400)]
ci: Update docs workflow to use fcos-buildroot

This way we can also use `./ci/installdeps.sh` which avoids yet
another list of dependencies.

3 years agoci: Disable Ubuntu LTS
Colin Walters [Mon, 14 Mar 2022 13:21:15 +0000 (09:21 -0400)]
ci: Disable Ubuntu LTS

It doesn't have a new enough glib.

3 years agoMerge pull request #2551 from q66/guri
Colin Walters [Mon, 14 Mar 2022 12:52:51 +0000 (08:52 -0400)]
Merge pull request #2551 from q66/guri

lib: bump glib requirement to 2.66 and port to GUri

3 years agoglib: bump glib requirement to 2.66 and port to GUri
Daniel Kolesa [Thu, 17 Feb 2022 19:12:18 +0000 (20:12 +0100)]
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.

3 years agoUpdate to rand 0.8
Colin Walters [Fri, 11 Mar 2022 20:34:59 +0000 (15:34 -0500)]
Update to rand 0.8

Part of general crate updates.

3 years agoUpdate to ostree-ext 0.6
Colin Walters [Fri, 11 Mar 2022 20:33:02 +0000 (15:33 -0500)]
Update to ostree-ext 0.6

Part of general crate updates.

3 years agoUpdate to nix 0.23
Colin Walters [Fri, 11 Mar 2022 20:32:27 +0000 (15:32 -0500)]
Update to nix 0.23

Part of general crate updates.

3 years agotests: Stop using inventory crate
Colin Walters [Thu, 27 Jan 2022 21:37:30 +0000 (16:37 -0500)]
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.

3 years agoMerge pull request #2563 from cgwalters/tmpfiles-run
Luca Bruno [Fri, 11 Mar 2022 18:54:49 +0000 (18:54 +0000)]
Merge pull request #2563 from cgwalters/tmpfiles-run

tmpfiles: Create `/run/ostree`

3 years agotmpfiles: Create `/run/ostree`
Colin Walters [Thu, 10 Mar 2022 21:46:53 +0000 (16:46 -0500)]
tmpfiles: Create `/run/ostree`

This is referenced by https://github.com/ostreedev/ostree-rs-ext/blob/9645cee4f29786ba51ae9d62a52eeef9230146fd/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

3 years agoMerge pull request #2564 from damdo/patch-1
Luca Bruno [Fri, 11 Mar 2022 17:57:26 +0000 (17:57 +0000)]
Merge pull request #2564 from damdo/patch-1

README.md: update ostree-rs language binding link

3 years agoREADME.md: update ostree-rs language binding link
Damiano Donati [Fri, 11 Mar 2022 11:12:43 +0000 (11:12 +0000)]
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

3 years agoMerge pull request #2562 from josepht/main
Luca Bruno [Thu, 10 Mar 2022 21:05:02 +0000 (21:05 +0000)]
Merge pull request #2562 from josepht/main

Add Fedora Kinoite link to index.md also.

3 years agoAdd Fedora Kinoite link to index.md also.
Joe Talbott [Wed, 9 Mar 2022 13:58:12 +0000 (08:58 -0500)]
Add Fedora Kinoite link to index.md also.

3 years agoMerge pull request #2561 from pwithnall/pull-leak
Colin Walters [Tue, 8 Mar 2022 16:22:42 +0000 (11:22 -0500)]
Merge pull request #2561 from pwithnall/pull-leak

ostree-repo-pull: Take correct out path on error

3 years agoostree-repo-pull: Take correct out path on error
Philip Withnall [Tue, 8 Mar 2022 15:36:27 +0000 (15:36 +0000)]
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>
3 years agoMerge pull request #2560 from smcv/sigpipe
Colin Walters [Tue, 8 Mar 2022 15:29:11 +0000 (10:29 -0500)]
Merge pull request #2560 from smcv/sigpipe

test-prune: Read to the end of cut(1) output

3 years agoMerge pull request #2559 from smcv/shebang
Colin Walters [Tue, 8 Mar 2022 14:46:07 +0000 (09:46 -0500)]
Merge pull request #2559 from smcv/shebang

Fix shebang in s390x-se-luks-gencpio

3 years agotest-prune: Read to the end of cut(1) output
Simon McVittie [Mon, 7 Mar 2022 19:52:25 +0000 (19:52 +0000)]
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

3 years agos390x-se-luks-gencpio: Use interoperable path for bash
Simon McVittie [Mon, 7 Mar 2022 21:07:25 +0000 (21:07 +0000)]
s390x-se-luks-gencpio: Use interoperable path for bash

On OSs that do not consistently merge /usr/bin with /bin, the path to
bash has traditionally been /bin/bash.

Signed-off-by: Simon McVittie <smcv@debian.org>
3 years agos390x-se-luks-gencpio: Fix shebang syntax
Simon McVittie [Mon, 7 Mar 2022 21:06:48 +0000 (21:06 +0000)]
s390x-se-luks-gencpio: Fix shebang syntax

An indented `#!` is technically meaningless, although many shells will
run text files with the shell if asked to execute them.

Signed-off-by: Simon McVittie <smcv@debian.org>
3 years agoMerge pull request #2557 from lucab/ups/apidoc-includes
Colin Walters [Mon, 7 Mar 2022 09:10:34 +0000 (04:10 -0500)]
Merge pull request #2557 from lucab/ups/apidoc-includes

apidoc: add missing page includes

3 years agoapidoc: add missing page includes
Luca BRUNO [Fri, 4 Mar 2022 13:56:38 +0000 (13:56 +0000)]
apidoc: add missing page includes

This fixes some missing sections in API reference, adding all the
relevant includes.

3 years agoMerge pull request #2556 from ostreedev/release-2022.2
Colin Walters [Fri, 4 Mar 2022 00:23:29 +0000 (19:23 -0500)]
Merge pull request #2556 from ostreedev/release-2022.2

Release 2022.2

3 years agoconfigure: post-release version bump
Colin Walters [Thu, 3 Mar 2022 21:30:43 +0000 (16:30 -0500)]
configure: post-release version bump

3 years agoRelease 2022.2
Colin Walters [Thu, 3 Mar 2022 21:29:11 +0000 (16:29 -0500)]
Release 2022.2

3 years agoMerge pull request #2532 from lucab/ups/repo-mode-bare-split-xattrs
Colin Walters [Thu, 3 Mar 2022 14:41:45 +0000 (09:41 -0500)]
Merge pull request #2532 from lucab/ups/repo-mode-bare-split-xattrs

lib/core: introduce 'bare-split-xattrs' mode

3 years agotests/basic-bare-split-xattrs: add fixture, check read logic
Luca BRUNO [Thu, 3 Mar 2022 11:12:00 +0000 (11:12 +0000)]
tests/basic-bare-split-xattrs: add fixture, check read logic

3 years agolib/commit: disallow writing content in 'bare-split-xattrs' mode
Luca BRUNO [Wed, 2 Mar 2022 16:45:02 +0000 (16:45 +0000)]
lib/commit: disallow writing content in 'bare-split-xattrs' mode

This prevents writing content into 'bare-split-xattrs` repository,
while carving some space for experimenting via a temporary
`OSTREE_EXP_WRITE_BARE_SPLIT_XATTRS` environment flag.

3 years agolib/repo: read split xattrs content from file-xattrs-link objects
Luca BRUNO [Wed, 2 Mar 2022 16:45:01 +0000 (16:45 +0000)]
lib/repo: read split xattrs content from file-xattrs-link objects

3 years agolib/core: introduce 'bare-split-xattrs' mode
Luca BRUNO [Wed, 2 Mar 2022 16:45:00 +0000 (16:45 +0000)]
lib/core: introduce 'bare-split-xattrs' mode

3 years agolib/core: introduce two new object types for split xattrs
Luca BRUNO [Wed, 2 Mar 2022 16:44:59 +0000 (16:44 +0000)]
lib/core: introduce two new object types for split xattrs

This adds two new object types for storing xattrs separately from
content objects.

`.file-xattrs` are regular files storing xattrs content, encoded as
GVariant. Each object is keyed by the checksum of its content, allowing
for multiple references.

`.file-xattrs-link` are hardlinks which are associated to file objects.
Each object is keyed by the same checksum of the corresponding file
object. The target of the hardlink is an existing file-xattrs object.
In case of reaching the limit of too many links, this object could be
a plain file too.

3 years agoMerge pull request #2554 from ostreedev/dependabot/submodules/libglnx-c71f7ae
Luca Bruno [Wed, 2 Mar 2022 16:44:31 +0000 (16:44 +0000)]
Merge pull request #2554 from ostreedev/dependabot/submodules/libglnx-c71f7ae

build(deps): bump libglnx from `88da8dd` to `c71f7ae`

3 years agobuild(deps): bump libglnx from `88da8dd` to `c71f7ae`
dependabot[bot] [Wed, 2 Mar 2022 12:30:34 +0000 (12:30 +0000)]
build(deps): bump libglnx from `88da8dd` to `c71f7ae`

Bumps libglnx from `88da8dd` to `c71f7ae`.

---
updated-dependencies:
- dependency-name: libglnx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoMerge pull request #2536 from saqibali-2k/pr/prune-commit-only
Colin Walters [Mon, 28 Feb 2022 13:47:09 +0000 (08:47 -0500)]
Merge pull request #2536 from saqibali-2k/pr/prune-commit-only

src/ostree: Add --commit-only option to ostree prune

3 years agotests/test-prune.sh: Use TAP API
Saqib Ali [Thu, 24 Feb 2022 21:57:23 +0000 (16:57 -0500)]
tests/test-prune.sh: Use TAP API

Change tests to use the newer TAP API introduced
in https://github.com/ostreedev/ostree/pull/2440

3 years agotests/test-prune.sh: expand testing for --commit-only
Saqib Ali [Wed, 23 Feb 2022 00:00:25 +0000 (19:00 -0500)]
tests/test-prune.sh: expand testing for --commit-only

Let's add additional tests to expand the test
suite for the new --commit-only functionality.

3 years agoman/prune, bash: Add --commit-only flag for ostree prune
Saqib Ali [Tue, 8 Feb 2022 14:08:44 +0000 (09:08 -0500)]
man/prune, bash: Add --commit-only flag for ostree prune

Update the man page and the auto-complete script
to include the --commit-only flag

3 years agosrc/ostree: Add --commit-only option to ostree prune
Saqib Ali [Mon, 7 Feb 2022 15:53:08 +0000 (10:53 -0500)]
src/ostree: Add --commit-only option to ostree prune

Recently we have noticed exceedingly long execution times
for multiple invocations of ostree prune. This is a result of
calculating full reachability on each invocation.

The --commit-only flag provides an alternative strategy. It will only
traverse and delete commit objects to avoid the more expensive
reachability calculations. This allows us to chain multiple --commit-only
commands cheaply, and then follow with a more expensive ostree prune
invocation at the end to clean up orphaned meta and content objects.

3 years agoMerge pull request #2548 from cgwalters/mtree-load-ensured
Jonathan Lebon [Tue, 22 Feb 2022 20:20:22 +0000 (15:20 -0500)]
Merge pull request #2548 from cgwalters/mtree-load-ensured

3 years agoMerge pull request #2552 from ostreedev/dependabot/submodules/libglnx-88da8dd
Luca Bruno [Tue, 22 Feb 2022 16:32:08 +0000 (16:32 +0000)]
Merge pull request #2552 from ostreedev/dependabot/submodules/libglnx-88da8dd

build(deps): bump libglnx from `803adaf` to `88da8dd`

3 years agobuild(deps): bump libglnx from `803adaf` to `88da8dd`
dependabot[bot] [Tue, 22 Feb 2022 15:51:55 +0000 (15:51 +0000)]
build(deps): bump libglnx from `803adaf` to `88da8dd`

Bumps libglnx from `803adaf` to `88da8dd`.

---
updated-dependencies:
- dependency-name: libglnx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoMerge pull request #2549 from ostreedev/mwleeds/fix-partial-delta-fetches
Colin Walters [Mon, 21 Feb 2022 19:23:39 +0000 (14:23 -0500)]
Merge pull request #2549 from ostreedev/mwleeds/fix-partial-delta-fetches

Fix marking static delta commits as partial

3 years agolib/repo-refs: Remove misleading newline
Phaedrus Leeds [Sat, 19 Feb 2022 20:46:02 +0000 (14:46 -0600)]
lib/repo-refs: Remove misleading newline

3 years agoFix marking static delta commits as partial
Phaedrus Leeds [Sat, 19 Feb 2022 13:55:02 +0000 (07:55 -0600)]
Fix marking static delta commits as partial

This patch makes it so that we mark the .commit file from a static delta
as partial before writing the commit to the staging directory. This
exactly mirrors what we do in meta_fetch_on_complete() when writing the
commit on that codepath, which should lend some credibility to the
correctness of this patch.

I have checked that this fixes an issue Flatpak users have been
encountering (https://github.com/flatpak/flatpak/issues/3479) which
results in error messages like "error: Failed to install
org.freedesktop.Sdk.Extension.texlive: Failed to read commit
c7958d966cfa8b80a42877d1d6124831d7807f93c89461a2a586956aa28d438a: No
such metadata object
8bdaa943b957f3cf14d19301c59c7eec076e57389e0fbb3ef5d30082e47a178f.dirtree"

Here's the sequence of events that lead to the error:
1. An install operation is started that fetches static deltas.
2. The fetch is interrupted for some reason such as network connectivity
   dropping.
3. The .commit and .commitmeta files for the commit being pulled are
   left in the staging dir, e.g.
   "~/.local/share/flatpak/repo/tmp/staging-dfe862b2-13fc-49a2-ac92-5a59cc0d8e18-RURckd"
4. There is no `.commitpartial` file for the commit in
   "~/.local/share/flatpak/repo/state/"
5. The next time the user attempts the install, libostree reuses the
   existing staging dir, pulls the commit and commitmeta objects into
   the repo from the staging dir on the assumption that it's a complete
   commit.
6. Flatpak then tries to deploy the commit but fails in
   ostree_repo_read_commit() in flatpak_dir_deploy(), leading to the
   error message "Failed to read commit ..."
7. This happens again any subsequent time the user attempts the install,
   until the incomplete commit is removed with "flatpak repair --user".

I will try to also add a workaround in Flatpak so this is fixed even
when Flatpak links against affected versions of libostree.

3 years agomtree: Load traversed subdirs when creating parents
Colin Walters [Fri, 18 Feb 2022 15:24:13 +0000 (10:24 -0500)]
mtree: Load traversed subdirs when creating parents

I'm working on enhancing the ostree-rs-ext test suite and I hit
a bug where walking a mtree and creating a parent would fail to
load lazy intermediate directories, e.g.:

/ -> usr -> bin

If we walked we'd load `/` but keep `usr` lazy, and then invalidation
would crash because it wasn't loaded.

If we're going to mutate a subdir, we need to have all the parents
loaded.

I know this is missing tests, but...it's a bit tedious to do with
the existing C tests.  Eventually soon we'll execute on merging
all 3 repos, and better share test suites.

3 years agomtree: Use declare-and-initialize style
Colin Walters [Fri, 18 Feb 2022 15:22:26 +0000 (10:22 -0500)]
mtree: Use declare-and-initialize style

Prep for further work.

3 years agoMerge pull request #2546 from cgwalters/drop-aggregate-return
Dan Nicholson [Thu, 17 Feb 2022 21:30:21 +0000 (14:30 -0700)]
Merge pull request #2546 from cgwalters/drop-aggregate-return

build-sys: Drop `-Werror=aggregate-return`

3 years agobuild-sys: Drop `-Werror=aggregate-return`
Colin Walters [Thu, 17 Feb 2022 19:22:27 +0000 (14:22 -0500)]
build-sys: Drop `-Werror=aggregate-return`

This is failing for me as of recently but only when I build
without optimization.  I don't think we've ever written any
code that returned a large structure by value.

Let's just drop this one.

3 years agoMerge pull request #2545 from dbnicholson/lgtm-deps
Colin Walters [Thu, 17 Feb 2022 17:45:19 +0000 (12:45 -0500)]
Merge pull request #2545 from dbnicholson/lgtm-deps

.lgtm.yml: Fix gpgme dependency

3 years ago.lgtm.yml: Fix gpgme dependency
Dan Nicholson [Thu, 17 Feb 2022 17:13:03 +0000 (10:13 -0700)]
.lgtm.yml: Fix gpgme dependency

Since Ubuntu 18.04, libgpgme-dev is the real package and libgpgme11-dev
is a virtual package provided by it. Apparently LGTM running on Ubuntu
20.04 no longer resolves the virtual package:

```
WARNING: Package 'libgpgme11-dev' requested by configuration file was not found
```

That ends up causing the build to fail:

```
configure: error: Need GPGME_PTHREAD version 1.1.8 or later
```

3 years agoMerge pull request #2542 from cgwalters/tar-error-prefixing
Colin Walters [Tue, 15 Feb 2022 23:22:01 +0000 (18:22 -0500)]
Merge pull request #2542 from cgwalters/tar-error-prefixing

lib/tar: Add some error prefixing

3 years agolib/tar: Add some error prefixing
Colin Walters [Tue, 15 Feb 2022 19:17:20 +0000 (14:17 -0500)]
lib/tar: Add some error prefixing

We're trying to debug a problem with a tar stream with hardlinks,
and I think this will be helpful.

3 years agoMerge pull request #2541 from melix99/find-remotes-fix-typo
Colin Walters [Sun, 13 Feb 2022 15:54:30 +0000 (10:54 -0500)]
Merge pull request #2541 from melix99/find-remotes-fix-typo

man: Fix typo in ostree-find-remotes

3 years agoMerge pull request #2540 from melix99/switch-fix-typo
Colin Walters [Sun, 13 Feb 2022 15:53:33 +0000 (10:53 -0500)]
Merge pull request #2540 from melix99/switch-fix-typo

man: Fix typo in ostree-admin-switch

3 years agoman: Fix typo in ostree-find-remotes
Marco Melorio [Sat, 12 Feb 2022 18:00:28 +0000 (19:00 +0100)]
man: Fix typo in ostree-find-remotes

3 years agoman: Fix typo in ostree-admin-switch
Marco Melorio [Sat, 12 Feb 2022 17:48:35 +0000 (18:48 +0100)]
man: Fix typo in ostree-admin-switch

3 years agoMerge pull request #2539 from chergert/main
Colin Walters [Sat, 12 Feb 2022 14:04:43 +0000 (09:04 -0500)]
Merge pull request #2539 from chergert/main

lib/bootloader: use ot_journal_print() instead of sd-journal

3 years agolib/bootloader: use ot_journal_print() instead of sd-journal
Christian Hergert [Fri, 11 Feb 2022 23:12:15 +0000 (15:12 -0800)]
lib/bootloader: use ot_journal_print() instead of sd-journal

This needs to use the helper so that USE_LIBSYSTEMD still works as
expected.

3 years agolib/util: add syslog.h for ot_journal_print()
Christian Hergert [Fri, 11 Feb 2022 22:31:12 +0000 (14:31 -0800)]
lib/util: add syslog.h for ot_journal_print()

If we aren't including sd-journal, we may need this too.

3 years agoMerge pull request #2538 from cgwalters/dirmeta-not-floating
Colin Walters [Fri, 11 Feb 2022 23:01:49 +0000 (18:01 -0500)]
Merge pull request #2538 from cgwalters/dirmeta-not-floating

core: Mark `ostree_create_directory_metadata` as `(not nullable)`

3 years agoMerge pull request #2491 from nikita-dubrovskii/secure-execution
Colin Walters [Fri, 11 Feb 2022 20:34:55 +0000 (15:34 -0500)]
Merge pull request #2491 from nikita-dubrovskii/secure-execution

s390x: add secure-execution support

3 years agocore: Mark `ostree_create_directory_metadata` as `(not nullable)`
Colin Walters [Fri, 11 Feb 2022 19:09:49 +0000 (14:09 -0500)]
core: Mark `ostree_create_directory_metadata` as `(not nullable)`

So I can drop an unnecessary use of `unwrap()` in Rust.

3 years agos390x: add LUKS keyfile to 'sd-boot'
Nikita Dubrovskii [Mon, 17 Jan 2022 14:59:54 +0000 (15:59 +0100)]
s390x: add LUKS keyfile to 'sd-boot'

This allows to use Secure Execution with LUKS encrypted boot disk,
key and cryptab are stored only in 'sd-boot' encrypted image.

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
3 years agos390x: add "IBM Secure Execution for Linux" support
Nikita Dubrovskii [Wed, 17 Nov 2021 12:10:20 +0000 (13:10 +0100)]
s390x: add "IBM Secure Execution for Linux" support

If system contains ibm-z-hostkey (fetched during ignition), than
ostree generates 'sd-boot' image and reboots into Secure Execution

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
3 years agoMerge pull request #2537 from jlebon/pr/fix-floating
Colin Walters [Wed, 9 Feb 2022 22:15:26 +0000 (17:15 -0500)]
Merge pull request #2537 from jlebon/pr/fix-floating

lib/gpg-verify-result: Add missing floating annotation

3 years agolib/gpg-verify-result: Add missing floating annotation
Jonathan Lebon [Wed, 9 Feb 2022 19:29:50 +0000 (14:29 -0500)]
lib/gpg-verify-result: Add missing floating annotation

I think I'm hitting issues due to this while using the Rust bindings:
https://github.com/coreos/rpm-ostree/pull/3406#issuecomment-1033084956

The bindings for those APIs use `from_glib_full` which says:

> Because ownership can only be transferred if something is already
> referenced, this is unsuitable for floating references.

3 years agoMerge pull request #2535 from dbnicholson/summary-commit-version
Colin Walters [Fri, 4 Feb 2022 22:51:02 +0000 (17:51 -0500)]
Merge pull request #2535 from dbnicholson/summary-commit-version

lib/repo: Add commit version metadata to summary metadata

3 years agolib/repo: Add commit version metadata to summary metadata
Dan Nicholson [Fri, 4 Feb 2022 21:11:06 +0000 (14:11 -0700)]
lib/repo: Add commit version metadata to summary metadata

The commit metadata `version` key is well established but getting it for
a remote commit is cumbersome since the commit object needs to be
fetched and loaded. Including it in the summary additional metadata
allows a much more convenient view of what each of the remote refs
represents.

3 years agoMerge pull request #2534 from jlebon/pr/copr
Jonathan Lebon [Thu, 3 Feb 2022 20:36:50 +0000 (15:36 -0500)]
Merge pull request #2534 from jlebon/pr/copr

3 years agoAdd COPR integration Makefile
Jonathan Lebon [Thu, 3 Feb 2022 18:25:07 +0000 (13:25 -0500)]
Add COPR integration Makefile

I'd like to enable auto-builds of this repo to
https://copr.fedorainfracloud.org/coprs/g/CoreOS/continuous/ so it could
eventually feed into
https://github.com/coreos/fedora-coreos-tracker/issues/910.