Commit Graph

6107 Commits

Author SHA1 Message Date
Luca Bruno
fdbc05dab0
Merge pull request #2706 from git-bruh/main
ostree-fetcher-curl: check for HTTP2 support before trying to use it
2022-09-05 09:29:29 +00:00
git-bruh
35d6ea88f6
ostree-fetcher-curl: check for HTTP2 support before trying to use it 2022-09-03 12:50:00 +05:30
Dan Nicholson
eed9e9f335
Merge pull request #2704 from cgwalters/finalize-no-sigterm
finalize-staged: Don't listen to `SIGTERM`, just let kernel exit us
2022-08-30 16:32:46 -06:00
Colin Walters
683e4eff08 finalize-staged: Don't listen to SIGTERM, just let kernel exit us
Followup from discussion in
https://github.com/ostreedev/ostree/pull/2544#discussion_r958840936

This is more efficient; no need to have the kernel context switch
us in at shutdown time just so we can turn around and call
`exit()`.
2022-08-30 17:50:03 -04:00
Colin Walters
6651b72a7a
Merge pull request #2544 from dbnicholson/finalize-block
finalize-staged: Ensure /boot and /sysroot automounts don't expire
2022-08-30 15:12:32 -04:00
Dan Nicholson
f3db79e7fa finalize-staged: Ensure /boot automount doesn't expire
If `/boot` is an automount, then the unit will be stopped as soon as the
automount expires. That's would defeat the purpose of using systemd to
delay finalizing the deployment until shutdown. This is not uncommon as
`systemd-gpt-auto-generator` will create an automount unit for `/boot`
when it's the EFI System Partition and there's no fstab entry.

To ensure that systemd doesn't stop the service early when the `/boot`
automount expires, introduce a new unit that holds `/boot` open until
it's sent `SIGTERM`. This uses a new `--hold` option for
`finalize-staged` that loads but doesn't lock the sysroot. A separate
unit is used since we want the process to remain active throughout the
finalization run in `ExecStop`. That wouldn't work if it was specified
in `ExecStart` in the same unit since it would be killed before the
`ExecStop` action was run.

Fixes: #2543
2022-08-30 09:16:39 -06:00
Dan Nicholson
e30a3b6b17 main: Factor out sysroot loading
It can be useful to parse the options and initialize the sysroot without
actually loading it until later. Factor out the sysroot loading to a new
`ostree_admin_sysroot_load` and add a new
`OSTREE_ADMIN_BUILTIN_FLAG_NO_LOAD` flag to accommodate this.
2022-08-30 08:46:26 -06:00
Colin Walters
06cd216f4e
Merge pull request #2695 from HuijingHei/kargs-stage
Fix `ostree admin kargs edit-in-place` assertion when deployments are pending
2022-08-29 08:23:15 -04:00
Huijing Hei
37aa2ac287 Fix ostree admin kargs edit-in-place assertion when deployments
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=foobar
```
After reboot we get both `foo=bar foobar`.

Fix https://github.com/ostreedev/ostree/issues/2679
2022-08-29 11:31:32 +08:00
Colin Walters
93a6d7bea2
Merge pull request #2701 from cgwalters/bind-list-commits
rust: Bind `ostree_repo_list_commits_starting_with`
2022-08-24 12:03:58 -04:00
Colin Walters
b55054ec24 rust: Bind ostree_repo_list_commits_starting_with
I wanted to use this as a fallback for
30dee81c22
2022-08-24 09:44:34 -04:00
Luca Bruno
a266fabb77
Merge pull request #2702 from thesamesam/bashism
buildutil/glibtests.m4: fix bashism
2022-08-24 13:24:35 +00:00
Luca Bruno
f0abd9de30
Merge pull request #2700 from jlebon/pr/staged-docs
docs: Add section about staged deployments
2022-08-24 13:17:41 +00:00
Sam James
c568073d1e buildutil/glibtests.m4: fix bashism
configure scripts need to be runnable with a POSIX-compliant /bin/sh.

On many (but not all!) systems, /bin/sh is provided by Bash, so errors
like this aren't spotted. Notably Debian defaults to /bin/sh provided
by dash which doesn't tolerate such bashisms as '=='.

This retains compatibility with bash.

Fixes configure warnings/errors like:
```

checking whether to build static libraries... no
./configure: 14795: test: unexpected operator
```

Signed-off-by: Sam James <sam@gentoo.org>
2022-08-23 23:38:20 +01:00
Jonathan Lebon
8f609dddaa
Merge pull request #2698 from cgwalters/update-gir 2022-08-23 14:53:36 -04:00
Jonathan Lebon
e075c51057 docs: Add section about staged deployments
I was explaining staged deployments to someone today and was looking for
a doc but we didn't have any. Fix that.
2022-08-23 10:59:40 -04:00
Dan Nicholson
51edc3a70c
Merge pull request #2699 from cgwalters/drop-debian-testing
ci: Also drop seccomp on debian testing
2022-08-23 01:35:40 -06:00
Colin Walters
21a8f39284 ci: Also drop seccomp on debian testing
I didn't deep dive into debugging this but I'm pretty sure it's
 https://gitlab.gnome.org/GNOME/glib/-/issues/2580
which is us having an older Docker in the middle here.
2022-08-22 17:00:09 -04:00
Colin Walters
629d2f5d7e rust: Update to latest git
In the future I may try to add CI that requires this to be
sync'd...
2022-08-22 15:11:51 -04:00
Colin Walters
fb826346fe
Merge pull request #2692 from GeorgesStavracas/gbsneto/transaction-leak
lib/commit: Unref repo on success
2022-08-22 14:25:07 -04:00
Colin Walters
1d478ced2e
Merge pull request #2697 from tkfu/docs/add-related-projects
docs: Add aktualizr and TorizonCore to related projects
2022-08-19 10:53:56 -04:00
Jon Oster
b473cc7d62 docs: Add aktualizr and TorizonCore to related projects
Signed-off-by: Jon Oster <jon.oster@toradex.com>
2022-08-19 16:27:01 +02:00
Joseph Marrero Corchado
fe034b986b
Merge pull request #2693 from lucab/ups/libostree-fix-annotation
libostree: fix a typo in annotation
2022-08-19 07:31:24 -04:00
Luca BRUNO
ff7d9a8a6d
libostree: fix a typo in annotation
This fixes a typo in the `allow-none` annotation on
`ostree_sysroot_deployment_set_kargs_in_place` argument.
2022-08-19 10:39:09 +00:00
Jonathan Lebon
1fe550e9a0
Merge pull request #2691 from cgwalters/rev-parse-single 2022-08-18 12:07:19 -04:00
Colin Walters
ad0354ac36 cli/rev-parse: Add --single option
In the current "ostree native container" flow, we're inserting
a commit object into the repo but with no refs.

We have hacks in a few places to find the commit digest via e.g.
`find repo/objects -name *.commit` but that's a horrible hack.
Add `ostree rev-parse --single` which will print the single commit,
and error out if there is not exactly one commit.

Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
2022-08-18 11:08:17 -04:00
Luca Bruno
ea2f0c2943
Merge pull request #2690 from cgwalters/cli-less-goto-1
cli/rev-parse: Port to new code style
2022-08-17 07:21:55 +00:00
Georges Basile Stavracas Neto
092421fabf lib/commit: Unref repo on success
Commit 540e60c3 introduced _ostree_repo_auto_transaction_new(), a
private constructor to OstreeRepoAutoTransaction, by factoring out
some code from _ostree_repo_auto_transaction_start(). This factored
code increased the refcount of the 'repo' variable.

Subsequent commit 71304e854c made ostree_repo_prepare_transaction()
use ths newly introduced constructor. However, in this function, the
happy path assumed no ref was taken, and therefore did not unref it.
Commit 71304e854c didn't add the corresponding unref either.

This leaks a reference to OstreeRepo when calling
ostree_repo_prepare_transaction().

Plug this leak by using g_clear_object() to clear the repo field
of OstreeRepoAutoTransaction, instead of simply setting it to NULL.

Closes https://github.com/flatpak/flatpak/issues/4928
2022-08-16 19:54:29 -03:00
Colin Walters
090f312e40 cli/rev-parse: Port to new code style
Prep for future changes.
2022-08-16 17:11:30 -04:00
Jonathan Lebon
26a546886a
Merge pull request #2684 from ostreedev/dependabot/submodules/libglnx-26375b5 2022-08-16 09:03:07 -04:00
dependabot[bot]
18c97d7563
build(deps): bump libglnx from c59eb27 to 26375b5
Bumps libglnx from `c59eb27` to `26375b5`.

---
updated-dependencies:
- dependency-name: libglnx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-16 07:28:21 +00:00
Colin Walters
9995f370d3
Merge pull request #2689 from jlebon/pr/ficlone-direct-payload
lib/commit: Directly use FICLONE for payload link
2022-08-15 18:33:55 -04:00
Jonathan Lebon
84670a0070 tests/kolainst/staged-deploy: parse rpm-ostree status --json instead
Don't parse `rpm-ostree status` output, it's not meant for that. Use
`--json` output instead.

While we're here, fix an obsolete reference to Ansible.

Related: https://github.com/coreos/rpm-ostree/pull/3938
2022-08-15 17:50:11 -04:00
Jonathan Lebon
93e47f88f4 lib/commit: Directly use FICLONE for payload link
The idea of payload linking is to reflink between objects where
possible. Instead of relying on `glnx_regfile_copy_bytes` to hit the
`FICLONE` path, just call `FICLONE` directly. At that point in the code,
we've already established that the source and dest repos are on the same
filesystem and that it supports `FICLONE`.

Related: https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/41
Related: https://github.com/ostreedev/ostree/pull/2684#issuecomment-1204068437
2022-08-15 14:00:08 -04:00
Colin Walters
4471c252a9
Merge pull request #2688 from LukasKalbertodt/main
Update to `libtest-mimic` 0.5.0
2022-08-13 14:02:07 -04:00
Lukas Kalbertodt
02b162347c
Update to libtest-mimic 0.5.0 2022-08-13 16:41:34 +02:00
Luca Bruno
e424efa1e4
Merge pull request #2686 from cgwalters/include-cleanups
Handle conflicts between newer glibc and kernel headers
2022-08-04 07:02:08 +00:00
Colin Walters
0a908a180f Move FIFREEZE/FITHAW ioctl invocations into linuxfsutil.c
Should help avoid conflicts between glibc and linux headers.

Closes: https://github.com/ostreedev/ostree/issues/2685
2022-08-03 10:44:51 -04:00
Colin Walters
edba4b33be Remove unused linux/fs.h includes
Prep for fixing conflicts introduced by newer glibc.
cc https://github.com/ostreedev/ostree/issues/2685
2022-08-03 10:37:40 -04:00
Luca Bruno
5de689b846
Merge pull request #2683 from cgwalters/sync-deny
deny.toml: Add `Unicode-DFS-2016`
2022-08-03 11:41:18 +00:00
Colin Walters
a83673f1a7 deny.toml: Add Unicode-DFS-2016
This is used by the unicode crate now and is definitely a compatible
FOSS license.
2022-08-01 14:43:31 -04:00
Colin Walters
459a4c2227
Merge pull request #2678 from cgwalters/release-2022-5
Release 2022 5
2022-07-22 16:11:20 -04:00
Colin Walters
55292e4007 rust-bindings: Fix cargo fmt 2022-07-22 15:20:05 -04:00
Colin Walters
d7c25a2062 configure: post-release version bump 2022-07-22 15:20:05 -04:00
Colin Walters
15740d042c Release 2022.5 2022-07-22 15:08:25 -04:00
Colin Walters
f50fe7008c
Merge pull request from GHSA-gqf4-p3gv-g8vw
Fix sign ed25519 verify
2022-07-22 15:05:27 -04:00
Luca Bruno
f2ea2f30cc
Merge pull request #2675 from HuijingHei/update-doc
Update doc about adding new function to libostree
2022-07-15 18:25:13 +00:00
Colin Walters
6200ec321f
Merge pull request #2676 from render-se/debos-docs
add debos to readme distribution build tools
2022-07-15 14:24:25 -04:00
Chris Mucciolo
6cb1227177 docs add debos to readme distribution build tools 2022-07-15 13:24:29 -04:00
Colin Walters
e0417957ea rust: Add a test case for ed25519
Specifically, I verified that *before* the previous patch to the
ed25519 C code, the last bit of code would fail with a SIGSEGV when
trying to read the empty signature.
2022-07-14 17:13:51 -04:00