ostree.git
5 years agolib/pull: Read mode and tombstone options from summary file if possible
Philip Withnall [Mon, 10 Aug 2020 11:06:35 +0000 (12:06 +0100)]
lib/pull: Read mode and tombstone options from summary file if possible

Otherwise, fall back to downloading and reading them from the `config`
file. See the previous commit for details.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #2165
5 years agolib/repo: Add mode and tombstone config options to the summary file
Philip Withnall [Mon, 10 Aug 2020 11:05:06 +0000 (12:05 +0100)]
lib/repo: Add mode and tombstone config options to the summary file

Currently, they are set in the `config` file and cause that to be
downloaded on every pull. Given that the client is already pulling the
`summary` file, it makes sense to avoid an additional network round trip
and cache those options in the `summary` file.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #2165

5 years agoMerge pull request #2204 from jlebon/pr/versioning-tweaks
OpenShift Merge Robot [Wed, 30 Sep 2020 17:22:49 +0000 (17:22 +0000)]
Merge pull request #2204 from jlebon/pr/versioning-tweaks

Various minor versioning related tweaks

5 years agolib: Minor versioning related fixes
Jonathan Lebon [Fri, 25 Sep 2020 19:01:09 +0000 (15:01 -0400)]
lib: Minor versioning related fixes

Fix/add the `Since` marker to the new static delta APIs, and update the
symbol versioning templates/comments.

5 years agoMakefile-libostree.am: Uncomment BUILDOPT_IS_DEVEL_BUILD conditional
Jonathan Lebon [Fri, 25 Sep 2020 18:59:45 +0000 (14:59 -0400)]
Makefile-libostree.am: Uncomment BUILDOPT_IS_DEVEL_BUILD conditional

We shouldn't have to toggle the conditional itself during release
builds. It should only evaluate to true during devel builds.

5 years agoMerge pull request #2203 from cgwalters/delta-sign-cleanups
OpenShift Merge Robot [Fri, 25 Sep 2020 13:57:33 +0000 (13:57 +0000)]
Merge pull request #2203 from cgwalters/delta-sign-cleanups

delta: Some minor code style fixups

5 years agoMerge pull request #2202 from cgwalters/bootcsum-dtb
OpenShift Merge Robot [Thu, 24 Sep 2020 22:14:31 +0000 (22:14 +0000)]
Merge pull request #2202 from cgwalters/bootcsum-dtb

 deploy: Remove deployment bootcsum assertion

5 years agodelta: Some minor code style fixups
Colin Walters [Thu, 24 Sep 2020 22:12:23 +0000 (22:12 +0000)]
delta: Some minor code style fixups

- Remove some unused variables
- Switch to declare-and-initialize with others
- Fix some indentation from 4 spaces to 2 (GNU style)

5 years agodeploy: Remove deployment bootcsum assertion
Colin Walters [Thu, 24 Sep 2020 19:28:31 +0000 (19:28 +0000)]
deploy: Remove deployment bootcsum assertion

When support for devicetree was added, it created a problem
because old and new ostree versions would compute different
checksums for the "boot data".  The scenario here is:

- Have system with ostree < 2020.4
- Reboot into system with ostree 2020.5
- Try to perform an operation that would retain
  that previous booted deployment (common)

Currently ostree iterates over all the deployments
that will be retained and calls `install_deployment_kernel()`,
even for the booted one (which is a bit silly), but
just to verify that all boot data for the targeted
deployments are installed.

This then re-computes the checksum and we'd trip this
assertion.

In practice though, we don't strictly require them to match;
the only thing that will happen if they don't is that we'll
end up with another copy of the kernel/initramfs - and
that only temporarily until the previous deployment
gets GC'd.

Longer term, I think what we really want to do anyways
is probably closer to like a little ostree repo for `/boot`
so that we can e.g. still hardlink kernels there even if
the initramfs changes, or hardlink both kernel/initramfs
if just the devicetree changes, etc.

Closes: https://github.com/ostreedev/ostree/issues/2154
5 years agoMerge pull request #1985 from fdanis-oss/wip/fda/sign_delta_metadata
OpenShift Merge Robot [Thu, 24 Sep 2020 14:21:16 +0000 (14:21 +0000)]
Merge pull request #1985 from fdanis-oss/wip/fda/sign_delta_metadata

Static-delta's superblock signature support

5 years agoMerge pull request #2199 from cgwalters/no-hardlink-unreadable
OpenShift Merge Robot [Wed, 16 Sep 2020 15:58:55 +0000 (17:58 +0200)]
Merge pull request #2199 from cgwalters/no-hardlink-unreadable

checkout: Ensure copies of unreadable usermode checkouts are readable

5 years agocheckout: Ensure copies of unreadable usermode checkouts are readable
Colin Walters [Wed, 16 Sep 2020 13:23:04 +0000 (13:23 +0000)]
checkout: Ensure copies of unreadable usermode checkouts are readable

The extreme special case of "zero mode" files like `/etc/shadow`
comes up again.  What we want is for "user mode" checkouts to
override it to make the file readable; otherwise when operating
as non-root without `CAP_DAC_OVERRIDE` it becomes very difficult
to work with.

Previously, we were hardlinking these files, but then it intersects
with *another* special case around zero sized files, which is
*also* true for `/etc/shadow`.

Trying to avoid hardlinking there unveiled this bug - when
we go to do a copy checkout, we need to override the mode.

5 years agoMerge pull request #2195 from ostreedev/avoid-shadows
OpenShift Merge Robot [Mon, 14 Sep 2020 14:43:40 +0000 (10:43 -0400)]
Merge pull request #2195 from ostreedev/avoid-shadows

Avoid shadowing local variables

5 years agotests/delta: Add new tests for applying signed deltas
Frédéric Danis [Fri, 21 Aug 2020 15:24:49 +0000 (17:24 +0200)]
tests/delta: Add new tests for applying signed deltas

Add new test to apply offline signed deltas.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agobin/static-delta: Add signature parameters to apply-offline
Frédéric Danis [Fri, 21 Aug 2020 15:22:40 +0000 (17:22 +0200)]
bin/static-delta: Add signature parameters to apply-offline

This allows to check the delta signature before applying it.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agolib/deltas: Check signed delta in execute_offline
Frédéric Danis [Tue, 25 Aug 2020 07:26:09 +0000 (09:26 +0200)]
lib/deltas: Check signed delta in execute_offline

Add a new function `ostree_repo_static_delta_execute_offline_with_signature`
which takes a signature engine to verify the delta before applying it.
The `ostree_repo_static_delta_execute_offline` is just a wrapper to this
new function, passing a NULL signature engine.
When this function is called without signature engine, but with a sign
delta, it will only fails if `sign-verify-deltas` is set to true in repo
core options.

This commits move signature existence check and delta signature
verification to share common parts between existing APIs and the new
function.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agotests/delta: new tests for 'ed25519' signed deltas
Frédéric Danis [Tue, 3 Dec 2019 10:15:51 +0000 (11:15 +0100)]
tests/delta: new tests for 'ed25519' signed deltas

Add tests to generate signed deltas and verify them using 'ed25519'
signature engine.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agotests/libtest.sh: Add skip_without_sign_ed25519() function
Frédéric Danis [Thu, 23 Apr 2020 13:24:53 +0000 (15:24 +0200)]
tests/libtest.sh: Add skip_without_sign_ed25519() function

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agotests/delta: new tests for signed deltas
Frédéric Danis [Fri, 29 Nov 2019 15:17:17 +0000 (16:17 +0100)]
tests/delta: new tests for signed deltas

Add tests to generate signed deltas and verify them using 'dummy'
signature engine.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agolib/deltas: Support signed delta in dump
Frédéric Danis [Thu, 9 Jul 2020 15:35:00 +0000 (17:35 +0200)]
lib/deltas: Support signed delta in dump

This checks if the static delta file is signed or not to be able to
correctly get the superblock to dump.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agolib/deltas: Support signed delta in execute_offline
Frédéric Danis [Thu, 9 Jul 2020 15:34:08 +0000 (17:34 +0200)]
lib/deltas: Support signed delta in execute_offline

This checks if the static delta file is signed or not to be able to
correctly get the superblock to apply.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agobin/static-delta: Add command to verify delta signature
Frédéric Danis [Fri, 29 Nov 2019 11:40:11 +0000 (12:40 +0100)]
bin/static-delta: Add command to verify delta signature

Add new "static-delta verify" sub-command.
This supports multiple keys to verify the static-delta file.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agolib/deltas: Add signature check API for static-delta superblock
Frédéric Danis [Thu, 28 Nov 2019 11:18:59 +0000 (12:18 +0100)]
lib/deltas: Add signature check API for static-delta superblock

This retrieves the signatures and pass the static delta block as an array
of bytes to ostree_sign_data_verify().

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agobin/static-delta: Add support to sign superblock
Frédéric Danis [Tue, 26 Nov 2019 10:20:10 +0000 (11:20 +0100)]
bin/static-delta: Add support to sign superblock

Add signing ability to "static-delta generate" builtin.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agolib/deltas: Add inline signature for static-delta superblock
Frédéric Danis [Wed, 8 Jul 2020 10:15:15 +0000 (12:15 +0200)]
lib/deltas: Add inline signature for static-delta superblock

While the commits contained in the single static-delta file are signed so
we can check them and operate on trusted data, the superblock isn't signed
in any way, so it end up operating on untrusted data to:
 1. actually find where the trusted data is, and
 2. check whether the update is fit for the current device by looking at
    the collection id stored in the metadata

This commit generates signatures of all static data, and concatenate them
to the existing static delta format, i.e. as a GVariant layout `a{sv}ay`
where
 - a{sv}: signatures
 - ay: existing delta variant

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
5 years agoAvoid shadowing local variables
Phaedrus Leeds [Sat, 12 Sep 2020 21:51:40 +0000 (14:51 -0700)]
Avoid shadowing local variables

This should help with code readability.

Fixes https://github.com/ostreedev/ostree/issues/2194

5 years agoMerge pull request #2196 from cgwalters/commit-shadowing-fix
OpenShift Merge Robot [Sun, 13 Sep 2020 17:00:16 +0000 (13:00 -0400)]
Merge pull request #2196 from cgwalters/commit-shadowing-fix

commit: Tighten scope of two variables

5 years agocommit: Tighten scope of two variables
Colin Walters [Sun, 13 Sep 2020 14:56:06 +0000 (14:56 +0000)]
commit: Tighten scope of two variables

Prep for adding `-Wshadow` fixes.

5 years agoMerge pull request #2193 from alexlarsson/preparatory-cleanup
OpenShift Merge Robot [Fri, 11 Sep 2020 15:07:00 +0000 (11:07 -0400)]
Merge pull request #2193 from alexlarsson/preparatory-cleanup

Preparatory cleanup for summary work

5 years agoUpdate the symbols files to match that we're now on 2020.6
Alexander Larsson [Fri, 11 Sep 2020 10:14:05 +0000 (12:14 +0200)]
Update the symbols files to match that we're now on 2020.6

5 years agoostree-repo-pull.c: Extract mirrorlist generation to helper
Alexander Larsson [Thu, 10 Sep 2020 09:58:38 +0000 (11:58 +0200)]
ostree-repo-pull.c: Extract mirrorlist generation to helper

This code was duplicated in 3 places, so move it to a single place
to clean things up.

5 years agoMinor cleanup of _ostree_repo_remote_new_fetcher()
Alexander Larsson [Thu, 10 Sep 2020 09:34:31 +0000 (11:34 +0200)]
Minor cleanup of _ostree_repo_remote_new_fetcher()

Instead of open coding the extra_headers and append_user_agent
setting everywhere we do this in the constructor.

5 years agoInline repo_remote_fetch_summary
Alexander Larsson [Thu, 10 Sep 2020 09:26:06 +0000 (11:26 +0200)]
Inline repo_remote_fetch_summary

This was only used in one place, and (especially with the simplification
with GMainContextPopDefault) and the one caller doesn't really do
much more than call the helper. Additionally, what little it does (saving
the result in the cache) is inherently tied to how the helper work,
and will become even more so when we support summary indexes.

This is a preparatory cleanup for supporting summary indexes. It
doesn't change any behaviour and passes make check on its own.

5 years agorepo_remote_fetch_summary: Use GMainContextPopDefault
Alexander Larsson [Thu, 10 Sep 2020 09:10:01 +0000 (11:10 +0200)]
repo_remote_fetch_summary: Use GMainContextPopDefault

This allows us to drop the "goto out" use and clean up this function.

5 years agoAdd g_autoptr helper for pushing a thread default main context
Alexander Larsson [Thu, 10 Sep 2020 09:00:35 +0000 (11:00 +0200)]
Add g_autoptr helper for pushing a thread default main context

This happens in a bunch of places, and currently each time it does
we have to use "goto out" style cleanups, which just isn't looking
very nice.

5 years agofetch_summary_with_options: drop unnecessary "goto out" use
Alexander Larsson [Thu, 10 Sep 2020 09:03:14 +0000 (11:03 +0200)]
fetch_summary_with_options: drop unnecessary "goto out" use

5 years agoBreak out the signature verification code into a helper function
Alexander Larsson [Thu, 10 Sep 2020 08:59:44 +0000 (10:59 +0200)]
Break out the signature verification code into a helper function

This changes nothing in the behaviour, but we want to later re-use
this when we also verify the summary index.

5 years agodeltas: Break out _ostree_repo_static_delta_superblock_digest() helper
Alexander Larsson [Mon, 31 Aug 2020 15:21:43 +0000 (17:21 +0200)]
deltas: Break out _ostree_repo_static_delta_superblock_digest() helper

This loads and makes a digest for a delta superblock. The previous
code was used when generating the deltas section in the summary
file. This changes nothing, but is in preparation for using similar
formats in a separate delta index file.

5 years agoAdd and use ot_checksum_bytes helper
Alexander Larsson [Thu, 10 Sep 2020 12:29:47 +0000 (14:29 +0200)]
Add and use ot_checksum_bytes helper

This removes some duplicated code (and will be use even more later).

5 years agopull: Actually mmap summary files
Alexander Larsson [Fri, 11 Sep 2020 09:24:43 +0000 (11:24 +0200)]
pull: Actually mmap summary files

The change in cbf1aca1d5c08d2f40832d16670484ba878d95fb actually
only mmaps the signature file, not the summary. This change makes
use mmap both, as well as extract the cache loading into a helper
function that we will later use in more places.

5 years agopull: Break out _ostree_repo_save_cache_summary_file() helper
Alexander Larsson [Fri, 11 Sep 2020 09:22:49 +0000 (11:22 +0200)]
pull: Break out _ostree_repo_save_cache_summary_file() helper

This is a minor cleanup as its just called twice from
_ostree_repo_cache_summary(). However, later code will need it in more
places.

5 years agoFix leak when signing
Alexander Larsson [Tue, 8 Sep 2020 09:37:33 +0000 (11:37 +0200)]
Fix leak when signing

_ostree_detached_metadata_append_gpg_sig() was returning a floating
ref, but all users were using g_autoptr. Fix it by adding a ref-sink.

5 years agolist-deltas: Don't break on non-subdir entries
Alexander Larsson [Mon, 31 Aug 2020 15:00:39 +0000 (17:00 +0200)]
list-deltas: Don't break on non-subdir entries

ostree_repo_list_static_delta_names() tried to validate that
any second-level directory element was a directory, but there was
a cut-and-paste issue, and it used `dent->d_type` instead
of `sub_dent->d_type`.

This fixes the code, but all old ostree versions will break if
there are non-directories in a subdirectory of the deltas directory
in the repo, so be wary.

5 years agoMerge pull request #2192 from cgwalters/error-prefixing
OpenShift Merge Robot [Wed, 9 Sep 2020 13:25:12 +0000 (09:25 -0400)]
Merge pull request #2192 from cgwalters/error-prefixing

deploy: Add some error prefixing around xattr setting

5 years agodeploy: Add some error prefixing around xattr setting
Colin Walters [Wed, 9 Sep 2020 12:34:44 +0000 (12:34 +0000)]
deploy: Add some error prefixing around xattr setting

Looking at
https://github.com/coreos/coreos-assembler/issues/1703
a user is getting a bare:
`error: fsetxattr: Permission denied`

I don't think it's these code paths since a deploy
isn't happening but on inspection I noticed we didn't
have error prefixing here.

5 years agoMerge pull request #2190 from cgwalters/ci-drop-var-test
OpenShift Merge Robot [Mon, 7 Sep 2020 23:26:02 +0000 (19:26 -0400)]
Merge pull request #2190 from cgwalters/ci-drop-var-test

ci: Drop var mount test

5 years agoci: Drop var mount test
Colin Walters [Thu, 3 Sep 2020 22:14:02 +0000 (22:14 +0000)]
ci: Drop var mount test

Merged in https://github.com/coreos/fedora-coreos-config/pull/586

5 years agoMerge pull request #2189 from cgwalters/release
OpenShift Merge Robot [Thu, 3 Sep 2020 18:41:11 +0000 (14:41 -0400)]
Merge pull request #2189 from cgwalters/release

Release 2020.6

5 years agoPost-release version bump
Colin Walters [Thu, 3 Sep 2020 18:00:27 +0000 (18:00 +0000)]
Post-release version bump

5 years agoRelease 2020.6
Colin Walters [Thu, 3 Sep 2020 18:00:03 +0000 (18:00 +0000)]
Release 2020.6

Let's get the /var mount fix out at least.

5 years agoMerge pull request #2186 from jlebon/pr/etc-rw
OpenShift Merge Robot [Fri, 28 Aug 2020 18:52:24 +0000 (14:52 -0400)]
Merge pull request #2186 from jlebon/pr/etc-rw

Fix read-only /etc when using sysroot=readonly and a separate /var mount

5 years agoci: Temporarily import kola test from jlebon's FCOS fork
Jonathan Lebon [Fri, 28 Aug 2020 16:49:32 +0000 (12:49 -0400)]
ci: Temporarily import kola test from jlebon's FCOS fork

That test will not make it into the fedora-coreos-config repo until the
libostree fix gets percolated down. PR is:

https://github.com/coreos/fedora-coreos-config/pull/586

But we want to make sure that the fix does work and that we don't
regress on it. So manually fetch it for now.

5 years agoostree-remount: Remount /etc rw if needed
Jonathan Lebon [Fri, 28 Aug 2020 16:35:29 +0000 (12:35 -0400)]
ostree-remount: Remount /etc rw if needed

When we remount `/sysroot` as read-only, we also make `/etc` read-only.
This is usually OK because we then remount `/var` read-write, which also
flips `/etc` back to read-write... unless `/var` is a separate
filesystem and not a bind-mount to the stateroot `/var`.

Fix this by just remounting `/etc` read-write in the read-only sysroot
case.

Eventually, I think we should rework this to set everything up the way
we want from the initramfs (#2115). This would also eliminate the window
during which `/etc` is read-only while `ostree-remount` runs.

5 years agoostree-prepare-root: Fix /etc bind mount
Jonathan Lebon [Fri, 28 Aug 2020 16:35:28 +0000 (12:35 -0400)]
ostree-prepare-root: Fix /etc bind mount

We were bind-mounting the initramfs' `/etc` (to itself) instead of the
target deployment `/etc` (to itself). Since we're already `chdir`'ed
into it, we can just drop the leading slash.

5 years agoMerge pull request #2184 from fkrull/docs-tags-fixes
OpenShift Merge Robot [Wed, 26 Aug 2020 21:45:28 +0000 (17:45 -0400)]
Merge pull request #2184 from fkrull/docs-tags-fixes

Add some missing GI tags

5 years agolib: mark out parameters as out parameters
Felix Krull [Tue, 25 Aug 2020 18:43:01 +0000 (20:43 +0200)]
lib: mark out parameters as out parameters

5 years agolib: add some missing version tags
Felix Krull [Tue, 25 Aug 2020 17:57:27 +0000 (19:57 +0200)]
lib: add some missing version tags

5 years agoMerge pull request #2183 from cgwalters/sh-inline-crates
OpenShift Merge Robot [Wed, 26 Aug 2020 19:04:24 +0000 (15:04 -0400)]
Merge pull request #2183 from cgwalters/sh-inline-crates

tests/inst: Update to published sh-inline crate

5 years agotests/inst: Update to published sh-inline crate
Colin Walters [Wed, 26 Aug 2020 17:00:19 +0000 (17:00 +0000)]
tests/inst: Update to published sh-inline crate

And I made a few more API tweaks, such as supporting `Path`
objects directly and also not needing e.g. `commit = commit`, see

- https://github.com/cgwalters/rust-sh-inline/commit/cfa7c71126f23545a7d4782cad650eab60e74204
- https://github.com/cgwalters/rust-sh-inline/commit/679bce4cc7ce65641e0c9bd33654510575583de8

5 years agoMerge pull request #2181 from cgwalters/port-sh-inline
OpenShift Merge Robot [Wed, 26 Aug 2020 15:01:52 +0000 (11:01 -0400)]
Merge pull request #2181 from cgwalters/port-sh-inline

tests/inst: Port to new sh-inline repo

5 years agoMerge pull request #2182 from mbilker/arch-linux
OpenShift Merge Robot [Wed, 26 Aug 2020 12:42:37 +0000 (08:42 -0400)]
Merge pull request #2182 from mbilker/arch-linux

Fix mkinitcpio with newer systemd versions

5 years agoFix mkinitcpio with newer systemd versions
Matt Bilker [Tue, 25 Aug 2020 22:12:52 +0000 (18:12 -0400)]
Fix mkinitcpio with newer systemd versions

- Fixes systemd failing to determine if `/sysroot` is valid because of
  `/etc/os-release` not being available yet.

- Related: #1759

5 years agotests/inst: Port to new sh-inline repo
Colin Walters [Tue, 25 Aug 2020 22:06:13 +0000 (22:06 +0000)]
tests/inst: Port to new sh-inline repo

I cleaned up my fork of commandspec (see git log) and am
planning to publish to crates.  Port to the new API in prep
for that.

5 years agoMerge pull request #2180 from jlebon/pr/devel-build
OpenShift Merge Robot [Mon, 24 Aug 2020 19:05:20 +0000 (15:05 -0400)]
Merge pull request #2180 from jlebon/pr/devel-build

configure.ac: Set is_release_build=no

5 years agoconfigure.ac: Set is_release_build=no
Jonathan Lebon [Mon, 24 Aug 2020 18:16:16 +0000 (14:16 -0400)]
configure.ac: Set is_release_build=no

We missed this during the post-release version bump.

5 years agoMerge pull request #2179 from cgwalters/ioctl-fix
OpenShift Merge Robot [Sat, 22 Aug 2020 00:13:51 +0000 (20:13 -0400)]
Merge pull request #2179 from cgwalters/ioctl-fix

linuxfsutil: Pass int to ioctl, not long

5 years agoMerge pull request #2178 from cgwalters/ioctl-test
OpenShift Merge Robot [Fri, 21 Aug 2020 18:40:21 +0000 (14:40 -0400)]
Merge pull request #2178 from cgwalters/ioctl-test

tests: Check the immutable bit

5 years agolinuxfsutil: Pass int to ioctl, not long
Colin Walters [Fri, 21 Aug 2020 17:40:41 +0000 (17:40 +0000)]
linuxfsutil: Pass int to ioctl, not long

Otherwise it will fail on big-endian architectures like s390x.
Ref https://bugzilla.redhat.com/show_bug.cgi?id=1867601

5 years agotests: Check the immutable bit
Colin Walters [Fri, 21 Aug 2020 17:35:03 +0000 (17:35 +0000)]
tests: Check the immutable bit

See https://bugzilla.redhat.com/show_bug.cgi?id=1867601

We really want an upstream test for this, even if (to my knowledge)
nothing is running ostree's upstream CI on !x86_64.

5 years agoMerge pull request #2177 from smcv/systemd-no-syslog
OpenShift Merge Robot [Fri, 21 Aug 2020 12:57:29 +0000 (14:57 +0200)]
Merge pull request #2177 from smcv/systemd-no-syslog

boot: Replace deprecated StandardOutput=syslog with journal, etc.

5 years agoboot: Replace deprecated StandardOutput=syslog with journal, etc.
Simon McVittie [Fri, 21 Aug 2020 08:14:36 +0000 (09:14 +0100)]
boot: Replace deprecated StandardOutput=syslog with journal, etc.

systemd deprecated this in v246.

Resolves: #2169
Signed-off-by: Simon McVittie <smcv@collabora.com>
5 years agoMerge pull request #2175 from cgwalters/coverity-2020.5
OpenShift Merge Robot [Wed, 19 Aug 2020 14:46:49 +0000 (16:46 +0200)]
Merge pull request #2175 from cgwalters/coverity-2020.5

Two small Coverity fixes

5 years agoMerge pull request #2176 from cgwalters/pin-str
OpenShift Merge Robot [Wed, 19 Aug 2020 13:45:40 +0000 (15:45 +0200)]
Merge pull request #2176 from cgwalters/pin-str

admin/pin: Enforce that index is a number

5 years agoadmin/pin: Enforce that index is a number
Colin Walters [Wed, 19 Aug 2020 13:09:46 +0000 (13:09 +0000)]
admin/pin: Enforce that index is a number

Validate that we're parsing a number; we want to guard
against typos.

Closes: https://github.com/ostreedev/ostree/issues/2171
5 years agoprepare-root: Remove unused variable
Colin Walters [Tue, 18 Aug 2020 23:35:38 +0000 (23:35 +0000)]
prepare-root: Remove unused variable

Should quiet Coverity.

5 years agopull: Assign idle_src variable before calling unref()
Colin Walters [Tue, 18 Aug 2020 23:34:57 +0000 (23:34 +0000)]
pull: Assign idle_src variable before calling unref()

This should pacify Coverity, and also just "reads" better too.

5 years agoMerge pull request #2149 from stb-tester/boot-self-symlink
OpenShift Merge Robot [Tue, 18 Aug 2020 23:08:30 +0000 (01:08 +0200)]
Merge pull request #2149 from stb-tester/boot-self-symlink

sysroot: Support /boot on root or as seperate filesystem for syslinux and u-boot

5 years agoMerge pull request #2174 from cgwalters/bump-self
OpenShift Merge Robot [Tue, 18 Aug 2020 21:08:36 +0000 (23:08 +0200)]
Merge pull request #2174 from cgwalters/bump-self

tests/inst: Bump to latest ostree and gtk-rs

5 years agotests/inst: Bump to latest ostree and gtk-rs
Colin Walters [Tue, 18 Aug 2020 18:00:19 +0000 (18:00 +0000)]
tests/inst: Bump to latest ostree and gtk-rs

Updating our tests to the latest ostree crate is so deliciously
circular.

5 years agoMerge pull request #2173 from cgwalters/release
OpenShift Merge Robot [Tue, 18 Aug 2020 17:11:02 +0000 (19:11 +0200)]
Merge pull request #2173 from cgwalters/release

Release 2020.5

5 years agoPost-release version bump
Colin Walters [Tue, 18 Aug 2020 15:55:47 +0000 (15:55 +0000)]
Post-release version bump

5 years agoRelease 2020.5
Colin Walters [Tue, 18 Aug 2020 15:55:21 +0000 (15:55 +0000)]
Release 2020.5

Mainly to get https://github.com/ostreedev/ostree/pull/2160 out.

5 years agoMerge pull request #2172 from jlebon/pr/add-initrds-prep
OpenShift Merge Robot [Mon, 17 Aug 2020 15:59:18 +0000 (17:59 +0200)]
Merge pull request #2172 from jlebon/pr/add-initrds-prep

Miscellaneous patches split out of #2155

5 years agoMerge pull request #2127 from cgwalters/destructive-rs
OpenShift Merge Robot [Mon, 17 Aug 2020 15:15:29 +0000 (17:15 +0200)]
Merge pull request #2127 from cgwalters/destructive-rs

tests/inst: Add destructive test framework

5 years agotests/inst: Add destructive test framework
Colin Walters [Sun, 31 May 2020 17:57:22 +0000 (17:57 +0000)]
tests/inst: Add destructive test framework

This adds infrastructure to the Rust test suite for destructive
tests, and adds a new `transactionality` test which runs
rpm-ostree in a loop (along with `ostree-finalize-staged`) and
repeatedly uses either `kill -9`, `reboot` and  `reboot -ff`.

The main goal here is to flush out any "logic errors".

So far I've validated that this passes a lot of cycles
using
```
$ kola run --qemu-image=fastbuild-fedora-coreos-ostree-qemu.qcow2 ext.ostree.destructive-rs.transactionality --debug --multiply 8 --parallel 4
```
a number of times.

5 years agolib/deploy: Clarify comment re. staging API
Jonathan Lebon [Mon, 17 Aug 2020 13:48:15 +0000 (09:48 -0400)]
lib/deploy: Clarify comment re. staging API

Don't mention deprecation in the description for
`ostree_sysroot_deploy_tree` since there are legitimate use cases for it
(e.g. to create the first deployment via `ostree admin deploy`).

Instead, make the comment clearly redirect to the staging API when
booted into the sysroot.

5 years agolib/deploy: Drop unneccessary function arg
Jonathan Lebon [Mon, 17 Aug 2020 13:48:13 +0000 (09:48 -0400)]
lib/deploy: Drop unneccessary function arg

5 years agolib/cleanup: Drop unnecessary GEqualFunc cast
Jonathan Lebon [Mon, 17 Aug 2020 13:48:12 +0000 (09:48 -0400)]
lib/cleanup: Drop unnecessary GEqualFunc cast

5 years agolib/deploy: Simplify deployment creation
Jonathan Lebon [Mon, 17 Aug 2020 13:48:11 +0000 (09:48 -0400)]
lib/deploy: Simplify deployment creation

Minor cleanup; we were declaring a superfluous variable.

5 years agolib/deploy: Avoid shadowing variable
Jonathan Lebon [Mon, 17 Aug 2020 13:48:10 +0000 (09:48 -0400)]
lib/deploy: Avoid shadowing variable

There's already a `boot_relpath` variable in the outside scope.

5 years agolib/deploy: Clean up kargs override handling
Jonathan Lebon [Mon, 17 Aug 2020 13:48:09 +0000 (09:48 -0400)]
lib/deploy: Clean up kargs override handling

Tighten up how we handle kargs here so it's more clear. When we call
`sysroot_finalize_deployment`, any karg overrides have already been set
on the bootconfig object of the deployment. So re-setting it here is
redundant and confusing.

5 years agoMerge pull request #2170 from jprvita/for-upstream
OpenShift Merge Robot [Sun, 16 Aug 2020 20:25:20 +0000 (22:25 +0200)]
Merge pull request #2170 from jprvita/for-upstream

dracut: Create reproducible images

5 years agodracut: Create reproducible images
João Paulo Rechi Vita [Sat, 27 Jun 2020 01:28:48 +0000 (18:28 -0700)]
dracut: Create reproducible images

Without reproducible images, a rebuild of the initrd will create a
different image file (due to things like creation time of the files in
the cpio archive) even if the actual contents in it are exactly the
same, adding an unnecessary download during updates.

Adding 'reproducible=yes' avoids this and creates the same image files
for the same content.

5 years agoMerge pull request #2168 from arithx/ci_pxe_offline
OpenShift Merge Robot [Thu, 13 Aug 2020 14:43:38 +0000 (16:43 +0200)]
Merge pull request #2168 from arithx/ci_pxe_offline

ci: add pxe-offline-install testiso scenario

5 years agoci: add pxe-offline-install testiso scenario
Stephen Lowrie [Tue, 11 Aug 2020 05:02:12 +0000 (00:02 -0500)]
ci: add pxe-offline-install testiso scenario

5 years agoMerge pull request #2103 from cgwalters/underlay-live
OpenShift Merge Robot [Fri, 7 Aug 2020 21:29:31 +0000 (17:29 -0400)]
Merge pull request #2103 from cgwalters/underlay-live

Add "transient" unlock

5 years agoAdd "transient" unlock
Colin Walters [Sun, 17 May 2020 18:17:37 +0000 (18:17 +0000)]
Add "transient" unlock

I was thinking a bit more recently about the "live" changes
stuff https://github.com/coreos/rpm-ostree/issues/639
(particularly since https://github.com/coreos/rpm-ostree/pull/2060 )
and I realized reading the last debates in that issue that
there's really a much simpler solution; do exactly the same
thing we do for `ostree admin unlock`, except mount it read-only
by default.

Then, anything that wants to modify it does the same thing
libostree does for `/sysroot` and `/boot` as of recently; create
a new mount namespace and do the modifications there.

The advantages of this are numerous.  First, we already have
all of the code, it's basically just plumbing through a new
entry in the state enumeration and passing `MS_RDONLY` into
the `mount()` system call.

"live" changes here also naturally don't persist, unlike what
we are currently doing in rpm-ostree.

5 years agoMerge pull request #2166 from pwithnall/summary-sig-downloads
OpenShift Merge Robot [Fri, 7 Aug 2020 17:24:58 +0000 (13:24 -0400)]
Merge pull request #2166 from pwithnall/summary-sig-downloads

pull: Add summary-{,sig-}bytes options to ostree_repo_pull()

5 years agopull: Add summary-{,sig-}bytes options to ostree_repo_pull()
Philip Withnall [Thu, 16 Jul 2020 15:16:37 +0000 (16:16 +0100)]
pull: Add summary-{,sig-}bytes options to ostree_repo_pull()

These allow the `summary` and `summary.sig` files to be cached at a
higher layer (for example, flatpak) between related pull operations (for
example, within a single flatpak transaction). This avoids
re-downloading `summary.sig` multiple times throughout a transaction,
which increases the transaction’s latency and introduces the possibility
for inconsistency between parts of the transaction if the server changes
its `summary` file part-way through.

In particular, this should speed up flatpak transactions on machines
with high latency network connections, where network round trips have a
high impact on the latency of an overall operation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
5 years agopull: Improve formatting of pull options in documentation
Philip Withnall [Wed, 15 Jul 2020 15:24:32 +0000 (16:24 +0100)]
pull: Improve formatting of pull options in documentation

Backticks improve all things.

Signed-off-by: Philip Withnall <withnall@endlessm.com>