ostree.git
4 years agoMerge pull request #2434 from cgwalters/custom-remote
Colin Walters [Wed, 8 Sep 2021 13:27:26 +0000 (09:27 -0400)]
Merge pull request #2434 from cgwalters/custom-remote

Add support for "custom remotes"

4 years agoAdd support for "custom remotes"
Colin Walters [Tue, 7 Sep 2021 22:02:24 +0000 (18:02 -0400)]
Add support for "custom remotes"

This will be helpful for the "ostree native container" work in
https://github.com/ostreedev/ostree-rs-ext/

Basically in order to reuse GPG/signapi verification, we need
to support adding a remote, even though it can't be used via
`ostree pull`.  (At least, not until we merge ostree-rs-ext into ostree, but
 even then I think the principle stands)

4 years agoMerge pull request #2435 from RBuddel/fix-delta-files-resume-legacy-transaction
Luca Bruno [Wed, 8 Sep 2021 08:52:54 +0000 (08:52 +0000)]
Merge pull request #2435 from RBuddel/fix-delta-files-resume-legacy-transaction

repo-pull: legacy_transaction_resuming flag ignored

4 years agoMerge pull request #2430 from cgwalters/stabilize-staging
Luca Bruno [Wed, 8 Sep 2021 08:18:00 +0000 (08:18 +0000)]
Merge pull request #2430 from cgwalters/stabilize-staging

upgrade: Stabilize deployment staging

4 years agorepo-pull: legacy_transaction_resuming flag ignored
Buddelmann, Richard RB [Wed, 8 Sep 2021 06:41:05 +0000 (08:41 +0200)]
repo-pull: legacy_transaction_resuming flag ignored

for deltafiles the legacy_transaction_resuming flag is not used,
which will mark the commit as done, even if files are missing.
using already existing commitstate_is_partial function as fix

4 years agoupgrade: Stabilize deployment staging
Colin Walters [Thu, 2 Sep 2021 20:59:15 +0000 (16:59 -0400)]
upgrade: Stabilize deployment staging

We're waaay overdue for this, it's been the default
in rpm-ostree for years, and solves several important bugs
around not capturing `/etc` while things are running.

Also, `ostree admin upgrade --stage` (should) become idempotent.

Closes: https://github.com/ostreedev/ostree/issues/2389
4 years agoMerge pull request #2428 from lucab/ups/tests-selinux-basic
Colin Walters [Tue, 7 Sep 2021 19:07:59 +0000 (15:07 -0400)]
Merge pull request #2428 from lucab/ups/tests-selinux-basic

tests: fix bare mode unprivileged 'make check'

4 years agotests: skip a broken fsck case
Luca BRUNO [Mon, 30 Aug 2021 15:55:16 +0000 (15:55 +0000)]
tests: skip a broken fsck case

There are some existing issues around fsck in unprivileged bare mode,
so this test does not really work at the moment. Leaving it as a FIXME
for the moment.

4 years agotests/basic: avoid changing ownership
Luca BRUNO [Mon, 30 Aug 2021 14:11:43 +0000 (14:11 +0000)]
tests/basic: avoid changing ownership

This avoids possible issues when trying to chmod, tweaking
permissions instead.

4 years agotests/basic: Skip --no-xattrs if we have selinux
Colin Walters [Thu, 26 Aug 2021 16:47:00 +0000 (12:47 -0400)]
tests/basic: Skip --no-xattrs if we have selinux

It cannot work to use `--no-xattrs` when SELinux is enabled
because we get a `security.selinux` attribute on created files
regardless.  So just skip this test if true.

Also add some `ostree fsck`s in here which helped me debug
this.

4 years agolibtest: tweak selinux/relabel message
Luca BRUNO [Mon, 30 Aug 2021 14:10:05 +0000 (14:10 +0000)]
libtest: tweak selinux/relabel message

4 years agoMerge pull request #2340 from cgwalters/sign-verify-api
Colin Walters [Tue, 31 Aug 2021 12:04:21 +0000 (08:04 -0400)]
Merge pull request #2340 from cgwalters/sign-verify-api

Add an API to verify a commit signature explicitly

4 years agoAdd an API to verify a commit signature explicitly
Colin Walters [Mon, 12 Apr 2021 22:42:05 +0000 (18:42 -0400)]
Add an API to verify a commit signature explicitly

We have a bunch of APIs to do GPG verification of a commit,
but that doesn't generalize to signapi.  Further, they
require the caller to check the signature status explicitly
which seems like a trap.

This much higher level API works with both GPG and signapi.
The intention is to use this in things that are doing "external
pulls" like the ostree-ext tar import support.  There we will
get the commitmeta from the tarball and we want to verify it
at the same time we import the commit.

4 years agoMerge pull request #2426 from cgwalters/xattrs-bareuseronly-union
Luca Bruno [Fri, 27 Aug 2021 07:34:46 +0000 (07:34 +0000)]
Merge pull request #2426 from cgwalters/xattrs-bareuseronly-union

checkout: Also ignore xattrs for union in bare-user-only mode

4 years agoMerge pull request #2425 from cgwalters/hardlink-correct-errno
Luca Bruno [Fri, 27 Aug 2021 07:33:27 +0000 (07:33 +0000)]
Merge pull request #2425 from cgwalters/hardlink-correct-errno

checkout: Save errno when re-throwing

4 years agocheckout: Also ignore xattrs for union in bare-user-only mode
Colin Walters [Thu, 26 Aug 2021 19:25:52 +0000 (15:25 -0400)]
checkout: Also ignore xattrs for union in bare-user-only mode

Followup to PRs related to https://github.com/ostreedev/ostree/issues/2410

Since the test suite now covers this the test was failing on
a Fedora SELinux enabled host where we see `security.selinux`
even if not in the commit.

4 years agoMerge pull request #2424 from cgwalters/test-nonroot-ci
Colin Walters [Thu, 26 Aug 2021 21:25:59 +0000 (17:25 -0400)]
Merge pull request #2424 from cgwalters/test-nonroot-ci

ci: Run GH action CI build+test as non-root

4 years agoMerge pull request #2422 from cgwalters/allow-none-detached
Dan Nicholson [Thu, 26 Aug 2021 19:33:23 +0000 (13:33 -0600)]
Merge pull request #2422 from cgwalters/allow-none-detached

lib: Change read_commit_detached_metadata to be nullable

4 years agocheckout: Save errno when re-throwing
Colin Walters [Thu, 26 Aug 2021 19:16:37 +0000 (15:16 -0400)]
checkout: Save errno when re-throwing

I was seeing an `EPERM`  here which was confusing.
It turned out the real error was `EEXIST`.

Since we're referring to the original error, but we do a
lot of computation in the middle, we need to save errno.

4 years agoci: Run main GH action CI build+test as non-root
Colin Walters [Thu, 26 Aug 2021 13:53:56 +0000 (09:53 -0400)]
ci: Run main GH action CI build+test as non-root

This is really the standard best practice, matching how
e.g. dpkg/rpm work, as well as most local development
environments (including mine) with e.g. `toolbox`.

4 years agolib: Change read_commit_detached_metadata to be nullable
Colin Walters [Wed, 25 Aug 2021 19:18:43 +0000 (15:18 -0400)]
lib: Change read_commit_detached_metadata to be nullable

Hit this while working on some Rust code.

4 years agoMerge pull request #2421 from lucab/ups/auto-txn-fixes
Colin Walters [Wed, 25 Aug 2021 21:45:28 +0000 (17:45 -0400)]
Merge pull request #2421 from lucab/ups/auto-txn-fixes

lib: improve transactions auto-cleanup logic

4 years agolib: improve transactions auto-cleanup logic
Luca BRUNO [Wed, 25 Aug 2021 12:30:21 +0000 (12:30 +0000)]
lib: improve transactions auto-cleanup logic

This fixes some aspects of OstreeRepoAutoTransaction and re-aligns
it with the logic in flatpak. Specifically:
 * link to the underlying repo through refcounting
 * bridge internal errors to warning messages
 * verify the input pointer type

This is a preparation step before exposing this logic as a public API.

4 years agoMerge pull request #2418 from lucab/ups/lib-commit-xattrs
Luca Bruno [Tue, 24 Aug 2021 14:28:39 +0000 (14:28 +0000)]
Merge pull request #2418 from lucab/ups/lib-commit-xattrs

commit: automatically skip xattrs in bare-user-only mode

4 years agotests: update several bare-user-only checks
Luca BRUNO [Mon, 23 Aug 2021 09:46:22 +0000 (09:46 +0000)]
tests: update several bare-user-only checks

4 years agolib/commit: automatically skip xattrs in bare-user-only mode
Luca BRUNO [Mon, 23 Aug 2021 13:08:44 +0000 (13:08 +0000)]
lib/commit: automatically skip xattrs in bare-user-only mode

4 years agobuiltins/commit: set up relevant flags in bare-user-only mode
Luca BRUNO [Mon, 23 Aug 2021 13:08:53 +0000 (13:08 +0000)]
builtins/commit: set up relevant flags in bare-user-only mode

This detects bare-user-only mode and automatically enables a
commit modifier with relevant flags.

4 years agolib/diff: automatically skip xattrs in bare-user-only mode
Luca BRUNO [Mon, 23 Aug 2021 13:51:55 +0000 (13:51 +0000)]
lib/diff: automatically skip xattrs in bare-user-only mode

4 years agoMerge pull request #2419 from dbnicholson/gpg-list-keys
Luca Bruno [Tue, 24 Aug 2021 07:55:59 +0000 (07:55 +0000)]
Merge pull request #2419 from dbnicholson/gpg-list-keys

bin/remote: Rename list-gpg-keys to gpg-list-keys

4 years agobin/remote: Rename list-gpg-keys to gpg-list-keys
Dan Nicholson [Mon, 23 Aug 2021 17:09:24 +0000 (11:09 -0600)]
bin/remote: Rename list-gpg-keys to gpg-list-keys

As pointed out in the original review, `gpg-list-keys` fits better
alongside the existing `gpg-import`.

Changes were done with:

```
git grep -l list-gpg-keys | xargs sed -i 's/list-gpg-keys/gpg-list-keys/'
for src in $(git ls-files '*list-gpg-keys*'); do
  dst=${src/list-gpg-keys/gpg-list-keys}
  git mv "$src" "$dst"
done
```

4 years agoMerge pull request #2417 from lucab/ups/diff-repo-ignore-xattrs
Colin Walters [Mon, 23 Aug 2021 14:58:36 +0000 (10:58 -0400)]
Merge pull request #2417 from lucab/ups/diff-repo-ignore-xattrs

lib/diff: ignore xattrs if disabled on either repos

4 years agolib/diff: ignore xattrs if disabled on either repos
Luca BRUNO [Mon, 23 Aug 2021 12:39:02 +0000 (12:39 +0000)]
lib/diff: ignore xattrs if disabled on either repos

This fixes the logic to detect whether xattrs should be automatically
ignored when diffing.

4 years agoMerge pull request #2412 from lucab/ups/lib-commit-canonicalize
Colin Walters [Fri, 20 Aug 2021 19:12:21 +0000 (15:12 -0400)]
Merge pull request #2412 from lucab/ups/lib-commit-canonicalize

lib/commit: autofix permissions for bare-user-only

4 years agoMerge pull request #2401 from dbnicholson/gpg-key-info
Colin Walters [Fri, 20 Aug 2021 19:11:11 +0000 (15:11 -0400)]
Merge pull request #2401 from dbnicholson/gpg-key-info

Remote GPG key info

4 years agolib/commit: autofix permissions for bare-user-only
Luca BRUNO [Fri, 20 Aug 2021 10:58:24 +0000 (10:58 +0000)]
lib/commit: autofix permissions for bare-user-only

This tweaks commit logic to detect bare-user-only repositories and
canonicalize permissions automatically.

4 years agoMerge pull request #2415 from lucab/ups/checksum-canonical-perms
Luca Bruno [Thu, 19 Aug 2021 17:00:14 +0000 (17:00 +0000)]
Merge pull request #2415 from lucab/ups/checksum-canonical-perms

lib/checkout: use canonical permissions in bare-user-only mode

4 years agolib/repo/checkout: use canonical perms in bare-user-only mode
Luca BRUNO [Thu, 19 Aug 2021 14:07:19 +0000 (14:07 +0000)]
lib/repo/checkout: use canonical perms in bare-user-only mode

This automatically enables canonical permissions for checkouts in
bare-user-only mode.

4 years agolib/core/checksum: add flag to use canonical permissions
Luca BRUNO [Thu, 19 Aug 2021 13:50:21 +0000 (13:50 +0000)]
lib/core/checksum: add flag to use canonical permissions

This adds a new `OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS`
checksumming flag, which is needed in bare-user-only mode
to ignore local IDs.

4 years agoMerge pull request #2414 from lucab/ups/cli-commit-modifier-autoptr
Colin Walters [Wed, 18 Aug 2021 13:10:17 +0000 (09:10 -0400)]
Merge pull request #2414 from lucab/ups/cli-commit-modifier-autoptr

builtins/commit: move commit modifier to auto-cleanup

4 years agoMerge pull request #2411 from lucab/ups/cli-commit-errors
Colin Walters [Wed, 18 Aug 2021 11:59:12 +0000 (07:59 -0400)]
Merge pull request #2411 from lucab/ups/cli-commit-errors

builtins/commit: check for conflicting permissions options

4 years agobuiltins/commit: move commit modifier to auto-cleanup
Luca BRUNO [Wed, 18 Aug 2021 09:06:26 +0000 (09:06 +0000)]
builtins/commit: move commit modifier to auto-cleanup

This reduces the usage of goto cleanup logic by porting the commit
modifier pointer to autoptr.

4 years agobuiltins/commit: check for conflicting permissions options
Luca BRUNO [Tue, 17 Aug 2021 10:30:06 +0000 (10:30 +0000)]
builtins/commit: check for conflicting permissions options

This explicitly checks for commit command options asking for both
non-zero UID/GID and canonical permissions at the same time,
which are incompatible.

4 years agoMerge pull request #2409 from jlebon/pr/cov-fixes
Luca Bruno [Wed, 4 Aug 2021 06:13:37 +0000 (06:13 +0000)]
Merge pull request #2409 from jlebon/pr/cov-fixes

A couple of Coverity fixes

4 years agoostree/dump: Fix free'ing a static string
Jonathan Lebon [Tue, 3 Aug 2021 20:34:32 +0000 (16:34 -0400)]
ostree/dump: Fix free'ing a static string

Reported-by: Seth Arnold <seth.arnold@canonical.com>
4 years agolib/sysroot: Fix error message about creating `/var/lib`
Jonathan Lebon [Tue, 3 Aug 2021 20:34:11 +0000 (16:34 -0400)]
lib/sysroot: Fix error message about creating `/var/lib`

Reported-by: Seth Arnold <seth.arnold@canonical.com>
4 years agolib/sign-dummy: Handle incorrect signatures correctly
Jonathan Lebon [Tue, 3 Aug 2021 20:33:28 +0000 (16:33 -0400)]
lib/sign-dummy: Handle incorrect signatures correctly

We need to check all signatures for one which passes, not just fail on
the first one.

Reported-by: Seth Arnold <seth.arnold@canonical.com>
4 years agoMerge pull request #2408 from bgilbert/workflow
Colin Walters [Thu, 29 Jul 2021 00:27:35 +0000 (20:27 -0400)]
Merge pull request #2408 from bgilbert/workflow

workflows: bump lint toolchain; restrict repository access

4 years agoworkflows: limit permissions to reading repo contents
Benjamin Gilbert [Wed, 28 Jul 2021 22:32:04 +0000 (18:32 -0400)]
workflows: limit permissions to reading repo contents

Move the existing docs permissions stanza to the top of the workflow for
consistency.

4 years agoworkflows: bump lint toolchain
Benjamin Gilbert [Wed, 28 Jul 2021 22:30:33 +0000 (18:30 -0400)]
workflows: bump lint toolchain

4 years agoMerge pull request #2406 from liujianqiang-niu/main
Luca Bruno [Wed, 28 Jul 2021 08:26:45 +0000 (08:26 +0000)]
Merge pull request #2406 from liujianqiang-niu/main

fix: Avoid wild pointers

4 years agofix: Avoid wild pointers
刘建强 [Mon, 26 Jul 2021 01:36:26 +0000 (09:36 +0800)]
fix: Avoid wild pointers

Pointer command is dangerous if there is no assignment.

Log: Avoid wild pointers

4 years agoMerge pull request #2407 from smcv/tests-source-date-epoch
Luca Bruno [Mon, 26 Jul 2021 11:52:06 +0000 (11:52 +0000)]
Merge pull request #2407 from smcv/tests-source-date-epoch

tests: Unset SOURCE_DATE_EPOCH

4 years agotests: Unset SOURCE_DATE_EPOCH
Simon McVittie [Mon, 26 Jul 2021 10:48:45 +0000 (11:48 +0100)]
tests: Unset SOURCE_DATE_EPOCH

Some distributions set this during build in order to have reproducible
builds from the same source code: for example, Debian uses the date
from debian/changelog.

However, some of our tests assume that `ostree commit` will result in
a commit with the current date/time, and SOURCE_DATE_EPOCH breaks that
assumption. Unset it for our build-time tests.

Resolves: https://github.com/ostreedev/ostree/issues/2405
Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agofixup! lib/repo: Add ostree_repo_remote_get_gpg_keys()
Dan Nicholson [Thu, 15 Jul 2021 23:03:45 +0000 (17:03 -0600)]
fixup! lib/repo: Add ostree_repo_remote_get_gpg_keys()

4 years agofixup! bin/remote: Add list-gpg-keys subcommand
Dan Nicholson [Thu, 15 Jul 2021 22:25:13 +0000 (16:25 -0600)]
fixup! bin/remote: Add list-gpg-keys subcommand

4 years agofixup! lib/repo: Add ostree_repo_remote_get_gpg_keys()
Dan Nicholson [Thu, 15 Jul 2021 22:24:36 +0000 (16:24 -0600)]
fixup! lib/repo: Add ostree_repo_remote_get_gpg_keys()

4 years agobin/remote: Include update URLs in list-gpg-keys
Dan Nicholson [Mon, 26 Aug 2019 17:27:54 +0000 (11:27 -0600)]
bin/remote: Include update URLs in list-gpg-keys

4 years agolib/repo: Include WKD update URLs in GPG key listing
Dan Nicholson [Mon, 26 Aug 2019 17:15:25 +0000 (11:15 -0600)]
lib/repo: Include WKD update URLs in GPG key listing

If the key UID contains a valid email address, include the GPG WKD
update URLs in GVariant returned by ostree_repo_remote_get_gpg_keys().

4 years agolibotutil: Add helper for GPG WKD update URLs
Dan Nicholson [Tue, 27 Aug 2019 16:28:10 +0000 (10:28 -0600)]
libotutil: Add helper for GPG WKD update URLs

Calculate the advanced and direct update URLs for the key discovery
portion[1] of the OpenPGP Web Key Directory specification, and include
the URLs in the key listing in ostree_repo_remote_get_gpg_keys(). These
URLs can be used to locate updated GPG keys for the remote.

1. https://datatracker.ietf.org/doc/html/draft-koch-openpgp-webkey-service#section-3.1

4 years agolibotutil: Import implementation of zbase32 encoding
Dan Nicholson [Mon, 26 Aug 2019 16:09:57 +0000 (10:09 -0600)]
libotutil: Import implementation of zbase32 encoding

This will be used to implement the PGP Web Key Directory (WKD) URL
generation. This is a slightly cleaned up implementation[1] taken from
the zbase32 author's original implementation[2]. It provides a single
zbase32_encode API to convert a set of bytes to the zbase32 encoding.

I believe this should be acceptable for inclusion in ostree. The license
in the source files is BSD style while the original repo LICENSE file
claims the Creative Commons CC0 1.0 Universal license, which is public
domain.

1. https://github.com/dbnicholson/libbase32/tree/for-ostree
2. https://github.com/zooko/libbase32

4 years agobin/remote: Add list-gpg-keys subcommand
Dan Nicholson [Tue, 13 Aug 2019 16:10:50 +0000 (10:10 -0600)]
bin/remote: Add list-gpg-keys subcommand

This provides a wrapper for the `ostree_repo_remote_get_gpg_keys`
function to show the GPG keys associated with a remote. This is
particularly useful for validating that GPG key updates have been
applied. Tests are added, which checks the
`ostree_repo_remote_get_gpg_keys` API by extension.

4 years agolib/repo: Add ostree_repo_remote_get_gpg_keys()
Dan Nicholson [Tue, 13 Aug 2019 19:36:00 +0000 (13:36 -0600)]
lib/repo: Add ostree_repo_remote_get_gpg_keys()

This function enumerates the trusted GPG keys for a remote and returns
an array of `GVariant`s describing them. This is useful to see which
keys are collected by ostree for a particular remote. The same
information can be gathered with `gpg`. However, since ostree allows
multiple keyring locations, that's only really useful if you have
knowledge of how ostree collects GPG keyrings.

The format of the variants is documented in
`OSTREE_GPG_KEY_GVARIANT_FORMAT`. This format is primarily a copy of
selected fields within `gpgme_key_t` and its subtypes. The fields are
placed within vardicts rather than using a more efficient tuple of
concrete types. This will allow flexibility if more components of
`gpgme_key_t` are desired in the future.

4 years agolib/repo: Allow preparing GPG verifier without global keyrings
Dan Nicholson [Wed, 14 Jul 2021 17:04:59 +0000 (11:04 -0600)]
lib/repo: Allow preparing GPG verifier without global keyrings

Currently the verifier decides whether to include the global keyrings
based on whether the specified remote has its own keyring or not. Allow
callers to exclude the global keyrings even when that's not the case.
This will be used in a subsequent commit in order to get the GPG keys
only associated with a remote.

4 years agolib/repo: Factor out GPG verifier preparation
Dan Nicholson [Tue, 13 Aug 2019 16:36:11 +0000 (10:36 -0600)]
lib/repo: Factor out GPG verifier preparation

In order to use the GPG verifier, it needs to be seeded with GPG keys
after instantation. Currently this is only used for verifying data, but
it will also be used for getting a list of trusted GPG keys in a
subsequent commit.

4 years agolib/repo: Factor out GPG verifier key imports
Dan Nicholson [Fri, 26 Jul 2019 15:38:23 +0000 (09:38 -0600)]
lib/repo: Factor out GPG verifier key imports

Currently the verifier only imports all the GPG keys when verifying
data, but it would also be useful for inspecting the trusted keys.

4 years agoMerge pull request #2398 from bgilbert/statoverride
Jonathan Lebon [Wed, 14 Jul 2021 21:11:02 +0000 (17:11 -0400)]
Merge pull request #2398 from bgilbert/statoverride

man: improve statoverride description

4 years agoman: improve statoverride description
Benjamin Gilbert [Wed, 14 Jul 2021 20:07:16 +0000 (16:07 -0400)]
man: improve statoverride description

A statoverride file written in the obvious way will produce incorrect
results for two independent reasons.  Document them.

4 years agoMerge pull request #2396 from ostreedev/release-2021.3
Colin Walters [Mon, 12 Jul 2021 17:08:48 +0000 (13:08 -0400)]
Merge pull request #2396 from ostreedev/release-2021.3

Release 2021.3

4 years agoconfigure: post-release version bump
Luca BRUNO [Mon, 12 Jul 2021 08:40:14 +0000 (08:40 +0000)]
configure: post-release version bump

4 years agoRelease 2021.3
Luca BRUNO [Mon, 12 Jul 2021 08:38:38 +0000 (08:38 +0000)]
Release 2021.3

4 years agoMerge pull request #2394 from lucab/ups/workflow-release
Colin Walters [Sat, 10 Jul 2021 02:53:43 +0000 (22:53 -0400)]
Merge pull request #2394 from lucab/ups/workflow-release

ci/release-build: evaluate package_version from m4 definition

4 years agoci/release-build: evaluate package_version from m4 definition
Luca BRUNO [Fri, 9 Jul 2021 16:17:31 +0000 (16:17 +0000)]
ci/release-build: evaluate package_version from m4 definition

This fixes the ci-release-build.sh script to directly source
and evaluate 'package_version' from its m4 definition, without
requiring a fully configured source tree.

4 years agoMerge pull request #2392 from bgilbert/no-owners
Colin Walters [Fri, 2 Jul 2021 21:51:33 +0000 (17:51 -0400)]
Merge pull request #2392 from bgilbert/no-owners

OWNERS: remove

4 years agoOWNERS: remove
Benjamin Gilbert [Fri, 2 Jul 2021 21:47:33 +0000 (17:47 -0400)]
OWNERS: remove

Prow is not managing merges on this repo.

4 years agoMerge pull request #2387 from jlebon/pr/ostree-remount-rfkill
Colin Walters [Tue, 22 Jun 2021 18:38:05 +0000 (14:38 -0400)]
Merge pull request #2387 from jlebon/pr/ostree-remount-rfkill

ostree-remount: Order before systemd-rfkill.*

4 years agoMerge pull request #2382 from dbnicholson/gh-tests-configs
Jonathan Lebon [Tue, 22 Jun 2021 18:37:15 +0000 (14:37 -0400)]
Merge pull request #2382 from dbnicholson/gh-tests-configs

4 years agoostree-remount: Order before systemd-rfkill.*
Jonathan Lebon [Tue, 22 Jun 2021 15:18:48 +0000 (11:18 -0400)]
ostree-remount: Order before systemd-rfkill.*

The `systemd-rfkill.*` service falls in the category of early things
that need write access to `/var`, so we need to make sure we run before
or it might hit the read-only sysroot.

The long-term fix for this is
https://github.com/ostreedev/ostree/issues/2115.

Closes: https://github.com/coreos/fedora-coreos-tracker/issues/746
4 years agoMerge pull request #2386 from lucab/ups/commit-timestamp-env
Colin Walters [Tue, 22 Jun 2021 14:32:34 +0000 (10:32 -0400)]
Merge pull request #2386 from lucab/ups/commit-timestamp-env

lib/commit: respect SOURCE_DATE_EPOCH for commit timestamp

4 years agolib/commit: respect SOURCE_DATE_EPOCH for commit timestamp
Luca BRUNO [Tue, 22 Jun 2021 10:42:36 +0000 (10:42 +0000)]
lib/commit: respect SOURCE_DATE_EPOCH for commit timestamp

This tweaks `ostree_repo_write_commit` so that it checks for the
envinroment variable `SOURCE_DATE_EPOCH` as a way to override
the current time, which is used as the commit timestamp.

Ref: https://reproducible-builds.org/docs/source-date-epoch/
Ref: https://reproducible-builds.org/specs/source-date-epoch/

4 years agoMerge pull request #2384 from smcv/dedup-report-err
Luca Bruno [Tue, 22 Jun 2021 11:36:51 +0000 (11:36 +0000)]
Merge pull request #2384 from smcv/dedup-report-err

libtest.sh: Remove duplicate ERR trap and report_err()

4 years agolibtest.sh: Remove duplicate ERR trap and report_err()
Simon McVittie [Tue, 22 Jun 2021 09:37:39 +0000 (10:37 +0100)]
libtest.sh: Remove duplicate ERR trap and report_err()

Since #2377 was merged, this is in libtest-core.sh, which is sourced by
libtest.sh.

Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agoci: Use Debian and Ubuntu release stage tags
Dan Nicholson [Mon, 21 Jun 2021 16:56:53 +0000 (10:56 -0600)]
ci: Use Debian and Ubuntu release stage tags

Rather than use the release codename tags, use the release stage tags.
This way the configuration (theoretically) doesn't need to be updated
when new Debian and Ubuntu releases are made.

For Debian stable is used instead of buster and a testing (bullseye)
build is added. For Ubuntu, latest is used instead of focal for the
current LTS and rolling is used instead of groovy for the latest
release. This actually changes the Ubuntu build from groovy to hirsute.

4 years agoci: Update Debian and Ubuntu build dependencies
Dan Nicholson [Mon, 21 Jun 2021 17:40:07 +0000 (11:40 -0600)]
ci: Update Debian and Ubuntu build dependencies

This refreshes the build dependencies installed for the GitHub Tests
workflow based on the Build-Depends in the upstream packaging. The
handling is now more explicit about any deviations and any release
differences.

4 years agoci: Drop special handling of test-suite.log
Dan Nicholson [Mon, 21 Jun 2021 19:42:20 +0000 (13:42 -0600)]
ci: Drop special handling of test-suite.log

The automake test harness[1] already dumps the contents of
`test-suite.log` when `VERBOSE=1` is set, so we don't need to add
special handling for it.

1. https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html

4 years agoci: Disable fail-fast in GitHub Tests workflow
Dan Nicholson [Mon, 21 Jun 2021 17:55:59 +0000 (11:55 -0600)]
ci: Disable fail-fast in GitHub Tests workflow

Don't cancel all the jobs if one distro config fails. The jobs are
mostly independent, so we do want to let the others continue in case
the failure is isolated to that particular distro configuration.

4 years agoMerge pull request #2379 from dbnicholson/gh-actions-tests
Dan Nicholson [Mon, 21 Jun 2021 16:46:51 +0000 (10:46 -0600)]
Merge pull request #2379 from dbnicholson/gh-actions-tests

Replace Travis CI with GitHub Actions

4 years agoMerge pull request #2377 from smcv/libtest-core
Colin Walters [Mon, 21 Jun 2021 14:12:40 +0000 (10:12 -0400)]
Merge pull request #2377 from smcv/libtest-core

libtest-core: Add some improvements from bubblewrap

4 years agoMerge pull request #2380 from dbnicholson/no-systemd-units
Colin Walters [Sat, 19 Jun 2021 21:31:12 +0000 (17:31 -0400)]
Merge pull request #2380 from dbnicholson/no-systemd-units

Don't fail build when systemd unit path not defined

4 years agoci: So long, Travis CI
Dan Nicholson [Fri, 18 Jun 2021 21:22:39 +0000 (15:22 -0600)]
ci: So long, Travis CI

travis-ci.org stopped running builds on June 15, 2021. Since this
organization is very unlikely to switch to travis-ci.com, just drop the
setup. The new GitHub Actions tests completely replace it.

4 years agoci: Add GitHub Actions workflow for test suite
Dan Nicholson [Fri, 18 Jun 2021 17:33:56 +0000 (11:33 -0600)]
ci: Add GitHub Actions workflow for test suite

This runs the test suite in various distros. The intention is to use
this to replace the Travis CI setup since it often has rate limit
failures.

Each configuration in the matrix runs in a Docker container, installs
system dependencies and then builds and tests ostree. The scripts are
basically copy and paste of the travis ones with some of the lesser used
features pruned out.

Some differences from the travis setup:

* OS details are gathered from `/etc/os-release` instead of being passed
  in as environment variables.

* The scripts always assume the user is root and don't try to use
  `sudo`.

* The `installcheck` test has been removed since ostree doesn't actually
  use that. It could be added to run the installed tests or
  `gnome-desktop-testing-runner` could just be called directly.

There should be enough flexibility to run other distros like Fedora,
Arch or Alpine. Another option would be to use the other build scripts
in ci/.

4 years agoci: Rename GitHub Actions rust workflow metadata file
Dan Nicholson [Fri, 18 Jun 2021 17:00:16 +0000 (11:00 -0600)]
ci: Rename GitHub Actions rust workflow metadata file

This workflow is specific to using rust and not just the general test
suite.

4 years agoDon't fail build when systemd unit path not defined
Dan Nicholson [Fri, 18 Jun 2021 18:35:41 +0000 (12:35 -0600)]
Don't fail build when systemd unit path not defined

In configure the systemd unit path is optional, but in the code it's
assumed to be defined. Add an `#ifdef` that throws an error when it's
not defined like the handling of `HAVE_LIBMOUNT` below it.

4 years agoMerge pull request #2366 from pwithnall/freenode
Jonathan Lebon [Fri, 18 Jun 2021 14:27:45 +0000 (10:27 -0400)]
Merge pull request #2366 from pwithnall/freenode

docs: Change IRC channel to libera.chat from freenode

4 years agoMerge pull request #2375 from cgwalters/generator-remount
Jonathan Lebon [Fri, 18 Jun 2021 14:25:35 +0000 (10:25 -0400)]
Merge pull request #2375 from cgwalters/generator-remount

Use generator to enable ostree-remount.service and ostree-finalize-staged.path

4 years agolibtest-core: Mention bubblewrap as a user of this file
Simon McVittie [Fri, 18 Jun 2021 09:14:01 +0000 (10:14 +0100)]
libtest-core: Mention bubblewrap as a user of this file

Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agolibtest-core: Update URL of rpm-ostree
Simon McVittie [Fri, 18 Jun 2021 09:13:36 +0000 (10:13 +0100)]
libtest-core: Update URL of rpm-ostree

Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agolibtest-core: On failure, make it clearer what has happened
Simon McVittie [Sun, 18 Apr 2021 11:45:24 +0000 (12:45 +0100)]
libtest-core: On failure, make it clearer what has happened

If we fail as a result of `set -x`, It's often not completely obvious
which command failed or how. Use a trap on ERR to show the command that
failed, and its exit status.

Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agolibtest-core: Add assert_files_equal
Alexander Larsson [Tue, 26 Nov 2019 08:25:15 +0000 (09:25 +0100)]
libtest-core: Add assert_files_equal

[Originally from bubblewrap commits c5c999a7 "tests: test --userns"
and 3e5fe1bf "tests: Better error message if assert_files_equal fails";
separated into this commit by Simon McVittie.]

4 years agoUse generator to enable ostree-remount.service and ostree-finalize-staged.path
Colin Walters [Wed, 16 Jun 2021 13:26:24 +0000 (09:26 -0400)]
Use generator to enable ostree-remount.service and ostree-finalize-staged.path

We struggled for a long time with enablement of our "internal units",
trying to follow the philosophy that units should only be enabled
by explicit preset.

See https://bugzilla.redhat.com/show_bug.cgi?id=1451458
and https://github.com/coreos/rpm-ostree/pull/1482
etc.

And I just saw chat (RH internal on a proprietary system sadly) where
someone hit `ostree-remount.service` not being enabled in CentOS8.

Thinking about this more, I realized we've shipped a systemd generator
for a long time and while its only role until now was to generate `var.mount`,
but by using it to force on our internal units, we don't require
people to deal with presets anymore.

Basically we're inverting things so that "if ostree= is on the kernel
cmdline, then enable our units" and not "enable our units, but have
them use ConditionKernelCmdline=ostree to skip".

Drop the weird gyrations we were doing around `ostree-finalize-staged.path`
too; forking `systemctl start` is just asking for bugs.

So after this, hopefully we won't ever again have to think about
distribution presets and our units.

4 years agoMerge pull request #2374 from gicmo/small_typo
Dan Nicholson [Tue, 15 Jun 2021 22:16:19 +0000 (16:16 -0600)]
Merge pull request #2374 from gicmo/small_typo

Fix small typo in ostree-sysroot.c