Commit Graph

4527 Commits

Author SHA1 Message Date
Colin Walters 0b6ac72b7f main/pin: Fix usage of GError
This regressed in 2db79fb398
I noticed this while finally getting the installed tests to run
in FCOS via kola and `ostree admin pin 0` is now aborting because
we were returning TRUE, but no error set.

I don't see a reason to try to continue on if we hit an error;
the original reporter was requesting support for multiple arguments,
but not "ignore invalid requests".
2020-03-18 02:15:34 +00:00
OpenShift Merge Robot 35c8fd3722
Merge pull request #2030 from jlebon/pr/2020.3
Release 2020.3
2020-03-14 16:17:21 +01:00
Jonathan Lebon 8f2c240326 Post-release version bump 2020-03-13 21:59:35 -04:00
Jonathan Lebon 6ed48234ba Release 2020.3
Let's do another release to get the `sysroot.readonly` fixes into FCOS
and unpin ostree and rpm-ostree there.
2020-03-13 21:59:05 -04:00
OpenShift Merge Robot 5164dcbe78
Merge pull request #2027 from cgwalters/pull-auto-mnt-namespace
main: Also automatically remount rw /sysroot for `ostree pull` etc.
2020-03-14 02:52:43 +01:00
Colin Walters 6a27dff941 main: Also automatically remount rw /sysroot for `ostree pull` etc.
See https://github.com/coreos/fedora-coreos-tracker/issues/343
When we added the read-only sysroot support it broke using "raw"
`ostree pull` and `ostree refs --create` and all of the core repo
CLIs that just operate on a repo and not a sysroot.

Fixing this is a bit ugly as it "layer crosses" things even more.
Extract a helper function that works in both cases.
2020-03-13 20:53:26 +00:00
OpenShift Merge Robot 2d901957b8
Merge pull request #2029 from jlebon/pr/upgrade-tests
ci: use `fcosKola` for running kola tests
2020-03-13 21:53:04 +01:00
Jonathan Lebon cbb3f0a8c2 ci: use `fcosKola` for running kola tests
We were using `--no-test-exit-error` for upgrade tests but weren't
actually checking for test failures after.

Instead of running kola directly, just use the `fcosKola` custom step
which automatically takes care of e.g. running tests in parallel and
archiving results.
2020-03-13 14:35:53 -04:00
OpenShift Merge Robot 94ccbcca5e
Merge pull request #2028 from cgwalters/ci-test-upgrades
ci: Test kola --upgrades
2020-03-13 19:18:40 +01:00
Colin Walters 0302262e2f ci: Test kola --upgrades
This one is very relevant for ostree.
2020-03-13 17:29:58 +00:00
OpenShift Merge Robot 26a2be0578
Merge pull request #2018 from jlebon/pr/migrate-to-coreos-ci
ci: migrate to new coreos-ci project
2020-03-04 17:32:56 -05:00
Jonathan Lebon 24691c509c ci: migrate to new coreos-ci project
Use the new custom steps. I think we could simplify things further by
using `fcosBuild` but let's start with this for now.
2020-03-02 14:22:33 -05:00
OpenShift Merge Robot acd3b24fd1
Merge pull request #2015 from cgwalters/release
Release 2020.2
2020-02-21 10:16:50 -05:00
Colin Walters 6bedfcfdc3 Post-release version bump 2020-02-21 14:48:00 +00:00
Colin Walters c6085ebd5e Release 2020.2
"Brown paper bag" release that actually sets the
`is_release_build=yes` flag and also fixes the
`Since:` on a few new functions.
2020-02-21 14:45:49 +00:00
OpenShift Merge Robot 73742252e2
Merge pull request #2014 from ostreedev/fixup-since-versions
lib: Fix Since versions for 2020.1
2020-02-20 18:27:28 -05:00
Dan Nicholson 3557e4e165 lib: Fix Since versions for 2020.1
These had been added assuming 2019.7 would be the next version, but now
it's 2020 and there's been a release. In the case of
`OstreeCommitSizesEntry`, I'd forgotten to move it forward from 2019.5
to 2019.7 in the time between when I started working on the feature and
it landed.
2020-02-20 15:47:41 -07:00
OpenShift Merge Robot b39c03ab97
Merge pull request #2013 from cgwalters/prepareroot-comment
prepare-root: Add a comment about the role of this service
2020-02-20 18:30:05 +01:00
Colin Walters 7db7cfc407 Post-release version bump 2020-02-20 16:37:07 +00:00
Colin Walters 04c85fa101 Release 2020.1
New year, new release!
2020-02-20 16:35:47 +00:00
OpenShift Merge Robot 010e6c38bc
Merge pull request #1984 from jlebon/pr/supp-groups
lib/repo: Create repo directories as 0775
2020-02-20 03:07:41 +01:00
Colin Walters d5bfbc6715 prepare-root: Add a comment about the role of this service
Came up on an IRC question, docs for this are scattered around.
2020-02-20 00:35:32 +00:00
OpenShift Merge Robot 9eb4506c1b
Merge pull request #2012 from clime/patch-2
Update ostree-pull.xml with info about pulled refs location and access
2020-02-19 20:32:23 +01:00
clime 8e65366ffd Update ostree-pull.xml with info about pulled refs location and access 2020-02-19 20:12:23 +01:00
Jonathan Lebon 7085a50297 lib/repo: Create repo directories as 0775
For repo structure directories like `objects`, `refs`, etc... we should
be more permissive and let the system's `umask` narrow down the
permission bits as wanted.

This came up in a context where we want to be able to have read/write
access on an OSTree repo on NFS from two separate OpenShift apps by
using supplemental groups[1] so we don't require SCCs for running as the
same UID (supplemental groups are part of the default restricted SCC).

[1] https://docs.openshift.com/container-platform/3.11/install_config/persistent_storage/persistent_storage_nfs.html#nfs-supplemental-groups
2020-02-18 11:26:46 -05:00
OpenShift Merge Robot 13666dcd50
Merge pull request #2009 from cgwalters/testsuite
deploy: Avoid trying to change immutable state unnecessarily
2020-02-14 22:56:25 +01:00
Colin Walters 0dd8dec2c9 deploy: Avoid trying to change immutable state unnecessarily
For some reason I haven't fully debugged (probably a recent
kernel change), in the case where the immutable bit isn't set,
trying to call `EXT2_IOC_SETFLAGS` without it set returns `EINVAL`.

Let's avoid calling the `ioctl()` if we don't have anything to do.

This fixes a slew of `make check` failures here in my toolbox
environment.

(kernel is `5.5.0-0.rc6.git0.1.fc32.x86_64` with `xfs`)
2020-02-14 16:37:38 +00:00
OpenShift Merge Robot 7b28d01cd5
Merge pull request #2003 from crobinso/doc-link-fix
docs: Fix 'package layering' rpm-ostree link
2020-02-10 20:28:40 +01:00
Cole Robinson 4b644bc671 docs: Fix 'package layering' rpm-ostree link
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-10 14:00:11 -05:00
OpenShift Merge Robot 793b478879
Merge pull request #1999 from cgwalters/cci-2
ci: Replace PAPR with CoreOS CI
2020-02-07 15:08:05 +01:00
Colin Walters 6d104f6257 ci: Replace PAPR with CoreOS CI
Move the alternative builds into the Jenkinsfile.

Update it to do a FCOS build + kola run.

We drop the flatpak/rpm-ostree runs for now; the former
will needs some work to do the automatic virt bits.  The
latter I think we can circle back to when we e.g. figure
out how to include rpm-ostree's tests in kola runs.
2020-02-06 23:14:42 +00:00
OpenShift Merge Robot bdf83e68d3
Merge pull request #2000 from cgwalters/soup-travis
travis: Update debian/ubuntu environments
2020-02-03 13:56:55 -08:00
Colin Walters 5a5c1e5b65 travis: Update debian/ubuntu environments
There are new major LTS environments out; bump up to the latest
for each and drop the old Ubuntu trusty.  Part of cleaning up
our CI.
2020-02-03 21:03:47 +00:00
OpenShift Merge Robot 6b9282fa45
Merge pull request #1998 from cgwalters/cci-jenkinsfile
Add .cci.jenkinsfile
2020-02-03 10:42:55 -08:00
Colin Walters 7febd9d36e Add .cci.jenkinsfile
See https://github.com/jlebon/coreos-ci

This is just a start to test, cut down from the rpm-ostree version.
2020-02-03 16:57:24 +00:00
OpenShift Merge Robot 96fb1decf4
Merge pull request #1959 from cgwalters/ostree-verity
Initial fs-verity support
2020-01-28 13:01:40 -08:00
OpenShift Merge Robot 8a9a496501
Merge pull request #1957 from dbnicholson/commit-sizes
Upstream Endless sizes metadata changes
2020-01-27 08:25:59 -08:00
Colin Walters 58fa579b1b Initial fs-verity support
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

Also, what we likely need is an API that supports signing files
as they're committed.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also https://github.com/coreos/coreos-assembler/pull/876
2020-01-27 15:44:16 +00:00
OpenShift Merge Robot 08e292bc14
Merge pull request #1877 from dbnicholson/specific-gpg-errors
More specific GPG errors
2020-01-26 09:20:51 -08:00
OpenShift Merge Robot 570de2989c
Merge pull request #1996 from akiernan/us-with-systemd
build: fix systemd feature advertisement
2020-01-26 04:19:31 -08:00
Alex Kiernan 562b60022b build: fix systemd feature advertisement
17db0f15a7 ("configure: add option for libsystemd") exposed
--without-libsystemd to allow systemd to be disabled even if the systemd
pkgconfig script was present, introducing a new variable
with_libsystemd; there are now three, almost identical variables:

- with_libsystemd [yes, no, maybe] - controlled by --without-libsystemd,
  resolved into yes/no by the initial checks
- have_libsystemd [yes, no, <undefined>] - only set if with_libsystemd
  is yes/maybe, otherwise undefined
- with_systemd [yes, <undefined>] - yes if have_systemd is yes,
  otherwise undefined

with_systemd is the earliest variable and was previously set by a set of
checks for dracut and mkinitcpio. These checks were changed for a
systemd check in 9e2763106b ("lib: Use sd_journal directly
(optionally)"). This commit also introduced BUILDOPT_LIBSYSTEMD, which
will always match BUILDOPT_SYSTEMD.

Fix the confusion by removing with_systemd which will always be yes when
with_libsystemd=yes, or undefined if with_libsystemd=no. We can ignore
the with_libsystemd=maybe case because it will always be resolved into
yes/no before with_systemd is set.

And replace all uses of BUILDOPT_SYSTEMD with BUILDOPT_LIBSYSTEMD, since
they again always match.

This fixes both the advertised features and the summary output when
systemd is disabled by using with_libsystemd which is always defined.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Fixes: 5c62a7e4d0 ("build: Expose systemd in OSTREE_FEATURES")
Fixes: 17db0f15a7 ("configure: add option for libsystemd")
Supersedes: #1992
2020-01-25 13:12:41 +00:00
OpenShift Merge Robot c97bdd6d28
Merge pull request #1948 from dbnicholson/trivial-httpd-autoexit
ostree/trivial-httpd: Fix --autoexit with --daemonize and --log-file
2020-01-24 12:42:59 -08:00
Dan Nicholson 11ad68647a ostree/trivial-httpd: Add log message for autoexit
This is useful when checking if the daemon actually exited since we
don't store the child PID anywhere.
2020-01-24 13:11:54 -07:00
Dan Nicholson fbf5a94e0a ostree/trivial-httpd: Fix --autoexit with --daemonize and --log-file
When --autoexit is used with --daemonize and --log-file, the program
never exits when the root directory is deleted. I believe what happens
is that g_file_new_for_path triggers the glib worker context to be
started to talk to GVfs. Once the program forks, the parent exits and
the thread iterating the worker context is gone. The file monitor then
never receives any events because the inotify helper also runs from the
worker context.

Move the fork earlier just after parsing and validating the command line
arguments. In order to handle setup errors in the child, a pipe is
opened and the parents waits until the child writes a status byte to it.
If the byte is 0, the parent considers the child setup successful and
exits and the child carries on as a daemon. Notably, the child doesn't
reopen stderr to /dev/null until after this so that it can send error
messages there.

Fixes: #1941
2020-01-24 13:11:54 -07:00
Dan Nicholson 68a11d4eeb ci/flatpak: Patch GPG error assertions from OSTree
Some of the flatpak tests assert on GPG error strings that come from
OSTree. Those are being changed here, so patch the cloned flatpak 1.4.1
to accommodate the new error strings. When this work lands, I'll send a
patch upstream to flatpak that will eventually trickle back here in a
tagged build.
2020-01-24 13:03:30 -07:00
Dan Nicholson b81a6b4ab2 tests/gpg: Add tests for importing updated remote GPG keys
This checks whether gpg-import will properly update the keyring for a
key that already exists. In particular, we check that changing the key
expiration time or revoking it results in commit verification failure
after re-importing the keys.
2020-01-24 13:02:17 -07:00
Dan Nicholson 01da2371c5 tests/gpg: Test ostree_gpg_verify_result_require_valid_signature
Add explicit tests for
`ostree_gpg_verify_result_require_valid_signature` in addition to the
implicit tests via `ostree pull` and others. This allows checking the
error code raised.
2020-01-24 13:02:17 -07:00
Dan Nicholson 0fbfc0b207 lib/gpg: Add more specific OstreeGpgError codes
Currently `ostree_gpg_verify_result_require_valid_signature` always
returns an error that the key used for the signature is missing from the
keyring. However, all that's been determined is that there are no valid
signatures. The error could also be from an expired signature, an
expired key, a revoked key or an invalid signature.

Provide values for these missing errors and return them from
`ostree_gpg_verify_result_require_valid_signature`. The description of
each result is appended to the error message, but since the result can
contain more than one signature but only a single error can be returned,
the status of the last signature is used for the error code. See the
comment for rationale.

Related: flatpak/flatpak#1450
2020-01-24 13:02:17 -07:00
Dan Nicholson 2c24f28ce4 tests/test-gpg-verify-result: Allow specifying signature files
Currently tests are always run against the full lgpl2.sig file with all
signatures, but it should also be possible to specify one or more of the
individual lgpgl2.sig<N> files.

Drop the current usage of passing the signature index in the test data
since it's always specific to the test function and instead provide an
optional array of signature files for the test fixture to sign with.
2020-01-24 13:02:09 -07:00
Dan Nicholson b786d1b4bc tests/gpg-verify-data: Empty out trustdb.gpg
When the private keys were generated, gpg added an ultimate trust entry
since you normally want to trust your own keys. However, this throws off
the expired signature testing since gpgme considers it valid if the key
is fully or ultimately trusted.

The use of a trustdb for the test-gpg-verify-result is unlike any other
GPG verification in ostree. Under normal circumstances, a temporary GPG
homedir is created without any trust information, so all keys are
treated as having unknown trust.

Regenerate an empty trustdb.gpg in gpg-verify-data so that the tests
behave as ostree normally operates. After this the expired signature
testing correctly shows up as a non-valid signature. The trustdb was
regenerated by simply removing it and running any gpg operation with the
gpg-verify-data directory as the homedir.
2020-01-24 13:02:09 -07:00