Commit Graph

5452 Commits

Author SHA1 Message Date
Ondrej Mosnacek
edb4f38934 deploy: Try to rebuild policy in new deployment if needed
Whenever the user has SELinux enabled and has any local
modules/modifications installed, it is necessary to rebuild the policy
in the final deployment, otherwise ostree will leave the binary policy
files unchanged from last deployment as it detects difference against
the base content (in rpm-ostree case this is the RPM content).

To avoid the situation where the policy binaries go stale once any local
customization of the policy is made, try to rebuild the policy as part
of sysroot_finalize_deployment(). Use the special
--rebuild-if-modules-changed switch, which detects if the input module
files have changed relative to last time the policy was built and skips
the most time-consuming part of the rebuild process if modules are
unchanged (thus making this a relatively cheap operation if the user
hasn't made any modifications to the shipped policy).

As suggested by Jonathan Lebon, this uses bubblewrap (via
g_spawn_sync()) to perform the rebuild inside the deployment's
filesystem tree, which also means that ostree will have a runtime
dependency on bubblewrap.

Partially addresses: https://github.com/coreos/fedora-coreos-tracker/issues/701

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-03-28 17:18:03 -04:00
Colin Walters
86741ad18a
Merge pull request #2573 from jtojnar/single-bin-coreutils-extensions
tests/test-cli-extensions: Fix with single-binary coreutils
2022-03-28 11:11:55 -04:00
Jan Tojnar
1898019fac tests/test-cli-extensions: Fix with single-binary coreutils
On systems where `coreutils` are built with `--enable-single-binary=symlinks` like Nix,
`/usr/bin/env` is symlinked to `/usr/bin/coreutils` and uses `argv[0]` to determine which program to run.
Since the `test-cli-extensions.sh` created a new symlink named `ostree-env`,
coreutils would be confused about the utility to choose, so running it would fail:

	ostree-env: unknown program ‘ostree-env’
	Try 'ostree-env --help' for more information.

Fixes: https://github.com/ostreedev/ostree/issues/2553
2022-03-26 10:55:42 +01:00
Jonathan Lebon
574d35bbdf
Merge pull request #2566 from cgwalters/ci-update 2022-03-14 15:24:23 -04:00
Jonathan Lebon
73bc62cac3
Merge pull request #2528 from cgwalters/test-crate-update 2022-03-14 15:20:54 -04:00
Colin Walters
afdc84b97b Update to sh-inline 0.2
Syncing up with the latest.
2022-03-14 09:54:48 -04:00
Colin Walters
e6f92f76fa ci: Update docs workflow to use fcos-buildroot
This way we can also use `./ci/installdeps.sh` which avoids yet
another list of dependencies.
2022-03-14 09:27:07 -04:00
Colin Walters
089b821098 ci: Disable Ubuntu LTS
It doesn't have a new enough glib.
2022-03-14 09:21:15 -04:00
Colin Walters
6ba254ab11
Merge pull request #2551 from q66/guri
lib: bump glib requirement to 2.66 and port to GUri
2022-03-14 08:52:51 -04:00
Daniel Kolesa
aca9e8e6a7 glib: bump glib requirement to 2.66 and port to GUri
This removes the old SoupURI copypasta from previous generation
of libsoup and opens up a path for a simple libsoup3 port.
2022-03-12 04:44:18 +01:00
Colin Walters
75ae283f23 Update to rand 0.8
Part of general crate updates.
2022-03-11 15:34:59 -05:00
Colin Walters
fba7efb6da Update to ostree-ext 0.6
Part of general crate updates.
2022-03-11 15:33:02 -05:00
Colin Walters
34d1bcc68a Update to nix 0.23
Part of general crate updates.
2022-03-11 15:32:27 -05:00
Colin Walters
b6d1119f91 tests: Stop using inventory crate
I was reading this thread
https://internals.rust-lang.org/t/from-life-before-main-to-common-life-in-main/16006/30
and that reminded me about this code, which it turns out actually
doesn't compile with my default local cargo config:
```
$ cat ~/.cargo/config
[target.x86_64-unknown-linux-gnu]
rustflags = ["-Ctarget-cpu=native", "-C", "link-arg=-fuse-ld=lld"]

[profile.release]
incremental = true
$ cargo b
...
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/var/srv/walters/src/github/ostreedev/ostree/target/debug/deps/ostree_test-4ca8e730f9dc6ffc.10325uqlhkyr5uol.rcgu.o" "/var/srv/walte"
  = note: ld.lld: error: undefined symbol: __start_linkme_NONDESTRUCTIVE_TESTS
          >>> referenced by 22nn09lfsklfqvyy
          >>>               /var/srv/walters/src/github/ostreedev/ostree/target/debug/deps/ostree_test-4ca8e730f9dc6ffc.22nn09lfsklfqvyy.rcgu.o:(ostree_tes)

```

For now let's just go back to having a static list of functions.
We don't have *too* many of those.
2022-03-11 14:53:29 -05:00
Luca Bruno
2f11977da5
Merge pull request #2563 from cgwalters/tmpfiles-run
tmpfiles: Create `/run/ostree`
2022-03-11 18:54:49 +00:00
Colin Walters
0d020a7145 tmpfiles: Create /run/ostree
This is referenced by 9645cee4f2/lib/src/globals.rs (L16)
specifically used for the (container image) pull secret in
`/run/ostree/auth.json`.

Let's pre-create the directory so users don't have to.

Motivated by https://github.com/openshift/machine-config-operator/pull/3007#discussion_r824172564
2022-03-11 13:08:23 -05:00
Luca Bruno
087f850227
Merge pull request #2564 from damdo/patch-1
README.md: update ostree-rs language binding link
2022-03-11 17:57:26 +00:00
Damiano Donati
039d86c63b
README.md: update ostree-rs language binding link
According to the description on https://gitlab.com/fkrull/ostree-rs/ the repository is now moved to https://github.com/ostreedev/ostree-rs
2022-03-11 11:12:43 +00:00
Luca Bruno
0d6e66b57a
Merge pull request #2562 from josepht/main
Add Fedora Kinoite link to index.md also.
2022-03-10 21:05:02 +00:00
Joe Talbott
faa8ed547b Add Fedora Kinoite link to index.md also. 2022-03-09 08:58:12 -05:00
Colin Walters
566fa59753
Merge pull request #2561 from pwithnall/pull-leak
ostree-repo-pull: Take correct out path on error
2022-03-08 11:22:42 -05:00
Philip Withnall
8cc8e68768 ostree-repo-pull: Take correct out path on error
Like every other error return path in this function, jump to the `out`
label on error here. Returning directly will cause leaks.

Spotted by reading the code, not actually necessarily encountered in the
wild.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-08 15:36:27 +00:00
Colin Walters
775ff6e687
Merge pull request #2560 from smcv/sigpipe
test-prune: Read to the end of cut(1) output
2022-03-08 10:29:11 -05:00
Colin Walters
21a083db69
Merge pull request #2559 from smcv/shebang
Fix shebang in s390x-se-luks-gencpio
2022-03-08 09:46:07 -05:00
Simon McVittie
92ca2c7794 test-prune: Read to the end of cut(1) output
If we use head(1) to take only the first two lines, then cut(1) and
earlier pipeline entries are killed by SIGPIPE (if they have not already
terminated), and that's flagged as an error under `set -o pipefail`.
Use an equivalent sed command to take exactly the second line, but
without SIGPIPE.

Signed-off-by: Simon McVittie <smcv@debian.org>

Gbp-Pq: Name test-prune-Read-to-the-end-of-cut-1-output.patch
2022-03-07 23:03:33 +00:00
Simon McVittie
a9a0110f44 s390x-se-luks-gencpio: Use interoperable path for bash
On OSs that do not consistently merge /usr/bin with /bin, the path to
bash has traditionally been /bin/bash.

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-03-07 22:49:33 +00:00
Simon McVittie
084f8913f0 s390x-se-luks-gencpio: Fix shebang syntax
An indented `#!` is technically meaningless, although many shells will
run text files with the shell if asked to execute them.

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-03-07 22:49:30 +00:00
Colin Walters
d7d1526956
Merge pull request #2557 from lucab/ups/apidoc-includes
apidoc: add missing page includes
2022-03-07 04:10:34 -05:00
Luca BRUNO
ca0bb75954
apidoc: add missing page includes
This fixes some missing sections in API reference, adding all the
relevant includes.
2022-03-07 08:33:08 +00:00
Colin Walters
511d02daec
Merge pull request #2556 from ostreedev/release-2022.2
Release 2022.2
2022-03-03 19:23:29 -05:00
Colin Walters
4c0f9e0949 configure: post-release version bump 2022-03-03 18:44:30 -05:00
Colin Walters
fbc6d21c2f Release 2022.2 2022-03-03 18:44:30 -05:00
Colin Walters
06d13ff16c
Merge pull request #2532 from lucab/ups/repo-mode-bare-split-xattrs
lib/core: introduce 'bare-split-xattrs' mode
2022-03-03 09:41:45 -05:00
Luca BRUNO
aca5671eb1
tests/basic-bare-split-xattrs: add fixture, check read logic 2022-03-03 11:11:59 +00:00
Luca BRUNO
7e79b82ff8
lib/commit: disallow writing content in 'bare-split-xattrs' mode
This prevents writing content into 'bare-split-xattrs` repository,
while carving some space for experimenting via a temporary
`OSTREE_EXP_WRITE_BARE_SPLIT_XATTRS` environment flag.
2022-03-02 16:45:02 +00:00
Luca BRUNO
14a6e6d8d0
lib/repo: read split xattrs content from file-xattrs-link objects 2022-03-02 16:45:01 +00:00
Luca BRUNO
08e98e9042
lib/core: introduce 'bare-split-xattrs' mode 2022-03-02 16:45:00 +00:00
Luca BRUNO
2c60f302f9
lib/core: introduce two new object types for split xattrs
This adds two new object types for storing xattrs separately from
content objects.

`.file-xattrs` are regular files storing xattrs content, encoded as
GVariant. Each object is keyed by the checksum of its content, allowing
for multiple references.

`.file-xattrs-link` are hardlinks which are associated to file objects.
Each object is keyed by the same checksum of the corresponding file
object. The target of the hardlink is an existing file-xattrs object.
In case of reaching the limit of too many links, this object could be
a plain file too.
2022-03-02 16:44:59 +00:00
Luca Bruno
6ad4a3457f
Merge pull request #2554 from ostreedev/dependabot/submodules/libglnx-c71f7ae
build(deps): bump libglnx from `88da8dd` to `c71f7ae`
2022-03-02 16:44:31 +00:00
dependabot[bot]
65ccf2951d
build(deps): bump libglnx from 88da8dd to c71f7ae
Bumps libglnx from `88da8dd` to `c71f7ae`.

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 12:30:34 +00:00
Colin Walters
999c70346a
Merge pull request #2536 from saqibali-2k/pr/prune-commit-only
src/ostree: Add --commit-only option to ostree prune
2022-02-28 08:47:09 -05:00
Saqib Ali
cf66eaccee tests/test-prune.sh: Use TAP API
Change tests to use the newer TAP API introduced
in https://github.com/ostreedev/ostree/pull/2440
2022-02-25 18:32:25 -05:00
Saqib Ali
18ab5361b9 tests/test-prune.sh: expand testing for --commit-only
Let's add additional tests to expand the test
suite for the new --commit-only functionality.
2022-02-25 18:32:25 -05:00
Saqib Ali
ce44b1907e man/prune, bash: Add --commit-only flag for ostree prune
Update the man page and the auto-complete script
to include the --commit-only flag
2022-02-25 18:32:25 -05:00
Saqib Ali
725d50a3b5 src/ostree: Add --commit-only option to ostree prune
Recently we have noticed exceedingly long execution times
for multiple invocations of ostree prune. This is a result of
calculating full reachability on each invocation.

The --commit-only flag provides an alternative strategy. It will only
traverse and delete commit objects to avoid the more expensive
reachability calculations. This allows us to chain multiple --commit-only
commands cheaply, and then follow with a more expensive ostree prune
invocation at the end to clean up orphaned meta and content objects.
2022-02-25 18:32:25 -05:00
Jonathan Lebon
00e39ebedc
Merge pull request #2548 from cgwalters/mtree-load-ensured 2022-02-22 15:20:22 -05:00
Luca Bruno
4a38ac7b8d
Merge pull request #2552 from ostreedev/dependabot/submodules/libglnx-88da8dd
build(deps): bump libglnx from `803adaf` to `88da8dd`
2022-02-22 16:32:08 +00:00
dependabot[bot]
f73434f1b3
build(deps): bump libglnx from 803adaf to 88da8dd
Bumps libglnx from `803adaf` to `88da8dd`.

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-22 15:51:55 +00:00
Colin Walters
4304505af8
Merge pull request #2549 from ostreedev/mwleeds/fix-partial-delta-fetches
Fix marking static delta commits as partial
2022-02-21 14:23:39 -05:00
Phaedrus Leeds
c213dd3a84 lib/repo-refs: Remove misleading newline 2022-02-19 14:46:02 -06:00