ostree.git
4 years agoMerge pull request #2332 from dbnicholson/ubuntu-ci
Colin Walters [Thu, 8 Apr 2021 16:58:01 +0000 (12:58 -0400)]
Merge pull request #2332 from dbnicholson/ubuntu-ci

travis: Don't ask any debconf questions when installing packages

4 years agotravis: Drop i386 Ubuntu target
Dan Nicholson [Thu, 8 Apr 2021 16:33:12 +0000 (10:33 -0600)]
travis: Drop i386 Ubuntu target

Ubuntu dropped i386[1], so there's no sense in attempting the build
there. In 2021 I don't think it's worth the trouble to keep doing that,
but if desired Debian still supports it.

1. https://wiki.ubuntu.com/FocalFossa/ReleaseNotes#Upgrades_on_i386

4 years agotravis: Don't ask any debconf questions when installing packages
Dan Nicholson [Thu, 8 Apr 2021 16:22:21 +0000 (10:22 -0600)]
travis: Don't ask any debconf questions when installing packages

Currently the Ubuntu builds are stuck waiting for an answer on what
timezone to use. That could be fixed, but generally the way to do these
types of installs is to set the DEBIAN_FRONTEND environment variable to
`noninteractive` so that debconf just chooses a default. This is what
debootstrap does, for instance. I tested installing tzdata on a local
focal container this way and it just chooses `Etc/UTC` as the timezone.

4 years agoMerge pull request #2331 from cgwalters/update-travis-ubuntu
Dan Nicholson [Thu, 8 Apr 2021 15:44:12 +0000 (09:44 -0600)]
Merge pull request #2331 from cgwalters/update-travis-ubuntu

travis: Bump Ubuntu versions

4 years agotravis: Bump Ubuntu versions
Colin Walters [Thu, 8 Apr 2021 15:36:08 +0000 (15:36 +0000)]
travis: Bump Ubuntu versions

xenial is EOL soon, let's bump to the latest LTS and the latest.

4 years agoMerge pull request #2330 from cgwalters/silence-libarchive-warning
Luca Bruno [Thu, 8 Apr 2021 14:54:42 +0000 (14:54 +0000)]
Merge pull request #2330 from cgwalters/silence-libarchive-warning

tests: Silence a gcc warning

4 years agotests: Silence a gcc warning
Colin Walters [Thu, 8 Apr 2021 14:45:28 +0000 (14:45 +0000)]
tests: Silence a gcc warning

We can't mix `goto` and `__attribute__((cleanup))`.

4 years agoMerge pull request #2326 from cgwalters/writing-api-prep
Luca Bruno [Thu, 8 Apr 2021 08:12:59 +0000 (08:12 +0000)]
Merge pull request #2326 from cgwalters/writing-api-prep

core: Drop unused error handling from object stream helper

4 years agoMerge pull request #2324 from cgwalters/test-use-ex
Luca Bruno [Thu, 8 Apr 2021 08:10:05 +0000 (08:10 +0000)]
Merge pull request #2324 from cgwalters/test-use-ex

Various patches for tests/inst

4 years agoMerge pull request #2323 from cgwalters/remove-experimental
Dan Nicholson [Wed, 7 Apr 2021 21:31:40 +0000 (15:31 -0600)]
Merge pull request #2323 from cgwalters/remove-experimental

build-sys: Remove --enable-experimental-api

4 years agocore: Drop unused error handling from object stream helper
Colin Walters [Wed, 7 Apr 2021 20:01:07 +0000 (20:01 +0000)]
core: Drop unused error handling from object stream helper

I was going to add some new API and I noticed that this function
never returns an error; presumably at one point it did, but
not anymore.  It simplifies the code flow noticeably
to remove that.

4 years agoMerge pull request #2325 from dbnicholson/apidoc-gitignore
Colin Walters [Wed, 7 Apr 2021 19:50:30 +0000 (15:50 -0400)]
Merge pull request #2325 from dbnicholson/apidoc-gitignore

API doc gitignore cleanup

4 years agoEnsure consistent apidoc .gitignore
Dan Nicholson [Wed, 7 Apr 2021 19:37:53 +0000 (13:37 -0600)]
Ensure consistent apidoc .gitignore

If you don't configure with --enable-gtk-doc, these won't be included in
the generated .gitignore. If you later configure with --enable-gtk-doc
in the same checkout, they'll show up as untracked files. Include them
in GITIGNOREFILES to ensure they're always added regardless of configure
options.

4 years agoRemove apidoc .gitignore from version control
Dan Nicholson [Wed, 7 Apr 2021 19:36:01 +0000 (13:36 -0600)]
Remove apidoc .gitignore from version control

Like the top level .gitignore, there's no reason to track this if it's
being generated automatically. It only produces spurious diff changes
that you almost certainly don't want.

4 years agobuild-sys: Remove --enable-experimental-api
Colin Walters [Wed, 7 Apr 2021 17:10:44 +0000 (17:10 +0000)]
build-sys: Remove --enable-experimental-api

It was added for the collections bits, but we made that stable.
It's now just cruft and we're very unlikely to reuse the infrastructure
again.

Motivated by a unit test failure when running from a tarball:
https://github.com/ostreedev/ostree/issues/2313

4 years agotests/inst: Update tokio, hyper and nix
Colin Walters [Wed, 7 Apr 2021 17:43:03 +0000 (17:43 +0000)]
tests/inst: Update tokio, hyper and nix

4 years agotests/inst: Update rpm-ostree client
Colin Walters [Wed, 7 Apr 2021 17:40:26 +0000 (17:40 +0000)]
tests/inst: Update rpm-ostree client

4 years agotests/inst: Update ostree crate
Colin Walters [Wed, 7 Apr 2021 17:37:26 +0000 (17:37 +0000)]
tests/inst: Update ostree crate

4 years agotests: Drop openat override
Colin Walters [Wed, 7 Apr 2021 17:36:04 +0000 (17:36 +0000)]
tests: Drop openat override

No longer needed.

4 years agocore: Fix lgtm.com warning about always true `if (bits > 0)`
Colin Walters [Sat, 27 Mar 2021 14:06:22 +0000 (14:06 +0000)]
core: Fix lgtm.com warning about always true `if (bits > 0)`

Since we're not going to change this, let's constant fold the logic
here.

4 years agomanual-tests: Fix unused variables
Colin Walters [Fri, 26 Mar 2021 19:46:25 +0000 (19:46 +0000)]
manual-tests: Fix unused variables

lgtm.com harshly makes our JS grade "D" due to these unused
variables.

4 years agobuild-sys: Include all mkinitcpio bits
Colin Walters [Mon, 5 Apr 2021 21:00:07 +0000 (21:00 +0000)]
build-sys: Include all mkinitcpio bits

It's still so tempting to switch to `git archive` to ship sources.

Closes: https://github.com/ostreedev/ostree/issues/2312
4 years agorofiles-fuse: Enable support for setting and getting xattrs
Stefan Berger [Wed, 31 Mar 2021 20:41:32 +0000 (16:41 -0400)]
rofiles-fuse: Enable support for setting and getting xattrs

Enable support for setting and getting xattrs. Allow modifications
to xattrs only on user.ima xattr.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Co-authored-by: Colin Walters <walters@verbum.org>
4 years agorepo: Ensure load_variant_if_exists sets NULL value
Colin Walters [Tue, 30 Mar 2021 20:51:51 +0000 (20:51 +0000)]
repo: Ensure load_variant_if_exists sets NULL value

Spotted by @jlebon - we usually expect callers to zero, but
let's be explicit.

4 years agorepo: Fix load_variant_if_exists to return a nullable value
Colin Walters [Tue, 30 Mar 2021 20:00:13 +0000 (20:00 +0000)]
repo: Fix load_variant_if_exists to return a nullable value

Another introspection fix I hit when trying to use this in Rust.

4 years agocci: Update for buildroot changes
Colin Walters [Fri, 26 Mar 2021 14:12:37 +0000 (14:12 +0000)]
cci: Update for buildroot changes

See latest in https://github.com/coreos/fedora-coreos-tracker/blob/master/docs/ci-and-builds.md

4 years agotests/pull-test: Use mv -f in a few cases
Colin Walters [Fri, 26 Mar 2021 21:52:26 +0000 (21:52 +0000)]
tests/pull-test: Use mv -f in a few cases

For some reason I'm hitting this locally because some files are mode `0`.
Which is clearly a different bug but anyways we don't want to prompt.

4 years agoinstalldeps: Drop PyYAML
Colin Walters [Fri, 26 Mar 2021 21:38:51 +0000 (21:38 +0000)]
installdeps: Drop PyYAML

Doesn't exist anymore in f33 and we don't depend on python2 anymore.

4 years agolib: fix some version tags
Felix Krull [Fri, 26 Mar 2021 19:31:01 +0000 (20:31 +0100)]
lib: fix some version tags

4 years agoMerge pull request #2315 from cgwalters/add-lgtm-dot-com
Jonathan Lebon [Fri, 26 Mar 2021 18:08:06 +0000 (14:08 -0400)]
Merge pull request #2315 from cgwalters/add-lgtm-dot-com

.lgtm.yml: Add package deps

4 years ago.lgtm.yml: Add package deps
Colin Walters [Fri, 26 Mar 2021 17:32:51 +0000 (17:32 +0000)]
.lgtm.yml: Add package deps

I was recently looking at systemd's CI and came across this.
AFAICS it's a proprietary analysis but it looks useful.

We still have `clang-analyzer` for example for FOSS analysis.

4 years agoconfigure: post-release version bump
Colin Walters [Fri, 19 Mar 2021 22:23:16 +0000 (22:23 +0000)]
configure: post-release version bump

4 years agoRelease 2021.1
Colin Walters [Fri, 19 Mar 2021 21:53:37 +0000 (21:53 +0000)]
Release 2021.1

4 years agoMerge pull request #2309 from jlebon/pr/prefix-pull
Colin Walters [Mon, 22 Mar 2021 22:58:39 +0000 (18:58 -0400)]
Merge pull request #2309 from jlebon/pr/prefix-pull

lib/pull: Add some error-prefixing in dirtree scanning

4 years agolib/pull: Add some error-prefixing in dirtree scanning
Jonathan Lebon [Mon, 22 Mar 2021 20:31:06 +0000 (16:31 -0400)]
lib/pull: Add some error-prefixing in dirtree scanning

I think these are the paths involved in the error message at
https://github.com/coreos/rpm-ostree/issues/2250.

4 years agoMerge pull request #2306 from cgwalters/drop-core-rust
Jonathan Lebon [Mon, 22 Mar 2021 13:59:42 +0000 (09:59 -0400)]
Merge pull request #2306 from cgwalters/drop-core-rust

4 years agotests/inst: Patch to use my PR for openat
Colin Walters [Fri, 19 Mar 2021 21:45:54 +0000 (21:45 +0000)]
tests/inst: Patch to use my PR for openat

Fixes the build.

4 years agoDrop minimal rust/ library
Colin Walters [Thu, 18 Mar 2021 21:54:52 +0000 (21:54 +0000)]
Drop minimal rust/ library

This was my first experiment with using Rust in this way; I gained
a lot of knowledge from it.  But, we don't really gain
anything from the code as it is today - while it is "bit fiddling"
code, the C code is well tested.

We have a lot of compile-time options, and trimming them will be
helpful.

We've also gotten pushback on hard requiring Rust client side.

Instead, what I'd like to do is hopefully soon create an `ostree-system`
crate that uses the existing `ostree` library and can contain
code drained from the rpm-ostree Rust and used by other projects perhaps.

So the goal here is really more Rust, but we need to focus our
efforts on where it's most valuable.

4 years agoMerge pull request #2298 from KloudJack/remove-grub2-suffix
Colin Walters [Thu, 18 Mar 2021 21:46:18 +0000 (17:46 -0400)]
Merge pull request #2298 from KloudJack/remove-grub2-suffix

Add configure option for unsuffixed GRUB2 commands linux/initrd

4 years agoAdd configure option for unsuffixed GRUB2 commands
Kenneth J. Miller [Thu, 18 Mar 2021 12:55:01 +0000 (13:55 +0100)]
Add configure option for unsuffixed GRUB2 commands

GRUB starting with version 2.02 permits the use of the linux and
initrd commands for both EFI boot in *-efi installations, as
well as 32-bit BIOS boot in i386-pc installations.

This makes the use of the -16 and -efi suffixes for BIOS and EFI
boot obsolete on systems with a modern GRUB installation.

The --with-modern-grub configure flag makes ostree use the
unsuffixed linux/initrd commands when generating a GRUB
configuration, while defaulting to the previous behaviour for
users not wanted this option.

4 years agoMerge pull request #2301 from cgwalters/api-require-booted
Colin Walters [Thu, 18 Mar 2021 12:46:35 +0000 (08:46 -0400)]
Merge pull request #2301 from cgwalters/api-require-booted

sysroot: Add _require_booted_deployment() API

4 years agosysroot: Add _require_booted_deployment() API
Colin Walters [Wed, 17 Mar 2021 14:03:49 +0000 (14:03 +0000)]
sysroot: Add _require_booted_deployment() API

This is a common pattern that is replicated both in our code
and in rpm-ostree a lot.  Let's add a canonical API.

4 years agoMerge pull request #2303 from cgwalters/gh-actions
Colin Walters [Wed, 17 Mar 2021 19:49:05 +0000 (15:49 -0400)]
Merge pull request #2303 from cgwalters/gh-actions

ci: Add a Github Action for Rust for tests/inst

4 years agoci: Add a Github Action for Rust for tests/inst
Colin Walters [Wed, 17 Mar 2021 17:23:47 +0000 (17:23 +0000)]
ci: Add a Github Action for Rust for tests/inst

Let's dip our toes in GH Actions (specifically aiming to migrate
away from Travis).

4 years agotests/inst: cargo fmt
Colin Walters [Wed, 17 Mar 2021 18:45:07 +0000 (18:45 +0000)]
tests/inst: cargo fmt

4 years agoMerge pull request #2302 from cgwalters/tests-inst-clippy
Colin Walters [Wed, 17 Mar 2021 18:43:10 +0000 (14:43 -0400)]
Merge pull request #2302 from cgwalters/tests-inst-clippy

tests/inst: Fix lots of `cargo clippy` warnings

4 years agotests/inst: Fix lots of `cargo clippy` warnings
Colin Walters [Wed, 17 Mar 2021 17:13:52 +0000 (17:13 +0000)]
tests/inst: Fix lots of `cargo clippy` warnings

Prep for doing this in CI.

4 years agoMerge pull request #2296 from cgwalters/commit-os
OpenShift Merge Robot [Fri, 12 Mar 2021 22:22:45 +0000 (17:22 -0500)]
Merge pull request #2296 from cgwalters/commit-os

Add an API+CLI to inject metadata for bootable OSTree commits

4 years agoAdd an API+CLI to inject metadata for bootable OSTree commits
Colin Walters [Thu, 11 Mar 2021 01:36:13 +0000 (01:36 +0000)]
Add an API+CLI to inject metadata for bootable OSTree commits

I was doing some rpm-ostree work and I wanted to compare two
OSTree commits to see if the kernel has changed.  I think
this should be a lot more natural.

Add `ostree commit --bootable` which calls into a new generic
library API `ostree_commit_metadata_for_bootable()` that
discovers the kernel version and injects it as an `ostree.linux`
metadata key.  And for extra clarity, add an `ostree.bootable`
key.

It's interesting because the "core" OSTree layer is all about
generic files, but this is adding special APIs around bootable
OSTree commits (as opposed to e.g. flatpak as well as
things like rpm-ostree's pkgcache refs).

Eventually, I'd like to ensure everyone is using this and
hard require this metadata key for the `ostree admin deploy`
flow - mainly to prevent accidents.

4 years agoMerge pull request #2293 from ostreedev/fix-file-uri-decoding
OpenShift Merge Robot [Wed, 10 Mar 2021 20:14:51 +0000 (21:14 +0100)]
Merge pull request #2293 from ostreedev/fix-file-uri-decoding

Fix translation of file:// URIs into paths

4 years agoFix translation of file:// URIs into paths
Phaedrus Leeds [Wed, 10 Mar 2021 18:02:14 +0000 (10:02 -0800)]
Fix translation of file:// URIs into paths

Currently if a file path contains a special character such as '\', and
that character is encoded into a file:// URI that is passed to
ostree_repo_pull_with_options(), the percent encoding will remain in the
path passed to g_file_new() (in the case of backslash %5C) and the pull
will then fail with a file not found error. This is an important edge
case to handle because by default on many Linux distributions a
filesystem with no label is mounted at a path based on its UUID, and
this is then passed to systemd-escape by Flatpak (when
--enable-auto-sideloading was used at compile time) to create a symbolic
link such as this which contains backslashes:

$ ls -l /run/flatpak/sideload-repos/
total 0
lrwxrwxrwx 1 mwleeds mwleeds 55 Mar  9 14:21
'automount-run-media-mwleeds-29419e8f\x2dc680\x2d4e95\x2d9a31\x2d2cc907d421cb'
-> /run/media/mwleeds/29419e8f-c680-4e95-9a31-2cc907d421cb

And Flatpak then passes libostree a file:// URI containing that path, to
implement sideloading (pulling content from the USB drive).

This results in an error like:

Error: While pulling app/org.videolan.VLC/x86_64/stable from remote
flathub:
/run/flatpak/sideload-repos/automount-run-media-mwleeds-29419e8f%5Cx2dc680%5Cx2d4e95%5Cx2d9a31%5Cx2d2cc907d421cb/.ostree/repo:
opendir(/run/flatpak/sideload-repos/automount-run-media-mwleeds-29419e8f%5Cx2dc680%5Cx2d4e95%5Cx2d9a31%5Cx2d2cc907d421cb/.ostree/repo):
No such file or directory

This patch avoids such errors by using g_file_new_for_uri() instead of
g_file_new_for_path(), so that GLib handles the %-decoding for us.

Bug report by user:
https://community.endlessos.com/t/can-not-install-vlc-from-usb-drive-3-9-3/16353

4 years agopull: Fix some whitespace and a comment
Phaedrus Leeds [Wed, 10 Mar 2021 18:01:04 +0000 (10:01 -0800)]
pull: Fix some whitespace and a comment

4 years agoMerge pull request #2292 from pwithnall/summary-leak
OpenShift Merge Robot [Tue, 9 Mar 2021 13:27:50 +0000 (14:27 +0100)]
Merge pull request #2292 from pwithnall/summary-leak

ostree-repo-pull: Fix a leak of the summary data if loading from cache

4 years agoostree-repo-pull: Fix a leak of the summary data if loading from cache
Philip Withnall [Tue, 9 Mar 2021 11:47:23 +0000 (11:47 +0000)]
ostree-repo-pull: Fix a leak of the summary data if loading from cache

If the `summary_sig_not_modified` branch is taken above, both
`signatures` and `summary` are loaded from the cache. This makes the
`_ostree_repo_load_cache_summary_if_same_sig()` call below redundant (it
checks `signatures` matches the file it was just loaded from, and then
loads `summary` again) — but that call also currently overwrites
`summary` without clearing the old value.

Fix this by only making that call if `signatures` was retrieved, but the
server said the local `summary` cache was invalid.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
4 years agoMerge pull request #2290 from ostreedev/fix-repo-modes-docs
OpenShift Merge Robot [Mon, 8 Mar 2021 22:49:34 +0000 (23:49 +0100)]
Merge pull request #2290 from ostreedev/fix-repo-modes-docs

man: Add missing repo mode in config docs

4 years agoman: Add missing repo mode in config docs
Phaedrus Leeds [Mon, 8 Mar 2021 21:18:31 +0000 (13:18 -0800)]
man: Add missing repo mode in config docs

4 years agoMerge pull request #2288 from leograba/master
OpenShift Merge Robot [Fri, 5 Mar 2021 00:34:17 +0000 (19:34 -0500)]
Merge pull request #2288 from leograba/master

docs: Add Torizon to related projects and OS

4 years agodocs: Add Torizon to related projects and OS
Leonardo Graboski Veiga [Thu, 4 Mar 2021 19:55:30 +0000 (16:55 -0300)]
docs: Add Torizon to related projects and OS

The Torizon platform, includin the TorizonCore OS, the TorizonCore
Builder Tool and the Torizon OTA, use OSTree as a base for update the
host OS, while the user focus on application development using Docker.

Add TorizonCore to the list of Operating systems and distributions using
OSTree.

Add Torizon and its components to the list of related projects.

4 years agoMerge pull request #2287 from jlebon/pr/deployment-parsing-comments
OpenShift Merge Robot [Wed, 3 Mar 2021 19:36:52 +0000 (14:36 -0500)]
Merge pull request #2287 from jlebon/pr/deployment-parsing-comments

lib/sysroot: Add comments and debug statements around sysroot parsing

4 years agolib/sysroot: Add comments and debug statements around sysroot parsing
Jonathan Lebon [Tue, 2 Mar 2021 20:24:02 +0000 (15:24 -0500)]
lib/sysroot: Add comments and debug statements around sysroot parsing

Was looking at this code more closely today to investigate issues
related to bootlink mismatches (#2283).

4 years agoMerge pull request #2285 from cgwalters/log-bootloader-stuff
OpenShift Merge Robot [Sun, 28 Feb 2021 15:21:15 +0000 (16:21 +0100)]
Merge pull request #2285 from cgwalters/log-bootloader-stuff

deploy: Add subbootversion to journal

4 years agodeploy: Add subbootversion to journal
Colin Walters [Fri, 26 Feb 2021 00:42:58 +0000 (00:42 +0000)]
deploy: Add subbootversion to journal

To help debug an issue we've seen where `/boot` isn't
in sync with the `/ostree/boot` dir, let's log to the journal
what we're doing.

4 years agoMerge pull request #2284 from cgwalters/use-rpmostree-client
OpenShift Merge Robot [Fri, 26 Feb 2021 00:59:56 +0000 (01:59 +0100)]
Merge pull request #2284 from cgwalters/use-rpmostree-client

tests/inst: Switch to rpmostree-client from git

4 years agotests/inst: Switch to rpmostree-client from git
Colin Walters [Wed, 17 Feb 2021 21:59:15 +0000 (21:59 +0000)]
tests/inst: Switch to rpmostree-client from git

See discussion in https://github.com/coreos/rpm-ostree/pull/2569#issuecomment-780569188
Currently pinned to a hash, but after the next stable release let's switch to tags

4 years agoMerge pull request #2282 from cgwalters/resolve-nullable
OpenShift Merge Robot [Fri, 19 Feb 2021 03:44:21 +0000 (22:44 -0500)]
Merge pull request #2282 from cgwalters/resolve-nullable

refs: Make ostree_repo_resolve_rev{,_ext}() use (nullable)

4 years agorefs: Make ostree_repo_resolve_rev{,_ext}() use (nullable)
Colin Walters [Fri, 19 Feb 2021 01:10:26 +0000 (01:10 +0000)]
refs: Make ostree_repo_resolve_rev{,_ext}() use (nullable)

We have an `allow_noent` boolean that controls this, but
were missing the `(nullable)` annotation, so the Rust bindings
panic when the ref doesn't exist instead of being `Option<GString>`.

4 years agoMerge pull request #2280 from cgwalters/readme-fix-contributing
OpenShift Merge Robot [Wed, 17 Feb 2021 22:06:34 +0000 (17:06 -0500)]
Merge pull request #2280 from cgwalters/readme-fix-contributing

README.md: Fix contributing link, add contact section

4 years agoREADME.md: Fix contributing link, add contact section
Colin Walters [Tue, 16 Feb 2021 15:48:33 +0000 (15:48 +0000)]
README.md: Fix contributing link, add contact section

Came up on #fedora-iot channel.

4 years agoMerge pull request #2279 from cgwalters/doc-scratch-delta
OpenShift Merge Robot [Fri, 12 Feb 2021 17:26:03 +0000 (12:26 -0500)]
Merge pull request #2279 from cgwalters/doc-scratch-delta

docs: Describe using scratch/empty deltas for initial fetches

4 years agodocs: Describe using scratch/empty deltas for initial fetches
Colin Walters [Thu, 11 Feb 2021 21:19:18 +0000 (21:19 +0000)]
docs: Describe using scratch/empty deltas for initial fetches

Came up with a user hitting ratelimiting from S3.

4 years agoMerge pull request #2277 from cgwalters/ci-asan
OpenShift Merge Robot [Fri, 5 Feb 2021 16:43:37 +0000 (11:43 -0500)]
Merge pull request #2277 from cgwalters/ci-asan

Add --enable-sanitizers, fix `make check` with it

4 years agoAdd --enable-sanitizers, fix `make check` with it
Colin Walters [Wed, 3 Feb 2021 14:48:49 +0000 (14:48 +0000)]
Add --enable-sanitizers, fix `make check` with it

It's cleaner if this is an build option rather than being
kludged into the CI layer.

Notably we can't use `LD_PRELOAD` anymore with ASAN, so update
our tests to check for `ASAN_OPTIONS`.

4 years agoMerge pull request #2274 from cgwalters/delta-leak
OpenShift Merge Robot [Wed, 3 Feb 2021 15:07:44 +0000 (10:07 -0500)]
Merge pull request #2274 from cgwalters/delta-leak

deltas: Fix leak of matches

4 years agoMerge pull request #2275 from cgwalters/ci-rework
OpenShift Merge Robot [Wed, 3 Feb 2021 14:58:42 +0000 (09:58 -0500)]
Merge pull request #2275 from cgwalters/ci-rework

CI: run as non-root and add sanitizer build+check

4 years agoMerge pull request #2276 from lucab/ups/tests-enhance-destructive
OpenShift Merge Robot [Wed, 3 Feb 2021 13:58:43 +0000 (08:58 -0500)]
Merge pull request #2276 from lucab/ups/tests-enhance-destructive

tests/ext/destructive: enhance test logic

4 years agotests/ext/destructive: enhance test logic
Luca BRUNO [Wed, 3 Feb 2021 10:04:10 +0000 (10:04 +0000)]
tests/ext/destructive: enhance test logic

This enhances external-tests logic, ensuring that destructive tests
have retries and some context to pinpoint failures, and that failed-state
services are reset between iterations.

4 years agodeltas: Fix leak of matches
Colin Walters [Tue, 2 Feb 2021 21:03:53 +0000 (21:03 +0000)]
deltas: Fix leak of matches

Found by ASAN.

4 years agoMerge pull request #2273 from cgwalters/link-stb-apt2ostree
OpenShift Merge Robot [Tue, 2 Feb 2021 21:21:24 +0000 (16:21 -0500)]
Merge pull request #2273 from cgwalters/link-stb-apt2ostree

README.md: Also link apt2ostree

4 years agoci: Add new build-check-sanitized.sh
Colin Walters [Tue, 2 Feb 2021 21:04:18 +0000 (21:04 +0000)]
ci: Add new build-check-sanitized.sh

All C/C++ projects should use the sanitizers (and static analysis)
in their CI.  We had this but lost it in one of our CI shuffles;
let's readd it.

4 years agoci: Don't install deps if running as non-root
Colin Walters [Tue, 2 Feb 2021 21:08:54 +0000 (21:08 +0000)]
ci: Don't install deps if running as non-root

This way we run in Prow too.

4 years agoREADME.md: Also link apt2ostree
Colin Walters [Sun, 31 Jan 2021 16:07:05 +0000 (16:07 +0000)]
README.md: Also link apt2ostree

Since the topic of Debian+ostree-for-host comes up fairly often.

4 years agoMerge pull request #2267 from dbnicholson/pull-depth-fixes
OpenShift Merge Robot [Tue, 12 Jan 2021 22:34:03 +0000 (17:34 -0500)]
Merge pull request #2267 from dbnicholson/pull-depth-fixes

Pull depth fixes

4 years agopull: Fix local pull with depth and truncated source history
Dan Nicholson [Mon, 11 Jan 2021 23:52:34 +0000 (16:52 -0700)]
pull: Fix local pull with depth and truncated source history

The local pull path was erroring on any missing commit, but that
prevents a depth pull where the source repo has truncated history. As in
the remote case, this also tries to pull in a tombstone commit if the
source repo supports it.

Fixes: #2266
4 years agopull: Error on depth pull with missing head commit
Dan Nicholson [Mon, 11 Jan 2021 19:40:38 +0000 (12:40 -0700)]
pull: Error on depth pull with missing head commit

When pulling with depth, missing parent commits are ignored. However,
the check was applying to any commit, which means that it would succeed
even if the requested commit was missing. This might happen on a
corrupted remote repo or when using ref data from a stale summary.

To achieve this, the semantics of the `commit_to_depth` hash table is
changed slightly to only ever includes parent commits. This makes it
easy to detect when a parent commit is being referenced (although there
is a minor bug there when multiple refs are being pulled) while keeping
references to commits that need their `commitpartial` files cleaned up.
It also means that the table is only populated on depth pulls, which
saves some memory and processing in the common depth=0 case.

Fixes: #2265
4 years agoMerge pull request #2263 from cgwalters/createat-nullable
OpenShift Merge Robot [Tue, 12 Jan 2021 08:38:46 +0000 (03:38 -0500)]
Merge pull request #2263 from cgwalters/createat-nullable

repo: Make ostree_repo_create_at take nullable options

4 years agoMerge pull request #2257 from cgwalters/fsverity
OpenShift Merge Robot [Tue, 12 Jan 2021 01:27:51 +0000 (20:27 -0500)]
Merge pull request #2257 from cgwalters/fsverity

repo: Move fsverity bits to ostree-repo-verity.c

4 years agorepo: Make ostree_repo_create_at take nullable options
Colin Walters [Tue, 12 Jan 2021 01:20:23 +0000 (01:20 +0000)]
repo: Make ostree_repo_create_at take nullable options

Hit this when trying to use the Rust bindings.

4 years agotests: Ensure no dangling commit partials on remote depth pull
Dan Nicholson [Mon, 11 Jan 2021 23:05:05 +0000 (16:05 -0700)]
tests: Ensure no dangling commit partials on remote depth pull

This was already being done on the local depth pull test, so this just
adds the matching logic to the remote depth pull test.

4 years agorepo: Move fsverity bits to ostree-repo-verity.c
Colin Walters [Thu, 7 Jan 2021 21:17:01 +0000 (21:17 +0000)]
repo: Move fsverity bits to ostree-repo-verity.c

This file will get larger when we start doing more with fsverity.

4 years agoMerge pull request #2261 from cgwalters/boot-ro-more
OpenShift Merge Robot [Mon, 11 Jan 2021 14:20:30 +0000 (09:20 -0500)]
Merge pull request #2261 from cgwalters/boot-ro-more

sysroot: Handle ro /boot but rw /sysroot

4 years agosysroot: Handle ro /boot but rw /sysroot
Colin Walters [Sat, 9 Jan 2021 18:34:27 +0000 (18:34 +0000)]
sysroot: Handle ro /boot but rw /sysroot

The recent change in https://github.com/coreos/fedora-coreos-config/pull/659
broke some of our tests that do `mount -o remount,rw /sysroot` but
leave `/boot` read-only.

We had code for having `/boot` read-only before `/sysroot` but
in practice we had a file descriptor for `/sysroot` that we opened
before the remount that would happen later on.

Clean things up here so that in the library, we also remount
`/boot` at the same time we remount `/sysroot` if either are readonly.

Delete the legacy code for remounting `/boot` rw if we're not in
a mount namespace.  I am fairly confident most users are either
using the `ostree` CLI, or they're using the mount namespace.

4 years agosysroot: Also maintain canonical boot_fd
Colin Walters [Sat, 9 Jan 2021 20:40:55 +0000 (20:40 +0000)]
sysroot: Also maintain canonical boot_fd

Just like we hold a fd for `/sysroot`, also do so for `/boot`
instead of opening and closing it in a few places.

This is a preparatory cleanup for further work.

4 years agomain: Unconditionally set up mount namespace
Colin Walters [Sat, 9 Jan 2021 20:42:43 +0000 (20:42 +0000)]
main: Unconditionally set up mount namespace

I was being very conservative initially here, but I think it's
really safe to just unconditionally set up the mount namespace.

This avoids having to check twice for a read-only `/sysroot`
(once in the binary and once in the library).

5 years agoMerge pull request #2254 from dbnicholson/coding-style
OpenShift Merge Robot [Fri, 18 Dec 2020 18:54:08 +0000 (18:54 +0000)]
Merge pull request #2254 from dbnicholson/coding-style

pull: Use GNU coding style

5 years agopull: Use GNU coding style
Dan Nicholson [Fri, 18 Dec 2020 16:13:38 +0000 (09:13 -0700)]
pull: Use GNU coding style

5 years agoMerge pull request #2253 from dbnicholson/pull-no-verify-bindings
OpenShift Merge Robot [Fri, 18 Dec 2020 15:39:29 +0000 (15:39 +0000)]
Merge pull request #2253 from dbnicholson/pull-no-verify-bindings

pull: Allow disabling commit binding verification

5 years agopull: Allow disabling commit binding verification
Dan Nicholson [Thu, 17 Dec 2020 21:07:08 +0000 (14:07 -0700)]
pull: Allow disabling commit binding verification

In some cases such as backups or mirroring you may want to pull commits
from one repo to another even if there commits that have incorrect
bindings. Fixing the commits in the source repository to have correct
bindings may not be feasible, so provide a pull option to disable
verification.

For Endless we have several repositories that predate collection IDs and
ref bindings. Later these repositories gained collection IDs to support
the features they provide and ref bindings as the ostree tooling was
upgraded. These repositories contain released commits that were valid to
the clients they were targeting at the time. Correcting the bindings is
not really an option as it would mean invalidating the repository
history.

5 years agoMerge pull request #2249 from mwleeds/fix-readme-flatpak-typo
OpenShift Merge Robot [Wed, 2 Dec 2020 04:55:25 +0000 (05:55 +0100)]
Merge pull request #2249 from mwleeds/fix-readme-flatpak-typo

README: Fix typos of Flatpak

5 years agoREADME: Fix typos of Flatpak
Phaedrus Leeds [Wed, 2 Dec 2020 01:44:51 +0000 (17:44 -0800)]
README: Fix typos of Flatpak

5 years agoMerge pull request #2248 from jjardon/jjardon/more_distros
OpenShift Merge Robot [Wed, 2 Dec 2020 00:14:11 +0000 (01:14 +0100)]
Merge pull request #2248 from jjardon/jjardon/more_distros

README.md: Add Apertis and GNOME OS