Commit Graph

6623 Commits

Author SHA1 Message Date
Colin Walters
20b8cb174c Move prepare-root karg helpers into otcore, add unit tests
Add long overdue unit testing coverage for this, which
at least slightly closes out the android boot CI gap.

Actually, this *copies* the karg parsing code into otcore because
it now uses glib, which we're not yet using in the static
prepare-root.  It's pretty tempting to drop support for the
static prepare root entirely.  But for now we'll live with some
code duplication.
2023-08-23 17:11:10 -04:00
Joseph Marrero Corchado
4451949213
Merge pull request #2997 from cgwalters/test-cleanups-1
tests/destructive: Port more to xshell
2023-08-23 10:38:16 -04:00
Joseph Marrero Corchado
37f247da02
Merge pull request #2999 from cgwalters/add-oscore-units
tests: Add otcore unit tests
2023-08-23 10:37:48 -04:00
Eric Curtin
aa8ad204d5
Merge pull request #3001 from cgwalters/misc-c99-style-4
Misc c99 style 4
2023-08-23 00:06:14 +01:00
Colin Walters
75a43deb30 cmd/grub2-generate: Port to C99 style
Just keeping up momentum.
2023-08-22 17:51:33 -04:00
Colin Walters
767ca134b5 cmd/init: Port to C99 style
Just keeping up momentum.
2023-08-22 17:49:28 -04:00
Joseph Marrero Corchado
e3ef72ea8a
Merge pull request #3000 from cgwalters/test-inst-update
tests/inst: Update to latest ostree-ext
2023-08-22 16:56:46 -04:00
Colin Walters
6eeb8b5623
Merge pull request #2995 from ostreedev/dependabot/submodules/composefs-1aed878
build(deps): bump composefs from `a6e827d` to `1aed878`
2023-08-22 16:41:00 -04:00
Eric Curtin
e751dd9a7b
Merge pull request #2998 from cgwalters/disable-composefs-too-old
build-sys: Disable composefs on too-old Linux headers
2023-08-22 20:08:26 +01:00
Colin Walters
facb9a1a60 tests/inst: Update to latest ostree-ext
(And glib, etc.)
2023-08-22 14:23:56 -04:00
Colin Walters
7c82340d08
Merge pull request #2975 from ostreedev/androidboot-single-slot-mode
prepare-root: On a non-A/B androidboot system, boot system slot a
2023-08-22 14:11:50 -04:00
Colin Walters
e3f0c4d49c tests: Add otcore unit tests
This just stubs out the basic infrastructure, to be expanded upon.
2023-08-22 13:04:46 -04:00
Colin Walters
90e54619df build-sys: Disable composefs on too-old Linux headers
This should fix the build with Google OSS-fuzz which currently
uses an old Ubuntu.
2023-08-22 12:48:06 -04:00
Eric Curtin
6e9e50d87c prepare-root: Changes made to find_proc_cmdline_key
Used strspn based on feedback from similar function.
2023-08-22 16:43:20 +01:00
Eric Curtin
650a053795 prepare-root: On a non-A/B androidboot system, boot system slot a
Sometimes android bootloaders boot in a nonab way:

  https://source.android.com/docs/core/ota/nonab

In this case, "androidboot." kargs are present but not
"androidboot.slot_suffix" specifically.

In this case, rather than getting stuck in a partially booted
environment, boot system slot a.
2023-08-22 16:43:20 +01:00
Eric Curtin
16b97d8a40
Merge pull request #2996 from cgwalters/misc-c99-style-3
cli/set-origin: Port to C99 style
2023-08-22 16:08:10 +01:00
Colin Walters
578c87e7ef tests/destructive: Port more to xshell
Just keeping up momentum.
2023-08-22 09:52:43 -04:00
Colin Walters
8f302f2a46 cli/set-origin: Port to C99 style
Just keeping up momentum.
2023-08-22 09:44:39 -04:00
dependabot[bot]
69d7d837be
build(deps): bump composefs from a6e827d to 1aed878
Bumps [composefs](https://github.com/containers/composefs) from `a6e827d` to `1aed878`.
- [Release notes](https://github.com/containers/composefs/releases)
- [Commits](a6e827df2d...1aed8781d6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 12:59:46 +00:00
Eric Curtin
ee1e585ee9
Merge pull request #2993 from cgwalters/misc-c99-style-2
Misc c99 style 2
2023-08-18 22:12:24 +01:00
Colin Walters
22b47781fb checkout: Port to C99 style
Just keeping up momentum.
2023-08-18 15:39:45 -04:00
Colin Walters
f7786e759f
Merge pull request #2990 from cgwalters/init-is-stateroot
Two s/osname/stateroot/ patches
2023-08-18 08:49:31 -04:00
Colin Walters
27266f90d9 lzma: Port to C99 style
Just keeping up momentum.
2023-08-17 21:49:33 -04:00
Eric Curtin
722fc2d060
Merge pull request #2991 from cgwalters/misc-c99-style
Misc c99 style
2023-08-18 00:19:21 +01:00
Colin Walters
9f39f78e83 remote-add: Port to c99 style
- Drop `goto out`
- Use declare-and-initialize
2023-08-17 17:03:17 -04:00
Colin Walters
9036c96a04 admin: Port to c99 style
- Drop `goto out`
- Use declare-and-initialize
2023-08-17 16:59:41 -04:00
Colin Walters
f4e56b910f admin-deploy: Add --stateroot as alias for --os
To further help deprecate the confusing "osname" terminology.
2023-08-17 16:49:09 -04:00
Colin Walters
9d5ccfefff Add ostree admin stateroot-init as alias for os-init
To further help deprecate the confusing "osname" terminology.
2023-08-17 16:46:02 -04:00
Eric Curtin
9ac938c4ff
Merge pull request #2989 from cgwalters/lock-timeout-longer
repo: Bump lock timeout to 5 minutes
2023-08-17 14:38:30 +01:00
Colin Walters
f4b420492f
Merge pull request #2973 from ostreedev/dependabot/submodules/composefs-a6e827d
build(deps): bump composefs from `1704f82` to `a6e827d`
2023-08-17 09:36:20 -04:00
Colin Walters
e88ec69eef repo: Bump lock timeout to 5 minutes
And update the doc text to talk about having a timeout at all
by default being a mistake.

Timeouts are really best handled at a higher level; if two processes
are contending for the ostree lock and one is actually frozen,
resolving this is something an admin may want to handle and introspect/debug
instead of having the waiter error out.

Most people using ostree are doing it in a way in which they have
higher level timeouts (e.g. on a container pod).
2023-08-17 08:28:16 -04:00
Eric Curtin
55121cc4df
Merge pull request #2988 from cgwalters/prepare-root-binding-key
prepare-root: Minor clarifications
2023-08-16 23:20:15 +01:00
Eric Curtin
d648eea631
Merge pull request #2987 from cgwalters/prefix-stage-deploy
deploy: Add some error prefixing
2023-08-16 22:37:06 +01:00
Colin Walters
94cb37cb30 prepare-root: Minor clarifications
No functional changes.
2023-08-16 16:56:12 -04:00
Colin Walters
25a458b94b deploy: Add some error prefixing
We saw a bare
`Txn Rebase on <osname> failed: Failed to find kernel in /usr/lib/modules, /usr/lib/ostree-boot or /boot`
which isn't bad, but it'd be better to be a bit more specific.
2023-08-16 16:16:24 -04:00
Eric Curtin
8712a46756
Merge pull request #2985 from cgwalters/cleanup-proc-cmdline
switchroot,generator: Only read /proc/cmdline once
2023-08-16 19:31:35 +01:00
Colin Walters
083bad8cf2
Merge pull request #2984 from alexlarsson/prepare-root-no-raw-key
prepare-root: Only support base64 formated public key files
2023-08-16 09:05:39 -04:00
Colin Walters
28aed49d87 switchroot,generator: Only read /proc/cmdline once
Change the helper function to parse an existing cmdline instead
of potentially reading `/proc/cmdline` multiple times.
2023-08-16 09:05:19 -04:00
Alexander Larsson
0a79b3b1e2 prepare-root: Only support base64 formated public key files
I've updated the automotive samples to not use the raw format, so
there is no use anymore to support both formats, as base64 is strictly
better.
2023-08-16 11:00:43 +02:00
Alexander Larsson
c94388f3dd
Merge pull request #2980 from cgwalters/prepare-root-minor
Prepare root minor
2023-08-16 10:56:20 +02:00
Colin Walters
871d32a591 prepare-root: Use ptrarray, not linked list
Linked lists are a data structure with only very obscure
use cases, and this is a classic one where since we're appending
it's O(N^2) behavior.

Also we were leaking the memory.

It's more ergonomic, clearer and efficient to use a ptrarray.
2023-08-14 14:36:50 -04:00
Colin Walters
678bfcd934 prepare-root: Check for empty string, not strlen > 0
No point in doing a full strlen, we can just check the first byte.
Also, invert the conditional using `continue` to avoid another
level of indentation.
2023-08-14 14:30:42 -04:00
Colin Walters
bea5d897a8 prepare-root: Use declare-and-initialize
This is our default style.
2023-08-14 14:29:39 -04:00
Joseph Marrero Corchado
3620d3c709
Merge pull request #2979 from cgwalters/enabled-discussions
README.md: Drop dead mailing list, link to GH discussions
2023-08-14 11:47:05 -04:00
Colin Walters
d324f6843b
Merge pull request #2974 from alexlarsson/composefs-config-file
Read composefs configuration from initrd instead of commandline
2023-08-14 11:46:38 -04:00
Colin Walters
f1c1f819ff README.md: Drop dead mailing list, link to GH discussions
While I resisted taking the next step in binding ourselves
more to GH with discussions...it's way, way better than answering
questions out of band in private (also proprietary) chats.

We haven't been successful in using the GNOME discussion forums.
2023-08-14 09:49:41 -04:00
Alexander Larsson
81fa214155 Read composefs configuration from initrd instead of commandline
This drops the `ot-composefs` kernel commandline in favour
of a `[composefs]` section in the `prepare-rootfs.conf` file.

You can set `composefs.enabled` to `signed`, `yes`, `no` or `maybe`,
with `maybe` being the default.

You can also set `composefs.keypath` (or rely on the default
`/etc/ostree/initramfs-root-binding.key`) to point to ed25519 public
keys, one of which which the commit must be signed with, or boot
fails.

The ostree dracut module adds `/etc/ostree/initramfs-root-binding.key`
to the initrd if it exists.

NOTE: This drop the option to define a digest in the commandline.
However, that was currently unused
(i.e. ComposefsConfig.expected_digest was never read).

Additionally it very hard to actually store the composefs digest in
the initrd, as the initrd is typically part of the commit and thus the
composefs. It may be possible to handle this, but lets add it back
when we know exactly how that will work.
2023-08-14 12:27:47 +02:00
Eric Curtin
2cc6b53199
Merge pull request #2966 from cgwalters/ostree-admin-edit
Add `admin set-default`
2023-08-08 14:24:35 +01:00
dependabot[bot]
b108e24c31
build(deps): bump composefs from 1704f82 to a6e827d
Bumps [composefs](https://github.com/containers/composefs) from `1704f82` to `a6e827d`.
- [Release notes](https://github.com/containers/composefs/releases)
- [Commits](1704f823db...a6e827df2d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-08 12:05:10 +00:00
Eric Curtin
c57c00569c
Merge pull request #2958 from cgwalters/deploy-loosen-etc-usretc
deploy: Support an empty `/etc` and populated `/usr/etc`
2023-08-05 16:48:28 +01:00