Commit Graph

7073 Commits

Author SHA1 Message Date
Jonathan Lebon
31b804f20d admin/state-overlay: Require root and don't lock sysroot
Not required for anything in particular, but it's good to use the right
flags here anyway.
2024-02-06 10:27:34 -05:00
Colin Walters
a05dbb311e syslinux: Avoid double /boot if bootprefix is enabled
This backend always explicitly emitted a `/boot` - but if
the global `sysroot.bootprefix` is enabled, then we can rely
on the outer code doing it.

Luckily this was caught by the unit tests here failing when
enabling `sysroot.bootprefix` by default.
2024-02-05 15:05:10 -05:00
Colin Walters
740413168f
Merge pull request #3150 from travier/grub2-15_ostree-atomic-desktops
grub2-15_ostree: Graceful exit if /etc/default/grub doesn't exist
2024-02-01 08:42:43 -05:00
Colin Walters
a4c5ab11a3
Merge pull request #3152 from cgwalters/ci-bootc
ci: Add a bootc/c9s workflow
2024-01-31 15:44:51 -05:00
Colin Walters
3623f0d805 ci: Add a bootc/c9s workflow
This obsoletes the "just build" on c9s flow, and actually runs
though a bootc install, which exercises more of things.
2024-01-31 14:03:25 -05:00
Timothée Ravier
5203d6df28 grub2-15_ostree: Fix whitespace 2024-01-31 15:41:54 +01:00
Timothée Ravier
c281da8352 grub2-15_ostree: Graceful exit if /etc/default/grub doesn't exist
With the new bootupd installation path in Anaconda, the
`/etc/default/grub` config file is not written anymore as we are only
using BLS configs with new enough bootloaders.

We thus don't need to generate (duplicated) legacy boot entries.

We still need to keep this logic in place in Atomic Desktops
(Silverblue, etc.) until we've actually landed bootupd there and forced
a bootloader update for everybody.

See: https://github.com/fedora-silverblue/issue-tracker/issues/530
See: https://github.com/fedora-silverblue/issue-tracker/issues/120
See: https://fedoraproject.org/wiki/Changes/FedoraSilverblueBootupd
2024-01-31 15:38:32 +01:00
Colin Walters
0b0485c7cc
Merge pull request #3149 from alexlarsson/new-composefs-format
composefs: Bump composefs max version to 1
2024-01-31 08:27:19 -05:00
Alexander Larsson
808f243372 composefs: Bump composefs max version to 1
This generates the new format for whiteout markers which was added in
6.8 (and which will be backported to 6.7). Without this whiteouts
will not work anymore.

This is a slight format change, but will only affect ostree commits
that already were broken (i.e that had whiteouts), and since the
composefs code is still marked experimental I think it is fine to
do this without introducing another format version on the ostree
side.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-31 12:09:35 +01:00
Alexander Larsson
0d9dc2b25d Update submodule: composefs
This updates composefs to 1.0.3 which has support for the
new overlay nesting format.
2024-01-31 12:09:20 +01:00
Colin Walters
75941b7708
Merge pull request #3146 from ericcurtin/ot-admin-builtin-pin-booted-pending-rollback
admin/pin: Add commands to pin booted, pending and rollbacks deployments
2024-01-29 11:33:43 -05:00
Eric Curtin
cda5103abe admin/pin: Add commands to pin booted, pending and rollback deployments
Add new commands to pin the current, staged and previous deployment for
use in automation and scripting. Right now, it's difficult to pin the
current deployment without needing to look into the output of some other
tooling (like rpm-ostree) to get the index of each deployment. This
index also is not consistent - the current deployment could be 0 when
you first boot the system then 1 shortly after. This change makes it
easy to pin the current or future deployment.

Co-authored-by: Robert Sturla <robertsturla@outlook.com>
Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2024-01-29 11:44:20 +00:00
Colin Walters
47213b5617
Merge pull request #3147 from cgwalters/generator-check-run-ostree
generator: Exit if there's no `/run/ostree`
2024-01-27 11:10:31 -05:00
Colin Walters
b9ce0e8980 generator: Exit if there's no /run/ostree
Currently if run in a container image under systemd, we will
incorrectly synthesize a `var.mount` unit even if `ostree-prepare-root`
hasn't run.

The comment here said why we didn't do that before, but that's
for the really legacy embedded-only "ostree-prepare-root-static"
path, and even then I'm pretty sure it was wrong because
the generator here only runs in the *real* root, and we should
have `/run/ostree` at that point.
2024-01-26 18:10:37 -05:00
Eric Curtin
79cb18bdd6
Merge pull request #3145 from smcv/composefs-xattr
tests: Skip composefs test if /var/tmp does not support user xattrs
2024-01-25 23:29:52 +00:00
Simon McVittie
b42f053db9 tests: Skip composefs test if /var/tmp does not support user xattrs
Otherwise, this test fails on Debian 12 (Linux 6.1) kernels if /var/tmp
is a tmpfs. Some autobuilders put the entire build chroot on a tmpfs,
to speed up builds.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-01-24 14:03:18 +00:00
Colin Walters
15b64c24ba
Merge pull request #3143 from yummypeng/main
deploy: Ignore sockets, fifos in /etc/<subdir> during merge
2024-01-22 21:05:44 -05:00
Yuanhong Peng
eb1e9cf768 deploy: Ignore sockets, fifos in /etc/<subdir> during merge
It's a followup of commit e6a560b407.
We should also ignore sockets and fifos in the subdir of /etc.

Signed-off-by: Yuanhong Peng <yummypeng@linux.alibaba.com>
2024-01-22 19:48:59 +08:00
Colin Walters
d1d8f4ab40
Merge pull request #3141 from cgwalters/release
Release 2024.1
2024-01-21 11:00:20 -05:00
Colin Walters
0ce6656add configure: post-release version bump 2024-01-19 17:27:09 -05:00
Colin Walters
3b4f5e36ee Release 2024.1 2024-01-19 17:26:26 -05:00
Colin Walters
19cd8cf1c1
Merge pull request #3135 from ericcurtin/aboot-documentation
doc: Add section about ostree and aboot
2024-01-11 11:57:22 -05:00
Colin Walters
6031f1c022
Merge pull request #3120 from jlebon/pr/state-overlays
Add concept of state overlays
2024-01-11 11:56:44 -05:00
Jonathan Lebon
e233d0236f build(deps): bump libglnx from aff1eea to b415d046
Bumps libglnx from `aff1eea` to `b415d046`.

For https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/52.

Update submodule: libglnx
2024-01-10 15:41:14 -05:00
Jonathan Lebon
92b1a27202 Add concept of state overlays
In the OSTree model, executables go in `/usr`, state in `/var` and
configuration in `/etc`. Software that lives in `/opt` however messes
this up because it often mixes code *and* state, making it harder to
manage.

More generally, it's sometimes useful to have the OSTree commit contain
code under a certain path, but still allow that path to be writable by
software and the sysadmin at runtime (`/usr/local` is another instance).

Add the concept of state overlays. A state overlay is an overlayfs
mount whose upper directory, which contains unmanaged state, is carried
forward on top of a lower directory, containing OSTree-managed files.

In the example of `/usr/local`, OSTree commits can ship content there,
all while allowing users to e.g. add scripts in `/usr/local/bin` when
booted into that commit.

Some reconciliation logic is executed whenever the base is updated so
that newer files in the base are never shadowed by a copied up version
in the upper directory. This matches RPM semantics when upgrading
packages whose files may have been modified.

For ease of integration, this is exposed as a systemd template unit which
any downstream distro/user can enable. The instance name is the mountpath
in escaped systemd path notation (e.g.
`ostree-state-overlay@usr-local.service`).

See discussions in https://github.com/ostreedev/ostree/issues/3113 for
more details.
2024-01-09 23:20:41 -05:00
Jonathan Lebon
062cf603bd
Merge pull request #3136 from ericcurtin/pr-3134-feedback 2024-01-09 11:40:58 -05:00
Eric Curtin
477d472c36 status: Rename query-booted to is-default
This is a tool to check if we are booted as default or not, just a
rename before it becomes widely used. We also shortened the '-h' output
for this.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2024-01-09 15:24:34 +00:00
Colin Walters
b79a2e16a0
Merge pull request #3134 from ericcurtin/query-boot-real
status: Introduce tool to quickly check if we are booted as default
2024-01-08 13:14:50 -05:00
Colin Walters
87a0aba94c
Merge pull request #3133 from cgwalters/boot-complete-rollback
systemd/ostree-boot-complete: Start earlier
2024-01-08 07:38:53 -05:00
Eric Curtin
46bae54b1d status: Fix --skip-signatures description
It was a copy-paste of another description, rather than it's own.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2024-01-05 18:18:22 +00:00
Eric Curtin
c13aef97c6 man: Add ostree admin status man page CLI options.
Document the various CLI options.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2024-01-05 18:17:38 +00:00
Eric Curtin
1397ee2b7a status: Introduce tool to quickly check if we are booted as default
Generally in ostree based systems you would expect to boot into
deployment 0, in rollback conditions triggered by greenboot-related
rollbacks this might not be the case. This is a tool to detect this.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2024-01-05 17:40:41 +00:00
Eric Curtin
cd308d5751 doc: Add section about ostree and aboot
Android Bootloader is a standard of how Android devices should implement
their bootloaders, we also use it in CentOS Automotive Stream
Distribution for some ARM boards. Here is some documentation on how
ostree works with this.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2024-01-05 17:34:09 +00:00
Colin Walters
501a0775aa
Merge pull request #3132 from ericcurtin/query-boot
status: Fix build without GPGME
2024-01-05 12:22:57 -05:00
Colin Walters
852db03843 systemd/ostree-boot-complete: Start earlier
Prep for changing this service to perform state computations
such as "is this boot the default, or did we get rolled back"
that can be used by higher level tools.
2024-01-05 11:02:08 -05:00
Colin Walters
eb4fb917fb systemd/ostree-boot-complete: Add ConditionKernelCommandLine=ostree
In practice we don't enable this unit except via our generator,
but let's do this on general principle.
2024-01-05 11:02:03 -05:00
Eric Curtin
37971a9d54 status: Fix build without GPGME
If OSTREE_DISABLE_GPGME is not built in set remote to NULL.

The ostree_repo_signature_verify_commit_data path is irrelevant in the
no gpg case anyway. Having this set as NULL ensures an error gets
thrown early.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2024-01-05 14:52:11 +00:00
Eric Curtin
ac8638f3e4
Merge pull request #3131 from cgwalters/status-use-remote
status: Pass correct remote name when verifying
2024-01-05 14:28:47 +00:00
Colin Walters
4d06e98e69
Merge pull request #3130 from jlebon/pr/autoprune-aarch64-dtb
lib/deploy: Round to block size in early prune space check
2024-01-04 15:57:08 -05:00
Colin Walters
e95109b3ed status: Add an option to skip signature verification
Since it's really expensive in some cases.
2024-01-04 14:02:08 -05:00
Colin Walters
24bf5b7d11 status: Pass correct remote name when verifying
The default `ostree admin status` tries to do signature
verification, but doesn't error out if that fails.

However, an extremely longstanding bug here is that we passed
the "osname" aka stateroot instead of the remote name.  This
happens to work for e.g. Fedora Silverblue today, where they
are the same.  It doesn't work on FCOS (remote = fedora, stateroot = fedora-coreos).
2024-01-04 13:55:14 -05:00
Jonathan Lebon
cc5747a605 lib/deploy: Add safety margin in early prune space check
There are a few things the estimator doesn't account for, e.g. writing
the new BLS entries. Rather than trying to perfect it (since I think we
should change approach entirely -- see previous commit message), just
add a 1M margin to the space check.
2024-01-04 13:07:08 -05:00
Jonathan Lebon
4982306e67 lib/deploy: Round to block size in early prune space check
When we estimate how much space a new bootcsum dir will use, we
weren't accounting for the space overhead from files not using the
last filesystem block completely. This doesn't matter much if counting
a few files, but e.g. on FCOS aarch64, we include lots of small
devicetree blobs in the bootfs. That loss can add up to enough for the
`fallocate()` check to pass but copying still hitting `ENOSPC` later on.

I think a better fix here is to change approach entirely and instead
refactor `install_deployment_kernel()` so that we can call just the
copying bits of it as part of the early prune logic. We'll get a more
accurate assessment and it's not lost work since we won't need to
recopy later on. Also this would not require having to keep in sync the
estimator and the install bits.

That said, this is blocking FCOS releases, so I went with a more tactical
fix for now.

Fixes: https://github.com/coreos/fedora-coreos-tracker/issues/1637
2024-01-04 12:57:43 -05:00
Colin Walters
9faf55699a
Merge pull request #3129 from cgwalters/fix-unlock-composefs-compat
prepare-root: Fix composefs + ostree admin unlock --hotfix compat
2024-01-04 10:40:09 -05:00
Eric Curtin
6a339ac6eb
Merge pull request #3128 from cgwalters/hotfix-composefs
switchroot: use shared constant for unlock --hotfix
2024-01-04 12:05:02 +00:00
Colin Walters
dd33cc65e0 switchroot: use shared constant for unlock --hotfix
So it's easier to link the two bits of code.
2024-01-03 14:33:55 -05:00
Colin Walters
a1c1c0b500 prepare-root: Fix composefs + ostree admin unlock --hotfix compat
There's a test case for `ostree admin unlock --hotfix` that
runs in FCOS, not here; it breaks when enabling composefs.

The reason is because the composefs is mounted readonly, and
we tried to remount it writable.  Instead of trying to remount
the rootfs writable at this point forcibly, honor the
*real* sysroot readonly state flag from the underlying FS before
we mounted the composefs.

Note that in FCOS derivatives we always have the root mounted
writable via `rw` on the kernel cmdline and this is the default
general expectation now with ostree usage.
2024-01-03 14:01:38 -05:00
Colin Walters
40b143f494
Merge pull request #3127 from cgwalters/composefs-doc-toplevel-chattr
docs/composefs: Add note about toplevel dirs
2024-01-02 15:53:01 -05:00
Joseph Marrero Corchado
ba12a168be
Merge pull request #3119 from cgwalters/zipl-fix-nul-term
zipl: A few fixes
2024-01-02 15:49:24 -05:00
Colin Walters
712eecad4f docs/composefs: Add note about toplevel dirs
Just thinking about trying to land this, I think some people
may hit this one.
2024-01-02 15:18:37 -05:00