Commit Graph

5319 Commits

Author SHA1 Message Date
Luca BRUNO
513b3c09a5
main: add support for CLI extensions via external binaries
This adds some logic to detect and dispatch unknown subcommands to
extensions available in `$PATH`. Additional commands can be
implemented by adding relevant `ostree-$verb` binaries to the system.

As an example, if a `/usr/bin/ostree-extcommand` extension is provided,
the execution of `ostree extcommand --help` will be dispatched to that
as `ostree-extcommand extcommand --help`.
2021-12-20 10:00:02 +00:00
Colin Walters
365559eaa8
Merge pull request #2498 from lucab/ups/test-assert-strings
tests: assert mandatory values are present
2021-12-10 13:25:03 -05:00
Luca BRUNO
f44eaf7e8c
tests: assert mandatory values are present
This adds a couple of string assertions to make sure that
the test run is sane.
2021-12-10 11:33:35 +00:00
Colin Walters
b56786c415
Merge pull request #2496 from lucab/ups/repo-asserts
lib/repo: fix problematic invariant checks
2021-12-07 19:58:23 -05:00
Colin Walters
490f515e18
Merge pull request #2494 from jmarrero/fsf-address
Update FSF license notices to use URL instead of address
2021-12-07 15:51:48 -05:00
Luca BRUNO
58bdfb90c9
lib/repo: do no return a NULL on failure
This turns an existing check into an assert. The previously returned
NULL may result in confusing callers, as none of them is checking for
that.
2021-12-07 16:24:56 +00:00
Luca BRUNO
4a0ebe507f
lib/repo: do no return an arbitrary mode on failure
This turns the existing check into an assert. Otherwise, the previous
code may return an arbitrary repo mode (bare) on failure.
2021-12-07 16:23:02 +00:00
Luca BRUNO
f1e24945fa
lib/repo: assert that writable state and error agree
This adds an assertion to check that writable stable and error
are in sync. The subsequent logic uses them interchangeably.
2021-12-07 16:21:21 +00:00
Joseph Marrero
581a58067b Update FSF license notices to use URL instead of address 2021-12-07 08:34:25 -05:00
Colin Walters
a07b8d6c00
Merge pull request #2493 from cgwalters/summary-lock-shared
repo: Change locking for summary regeneration to be shared
2021-12-06 08:19:12 -05:00
Colin Walters
2c39bd88a9 repo: Change locking for summary regeneration to be shared
This is trying to address:
https://pagure.io/fedora-iot/issue/48

Basically we changed rpm-ostree to start doing a shared lock during
commit by default, but this broke because pungi is starting a process
doing a commit for each architecture, and then trying to regenerate
the summary after each one.

This patch is deleting a big comment with a rationale for why
summary regeneration should be exclusive.  Point by point:

> This makes sure the commits and deltas don't get
> deleted while generating the summary.

But prune operations require an exclusive lock, which means that
data still can't be deleted when the summary grabs a shared lock.

> It also means we can be sure refs
> won't be created/updated/deleted during the operation, without having to
> add exclusive locks to those operations which would prevent concurrent
> commits from working.

First: The status quo *has* prevented concurrent commits from working!

There is no real locking solution to this problem. What we really
need to do here is regenerate the summary after each commit *or*
when the caller decides to do it and e.g. include deltas at the same
time.

It's OK if multiple threads race to regenerate the summary;
last-one-wins behavior here is totally fine.
2021-12-03 14:42:03 -05:00
Jonathan Lebon
267ca93da2
Merge pull request #2490 from lucab/ups/static-fixes 2021-11-26 10:55:15 -05:00
Luca BRUNO
cefc1d7854
lib: misc static analysis fixes
This fixes a few warnings from coverity, none of which really
interesting.
2021-11-26 15:11:00 +00:00
Colin Walters
2dc6ec70ec
Merge pull request #2489 from ostreedev/release-2021.6
Release 2021.6
2021-11-23 09:01:57 -05:00
Luca BRUNO
281d310224
configure: post-release version bump 2021-11-23 10:15:19 +00:00
Luca BRUNO
f1155c8d28
Release 2021.6 2021-11-23 10:13:32 +00:00
Colin Walters
48dfff2754
Merge pull request #2486 from jlebon/pr/remount-ostree
app: Only remount /sysroot if needed
2021-11-22 13:35:28 -05:00
Jonathan Lebon
947acbf178 app: Only remount /sysroot if needed
We should only try to remount `/sysroot` if we're actually handling the
sysroot repo and the repo isn't writable. We already have public APIs to
check each of those, so let's use them.

Closes: #2485
2021-11-19 11:01:18 -05:00
Colin Walters
f552e30c0b
Merge pull request #2484 from dbnicholson/prune-serialize
lib/prune: Avoid unnecessary object serialization
2021-11-18 14:49:15 -05:00
Dan Nicholson
47d32d9ead lib/prune: Avoid unnecessary object serialization
`repo_prune_internal` was deserializing each object and passing the
components to `maybe_prune_loose_object`, which promptly reserialized
it.
2021-11-18 11:04:06 -07:00
Luca Bruno
edbcf52134
Merge pull request #2481 from refi64/null-error
lib: Avoid dereferencing NULL error values
2021-11-12 15:19:29 +00:00
Ryan Gonzalez
9c1fe55bbc lib: Avoid dereferencing NULL error values
Otherwise, this will segfault when callers don't need any exact errors.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2021-11-12 08:29:05 -06:00
Colin Walters
e39280ff21
Merge pull request #2479 from cgwalters/ci-capsh
ci: Require `libcap2-bin` for `capsh`
2021-11-09 10:44:08 -05:00
Colin Walters
dff36697cd
Merge pull request #2477 from ratajs/patch-1
Add Fedora Kinoite link
2021-11-09 09:32:02 -05:00
Colin Walters
1a86517d65
Merge pull request #2476 from valentindavid/valentindavid/glib-fix
lib: Fix a bad call to g_file_get_child
2021-11-09 09:27:18 -05:00
Colin Walters
3b338df956 ci: Require libcap2-bin for capsh
This was previously pulled in indirectly, but it looks like we need
to require it explicitly in newer Ubuntu.
2021-11-09 09:22:43 -05:00
Šimon (Simon) Rataj
56428d5e0e
Merge branch 'ostreedev:main' into patch-1 2021-11-04 18:50:34 +01:00
Colin Walters
e580eca214
Merge pull request #2187 from cgwalters/sysroot-ro-initramfs
prepare-root: Set up sysroot readonly in initramfs
2021-11-04 10:37:18 -04:00
Valentin David
adc097a2ed
lib: Fix a bad call to g_file_get_child
In Glib, since commit 3a6e8bc8876e149c36b6b14c6a25a718edb581ed,
`g_file_get_child` does not accept absolute path as paramater anymore.

The broken assertion was encountered during `ostree admin deploy`
command for the checkout of subpath `etc`.

Example of error log:
```
(ostree admin deploy:1640): GLib-GIO-CRITICAL **: 03:42:00.570: g_file_get_child: assertion '!g_path_is_absolute (name)' failed

(ostree admin deploy:1640): GLib-GIO-CRITICAL **: 03:42:00.570: g_file_query_info: assertion 'G_IS_FILE (file)' failed
**
OSTree:ERROR:src/ostree/ot-main.c:232:ostree_run: assertion failed: (success || error)
Bail out! OSTree:ERROR:src/ostree/ot-main.c:232:ostree_run: assertion failed: (success || error)
```
2021-11-03 21:40:35 +01:00
Šimon (Simon) Rataj
48f582b918
Added Fedora Kinoite link 2021-11-03 21:02:53 +01:00
Colin Walters
c553b5c69a
prepare-root: Set up sysroot readonly in initramfs
Let's ensure things are right from the start in the initramfs;
this closes off various race conditions.  Followup to
3564225917

Closes: https://github.com/ostreedev/ostree/issues/2115
2021-11-03 16:37:20 +00:00
Colin Walters
800289a8db
Merge pull request #2475 from lucab/ups/prepare-root-check-first
prepare-root: check for read-only sysroot status early on
2021-11-01 09:58:06 -04:00
Luca BRUNO
63d0c4c781
prepare-root: check for read-only sysroot status early on
This moves read-only sysroot checks upfront, so that they are not
intermixed with mount operations.
It has no immediate side-effects, but allow these check to be
independent from the rest of the mounting logic (and future changes
to it).
2021-11-01 09:42:36 +00:00
Jonathan Lebon
b7efd16cc5
Merge pull request #2472 from lucab/ups/prepare-root-checked-printf 2021-10-26 15:14:21 -04:00
Jonathan Lebon
6e0165020a
Merge pull request #2473 from lucab/ups/prepare-root-less-global-mutable-state 2021-10-26 13:25:37 -04:00
Luca BRUNO
7c17daad17
prepare-root: get rid of a global variable
This moves a global mutable variable to a smaller local scope,
as it is not really used outside of that.
2021-10-26 16:27:22 +00:00
Luca BRUNO
ca84da679a
prepare-root: check return codes for errors when assembling paths
This adds checks around all `snprintf` calls in order to detect
failures and gracefully abort.
2021-10-26 16:16:34 +00:00
Colin Walters
1e6077af03
Merge pull request #2471 from lucab/ups/prepare-root-silent-mounts
prepare-root: make all mount operations silent
2021-10-26 10:06:52 -04:00
Luca BRUNO
848fe542af
prepare-root: make all mount operations silent
This adds a `MS_SILENT` flag to all `mount(2)` calls, reducing the
amount of kernel logs produced on each boot.
Those messages do not contain actionable details, and in the "mount
plus read-only remount" case they can easily become highly redundant.
2021-10-26 10:51:37 +00:00
Luca Bruno
9692437491
Merge pull request #2468 from lucab/ups/tests-var-mount
tests/var-mount: tweak test setup
2021-10-19 09:03:19 +00:00
Luca BRUNO
f93d96620c
tests/var-mount: tweak test setup
This reworks the var-mount destructive test in order to properly use
the datadir for the current stateroot instead of a duplicated one.
In turn, it ensures that the resulting `var.mount` after reboot is
correctly pointing to the same location which hosted `/var` on the
previous boot.
2021-10-19 08:03:09 +00:00
Luca Bruno
5d045f3ae1
Merge pull request #2466 from cgwalters/ci-fanalyzer
ci: Enable -fanalyzer
2021-10-18 16:44:56 +00:00
Colin Walters
58dc6a08b4 tests/rollsum: Use g_malloc not malloc
To pacify gcc's `-fanalyzer`.
2021-10-18 11:44:44 -04:00
Colin Walters
fda41e8d24 ci: Enable -fanalyzer
Followup to https://github.com/ostreedev/ostree/pull/2463

One thing I noticed here is we lost usage of `build-check.sh`
which also invokes `clang`, which doesn't speak `-fanalyzer`
and would be broken by this if we try to enable `build-check.sh`
again.  But that can come later.
2021-10-15 15:44:04 -04:00
Luca Bruno
ec8cf31e98
Merge pull request #2455 from cgwalters/packit
Attempt to update packit flow to build in COPR
2021-10-15 07:47:28 +00:00
Jonathan Lebon
09f4ad708c
Merge pull request #2467 from cgwalters/bump-libglnx-20211014 2021-10-14 15:33:33 -04:00
Colin Walters
baa57ffe0d libglnx: Bump to ef502aabf7d3a0d37f9c4d228f870ac93404447b
Various fixes there, including one for `gcc -fanalyzer`.

Update submodule: libglnx
2021-10-14 12:41:02 -04:00
Colin Walters
7ba8dbf0cc Attempt to update packit flow to build in COPR
No idea if this will really work, but at least `packit srpm`
does work now.
2021-10-14 12:36:38 -04:00
Luca Bruno
6b8295ada1
Merge pull request #2463 from cgwalters/fix-fanalyzer
Fix various mostly theoretical gcc `-fanalyzer` issues
2021-10-14 08:30:25 +00:00
Colin Walters
029a9d56c3 variantutil: Fix gcc -fanalyzer warnin
Add some not-NULL assertions for return values from glib,
and upgrade some `g_return_if_fail` to `g_assert`.
2021-10-13 17:13:14 -04:00