Commit Graph

7007 Commits

Author SHA1 Message Date
Colin Walters
a0f7b3c789 man: Document root.transient
This one warrants some explanation.
2023-12-08 14:01:02 -05:00
Eric Curtin
071053d915
Merge pull request #3114 from cgwalters/root-ovl
prepare-root: Add support for root.transient
2023-12-08 14:02:56 +00:00
Colin Walters
8fbaebac58 prepare-root: Add support for root.transient
Closes: https://github.com/ostreedev/ostree/issues/3113

It'd greatly improve compatibility with things like RPMs that install
in `/opt` if we supported a full "original docker" style model where
`/` is a transient overlayfs.  We'd still keep our semantics for `/etc`
and `/var` by default, but e.g. we'd stop recommending
`/opt` ➡️ `/var/opt`, in this model,
so `/opt` would be on the overlayfs.

Note this all aligns with composefs, where we'd actually be making
`/` a *read-only* overlayfs by default; it'd be really nice of course
to *implement* this by just making the composefs overlayfs writable,
but I am not sure we can hard require composefs for this right now.

So this change adds support for `root.transient = true`
in `/usr/lib/ostree/prepare-root.conf`.

The major downside is that people could be surprised if files they
write to e.g. `/opt` don't persist across upgrades.  But, that's
already again how it works since Docker started.

Note as part of the implementation of this, we need to add a whole
new "backing" directory distinct from the deployment directories.

(Tangentially related to this, it's tempting to switch to always
 using a *read-only* overlay mount by default.
2023-12-07 13:31:42 -05:00
Colin Walters
59cdd6119f prepare-root: Add an autofree
This doesn't matter at all, but I just noticed this while working
on the code.
2023-12-07 13:31:42 -05:00
Colin Walters
6cb15c35c8 sysroot: Drop unused prototype
This function doesn't exist anymore.
2023-12-07 13:31:42 -05:00
Colin Walters
508b6ea6b6
Merge pull request #3112 from leonheldattoradex/main
Update Torizon information
2023-12-07 09:48:22 -05:00
Leonardo Held
3ff00e43f5
Update Torizon information
TorizonCore became Torizon OS and Torizon OTA is now Torizon Cloud.

Signed-off-by: Leonardo Held <leonardo.held@toradex.com>
2023-12-07 10:08:16 -03:00
Joseph Marrero Corchado
51a34a4030
Merge pull request #3111 from cgwalters/release
Release 2023.8
2023-12-05 21:52:21 -05:00
Colin Walters
56b268dd66 configure: post-release version bump 2023-12-05 14:03:56 -05:00
Colin Walters
5b23804a1a Release 2023.8 2023-12-05 13:37:04 -05:00
Colin Walters
6e3033188c
Merge pull request #3106 from cgwalters/commit-reflink
commit: Try reflinks for local commits by default
2023-12-05 13:36:00 -05:00
Colin Walters
c3dff62e1c commit: Try reflinks for local commits by default
I think we originally used to do this, but at some point in a
code refactoring, this optimization got lost.

It's a quite important optimization for the case of writing content
generated by an external system into an ostree repository.
2023-12-04 20:45:08 -05:00
Joseph Marrero Corchado
59b9f9a8ef
Merge pull request #3105 from cgwalters/sysroot-borrow-fd
sysroot: Add a method to borrow sysroot fd
2023-12-04 18:22:50 -05:00
Colin Walters
09e32d615f
Merge pull request #3107 from cgwalters/drop-userxattr-test
tests: Drop bare-user on tmpfs negative test
2023-12-04 13:14:07 -05:00
Colin Walters
bab87cbd9d tests: Drop bare-user on tmpfs negative test
As of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2daf18a7884dc03d5164ab9c7dc3f2ea70638469
the restriction is lifted, FINALLY.
2023-12-03 09:32:36 -05:00
Colin Walters
15d0777bb4
Merge pull request #3104 from cgwalters/s390x-target
bootloader/zipl: Run in target deployment as container if needed
2023-12-01 16:21:34 -05:00
Colin Walters
c3aa2958c2 bootloader/zipl: Run in target deployment as container if needed
xref https://issues.redhat.com/browse/MGMT-16303

Basically the OCP Assisted installer has now grown code
to try to do OS updates offline post-install, and this means
we need to handle the case of running zipl from the target
root.
2023-12-01 15:06:10 -05:00
Colin Walters
aa635bf559 sysroot: Expose deployment runner outside of selinux
We will use it in e.g. s390x zipl backend.
2023-12-01 15:06:10 -05:00
Joseph Marrero Corchado
e794a0c038
Merge pull request #3103 from cgwalters/tmpfiles-factory-var
tmpfiles: Copy `/usr/share/factory/var` to `/var`
2023-12-01 14:46:39 -05:00
Colin Walters
d3190dbf56 sysroot: Add a method to borrow sysroot fd
For the same reason we have this method on `Repo`.
2023-12-01 14:35:41 -05:00
Colin Walters
744569723d sysroot: Support specifying bwrap arguments
Prep for use with zipl.
2023-12-01 08:15:23 -05:00
Colin Walters
791337fa46 sysroot: Expose deployment container executor internally
Prep for using this for zipl.
2023-11-30 18:14:03 -05:00
Colin Walters
66064d960d tmpfiles: Copy /usr/share/factory/var to /var
This is a pattern we want to encourage.  It's honestly just
way simpler than what rpm-ostree is doing today in auto-synthesizing
individual tmpfiles.d snippets.
2023-11-30 18:11:33 -05:00
Jonathan Lebon
b0be23365b
Merge pull request #3102 from cgwalters/deploy-cleanup-run 2023-11-30 17:34:29 -05:00
Colin Walters
68cc19600b sysroot/deploy: Drop unnecessary g_ptr_array_free
We can just reference the pdata, and autoptr the array.
2023-11-30 14:42:55 -05:00
Colin Walters
31cbcc727f deploy: Use NULL terminated strv
This makes the code simpler and avoids the need
to keep the string array and length in sync.  Prep for
further callers.
2023-11-30 14:42:55 -05:00
Jonathan Lebon
5cc78fd73b
Merge pull request #3100 from cgwalters/misc-finalization 2023-11-29 14:10:22 -05:00
Colin Walters
d3de3a0a88 tests: Add a dedicated finalization test
This one covers `admin lock-finalization --unlock`.
2023-11-28 18:45:11 -05:00
Joseph Marrero Corchado
d24714e390
Merge pull request #3101 from cgwalters/drop-redundant-includes
main: Drop some redundant includes of `ot-main.h`
2023-11-27 21:28:43 -05:00
Colin Walters
0c85e1ff88 main: Drop some redundant includes of ot-main.h
When backporting a patch recently we hit a non-obvious
dependency on another fix for `ot-main.h` includes.  Clean
this up a bit by dropping the redundant includes.
2023-11-27 20:11:34 -05:00
Colin Walters
78905ffb82 man: Two finalization fixes
From PR review.
2023-11-27 13:50:07 -05:00
Colin Walters
12cbb3dd15
Merge pull request #3090 from cgwalters/stabilize-locking
sysroot: Stabilize deployment finalization, add API
2023-11-27 13:48:59 -05:00
Colin Walters
28cc761806 sysroot: Stabilize deployment finalization, add API and CLI
It's about time we do this; deployment finalization locking
is a useful feature.  An absolutely key thing here is that
we've slowly been moving towards the deployments as the primary
"source of truth".

Specifically in bootc for example, we will GC container images
not referenced by a deployment.

This is then neecessary to support a "pull but don't apply automatically" model.

This stabilizes the existing `ostree admin deploy --lock-finalization`
CLI, and adds a new `ostree admin unlock-finalization`.

We still check the old lock file path, but there's a new boolean
value as part of the staged deployment data which is intended
to be the source of truth in the future.  At some point then we
can drop the rpm-ostree lockfile handling.

Closes: https://github.com/ostreedev/ostree/issues/3025
2023-11-27 10:59:56 -05:00
Colin Walters
1ca4f02a69 status: Add error prefix for gpg verification
It's helpful to see which deployment has an error.
2023-11-27 10:59:56 -05:00
Colin Walters
b6f435fe11 tests: Turn off gpg verification for dev builds
Right now `ostree admin status` errors out in this case, but
`rpm-ostree status` doesn't.  The former behavior is probably
more of a bug, work around it for now.
2023-11-27 10:59:56 -05:00
Colin Walters
ff7e7f4767
Merge pull request #3099 from markmc/man-sysroot-readonly
man: improve sysroot.readonly docs
2023-11-27 08:39:35 -05:00
Mark McLoughlin
2cfa8aba72
man: improve sysroot.readonly docs
The explanation of sysroot.readonly is a little confusing - we say
that "everything else is mounted read-only" but it's perhaps clearer
to say /sysroot is mounted read-only.

Also note that read-only is the default with composefs.

Finally, document the option in ostree.repo-config even though it is
now considered legacy - as of commit 22b8e4f9 (#2930) - it is still
commonly seen in repo configs, so users will look to understand
what it means.
2023-11-24 14:27:11 +00:00
Jonathan Lebon
cd1728a4bf
Merge pull request #3098 from jlebon/pr/abort-concurrent 2023-11-21 17:18:17 -05:00
Jonathan Lebon
8002983d45 ci: cancel previous build on PR update
This is an easy way to save CI resources; when a PR is updated, abort
any previous build for that PR to focus on testing the latest push.
2023-11-21 15:33:20 -05:00
Colin Walters
de22914e23
Merge pull request #3097 from cgwalters/symbol-cleanups
Symbol cleanups
2023-11-21 08:34:32 -05:00
Colin Walters
315cbdd38e lib: Don't hardcode year in sample symver section
The 2021 was misleading.
2023-11-20 09:47:40 -05:00
Colin Walters
76e4833de3 devel: Fix symbol versioning number
The .11 was wrong.
2023-11-20 09:45:39 -05:00
Colin Walters
82392e3f17
Merge pull request #3095 from alexlarsson/fix-post-copy-symlinks
Fix admin post-copy handling of symlinks
2023-11-14 17:40:08 -05:00
Alexander Larsson
acb8860088 Fix admin post-copy handling of symlinks
The code to enable fs-verity on an object file was failing with ENOENT
for symlink objects.
2023-11-14 22:36:58 +01:00
Colin Walters
508443f7f4
Merge pull request #3094 from alexlarsson/admin-deploy-post-copy
Add `ostree admin post-copy` command
2023-11-14 09:01:41 -05:00
Alexander Larsson
accb1f0602 Add ostree admin post-copy command
This command will apply fs-verity on all objects that need it and
needs to be called when an ostree deployment has been copied on a
file-by-file basis, which would loose information such as fs-verity.

This is needed by osbuild which works by creating the final image in a
rootfs, and then separately copying that rootfs file-by-file to a
loopback mounted filesystem image.
2023-11-14 10:15:19 +01:00
Eric Curtin
29973774ea
Merge pull request #3091 from cgwalters/fix-soup3
build-sys: Enable libsoup3 by default if installed
2023-11-10 16:39:13 +00:00
Colin Walters
bc62fd5196 unlock: Don't pass options again to overlayfs
There seems to be a tricky regression here with the util-linux
support for the new mount API, plus overlays support for it.

```
[2023-11-09T21:05:30.633Z] Nov 09 21:05:26 qemu0 kola-runext-unlock-transient.sh[2108]: + unshare -m -- /bin/sh -c 'mount -o remount,rw /usr && echo hello from transient unlock >/usr/share/writable-usr-test'
[2023-11-09T21:05:30.633Z] Nov 09 21:05:26 qemu0 kola-runext-unlock-transient.sh[2148]: mount: /usr: mount point not mounted or bad option.
[2023-11-09T21:05:30.633Z] Nov 09 21:05:26 qemu0 kola-runext-unlock-transient.sh[2148]:        dmesg(1) may have more information after failed mount system call.
```

OK this seems related to the new mount API support in util-linux and overlayfs.  From a strace:

```
2095  open_tree(AT_FDCWD, "/usr", OPEN_TREE_CLOEXEC) = 3
2095  mount_setattr(-1, NULL, 0, NULL, 0) = -1 EINVAL (Invalid argument)
...
2095  fspick(3, "", FSPICK_NO_AUTOMOUNT|FSPICK_EMPTY_PATH) = 4
2095  fsconfig(4, FSCONFIG_SET_FLAG, "seclabel", NULL, 0) = 0
2095  fsconfig(4, FSCONFIG_SET_STRING, "lowerdir", "usr", 0) = -1 EINVAL (Invalid argument)
```

I think the core problem here is it's trying to reconfigure the mount with existing options,
but in the new mount namespace we can't see the lowerdir.

Here we really really just want to remount writable.  Telling
util-linux to not pass existing options fixes it.
2023-11-09 20:53:52 -05:00
Colin Walters
331bc17e12
Merge pull request #3093 from cgwalters/rust-alias-stateroot
rust: Add a `stateroot()` alias in the Rust bindings
2023-11-09 15:21:47 -05:00
Colin Walters
c668a8c531 tests: Work around systemd regression for boot id parsing
cc https://github.com/systemd/systemd/issues/29275
2023-11-09 15:10:33 -05:00