ostree.git
2 years agorepo: Clarify when we fail to parse a remote
Colin Walters [Mon, 24 Jul 2023 12:52:49 +0000 (08:52 -0400)]
repo: Clarify when we fail to parse a remote

This would have directly pointed at the failing config file.

2 years agosysroot: Add a bit more error prefixing
Colin Walters [Mon, 24 Jul 2023 12:48:51 +0000 (08:48 -0400)]
sysroot: Add a bit more error prefixing

While an error message I saw was pretty clear, this would
be even more explicit.

2 years agoMerge pull request #2950 from cgwalters/generator-cleanup
Eric Curtin [Mon, 24 Jul 2023 09:52:41 +0000 (10:52 +0100)]
Merge pull request #2950 from cgwalters/generator-cleanup

generator: Some cleanup

2 years agosrc/generator: Move all logic into libostree-1.so
Colin Walters [Sun, 23 Jul 2023 14:47:19 +0000 (10:47 -0400)]
src/generator: Move all logic into libostree-1.so

This pushes down the code for parsing the `ostree=` cmdline
in the generator into code that's part of libostree-1.so.

This is prep for using logic shared in libotcore.la.

But in general it's just cleaner to also keep the binary
entrypoint to just be a trampoline into the C library.

2 years agogenerator: Stop creating `/run/ostree-booted`
Colin Walters [Sun, 23 Jul 2023 14:40:20 +0000 (10:40 -0400)]
generator: Stop creating `/run/ostree-booted`

This must have always been dead code.  We're trying to iterate
towards a place where it's only `ostree-prepare-root.c` which
parses the `ostree=` kernel argument, and canonically sets up
`/run/ostree-booted`.

2 years agoMerge pull request #2942 from ostreedev/android-bootloader-parsing
Eric Curtin [Thu, 20 Jul 2023 20:58:11 +0000 (21:58 +0100)]
Merge pull request #2942 from ostreedev/android-bootloader-parsing

bootloader: fold all Android Bootloader specific logic into prepare-root

2 years agoMerge pull request #2946 from cgwalters/add-inode-fix-feature
Colin Walters [Thu, 20 Jul 2023 19:12:31 +0000 (15:12 -0400)]
Merge pull request #2946 from cgwalters/add-inode-fix-feature

Add an always-on `inode64` feature

2 years agoAdd an always-on `inode64` feature
Colin Walters [Thu, 20 Jul 2023 13:13:43 +0000 (09:13 -0400)]
Add an always-on `inode64` feature

As I (and others) will be backporting the fix in
https://github.com/ostreedev/ostree/pull/2874/commits/de6fddc6adee09a93901243dc7074090828a1912
pretty far, I want a way for sysadmins and OS builders to
be able to reliably see when their version of ostree has this fix
(Because comparing version numbers isn't portable).

2 years agobootloader: fold all Android Bootloader specific logic into prepare-root
Eric Curtin [Thu, 20 Jul 2023 10:32:30 +0000 (11:32 +0100)]
bootloader: fold all Android Bootloader specific logic into prepare-root

Now that we use androidboot.slot_suffix karg to determine whether we
boot into /ostree/root.a or /ostree/root.b, we can use ostree= karg
simply for parsing the stateroot, although we will still boot into
what's pointed to by /ostree/root.a or /ostree/root.b.

2 years agoMerge pull request #2943 from cgwalters/mount-cleanup
Joseph Marrero Corchado [Wed, 19 Jul 2023 14:35:27 +0000 (10:35 -0400)]
Merge pull request #2943 from cgwalters/mount-cleanup

prepare-root: Drop code mounting `/proc`

2 years agoMerge pull request #2944 from cgwalters/prepare-root-more-cleanup
Joseph Marrero Corchado [Wed, 19 Jul 2023 14:34:46 +0000 (10:34 -0400)]
Merge pull request #2944 from cgwalters/prepare-root-more-cleanup

prepare-root: Drop more dead code

2 years agoprepare-root: Drop more dead code
Colin Walters [Wed, 19 Jul 2023 13:13:53 +0000 (09:13 -0400)]
prepare-root: Drop more dead code

Most of this was used for the old composefs signature model.  We
now reuse the core signature code and link to glib, so we don't
need reimplementations of hex strings and reading files.

2 years agoprepare-root: Drop code mounting `/proc`
Colin Walters [Wed, 19 Jul 2023 13:12:10 +0000 (09:12 -0400)]
prepare-root: Drop code mounting `/proc`

This must be done by the init process here; it was always
dead code in the initramfs path.

We keep the copy of this code in the now-forked -static.c.

2 years agoMerge pull request #2938 from cgwalters/dedup-ostree-parsing
Eric Curtin [Tue, 18 Jul 2023 13:35:45 +0000 (14:35 +0100)]
Merge pull request #2938 from cgwalters/dedup-ostree-parsing

generator: Deduplicate ostree= karg parsing

2 years agoMerge pull request #2939 from cgwalters/ed25519-cleanups
Eric Curtin [Tue, 18 Jul 2023 13:33:58 +0000 (14:33 +0100)]
Merge pull request #2939 from cgwalters/ed25519-cleanups

sign-ed25519: Minor cleanups

2 years agogenerator: Deduplicate ostree= karg parsing
Colin Walters [Mon, 17 Jul 2023 17:48:35 +0000 (13:48 -0400)]
generator: Deduplicate ostree= karg parsing

Avoid having two copies of a regular expression for parsing
the `ostree=` kernel argument.  Because the `ostree-system-generator`
binary already has access to the internals because it's implemented
in the shared library, expose the sysroot version internally
and use that.

Motivated by an attempt to change one of these copies but not
the other.

2 years agosign-ed25519: Don't set sk unless we've validated it
Colin Walters [Tue, 18 Jul 2023 11:54:03 +0000 (07:54 -0400)]
sign-ed25519: Don't set sk unless we've validated it

The semantics of this function now keep the key assigned
even if we fail to validate it, which is ugly.  Only assign
the key after verifying its length.

2 years agosign-ed25519: Add some comments for data structure
Colin Walters [Tue, 18 Jul 2023 11:53:37 +0000 (07:53 -0400)]
sign-ed25519: Add some comments for data structure

Like poor man's generics.

2 years agosign-ed25519: More verbose errors for invalid length
Colin Walters [Mon, 17 Jul 2023 22:03:54 +0000 (18:03 -0400)]
sign-ed25519: More verbose errors for invalid length

Add a helper to compare lengths which includes the found
and expected values.  Use it consistently.

The error message "Incorrect" is misleading; one might think
one had the *wrong* key.  "Ill-formed" makes it clearer that
we're not parsing it at all.

2 years agotests: Remove dead references to "SEED"
Colin Walters [Mon, 17 Jul 2023 21:56:56 +0000 (17:56 -0400)]
tests: Remove dead references to "SEED"

Nothing uses this.

2 years agoMerge pull request #2937 from ericcurtin/ostree2androidboot.slot_suffix
Colin Walters [Mon, 17 Jul 2023 13:46:02 +0000 (09:46 -0400)]
Merge pull request #2937 from ericcurtin/ostree2androidboot.slot_suffix

android-boot: Remove dependency on ostree= karg, use androidboot.slot_suffix=

2 years agoRemove steal_pointer and steal_pointer_impl as we link in glib now
Eric Curtin [Mon, 17 Jul 2023 12:23:27 +0000 (13:23 +0100)]
Remove steal_pointer and steal_pointer_impl as we link in glib now

These were necessary to keep initramfs small, but now we link in glib
anyway so these functions are now redundant.

2 years agoandroid-boot: Remove dependency on ostree= karg, use androidboot.slot_suffix=
Eric Curtin [Mon, 17 Jul 2023 12:22:49 +0000 (13:22 +0100)]
android-boot: Remove dependency on ostree= karg, use androidboot.slot_suffix=

Given the kernel argument androidboot.slot_suffix= is required in
Android AB updates [1] there is no need to check for ostree= or ostree=aboot
at all in the aboot case. This also ensures if the dependancy on ostree=
is removed, the android-boot technique will work regardless.

[1]: https://source.android.com/docs/core/ota/ab/ab_implement

2 years agoMerge pull request #2936 from cgwalters/sign-from-file
Eric Curtin [Sun, 16 Jul 2023 21:22:20 +0000 (22:22 +0100)]
Merge pull request #2936 from cgwalters/sign-from-file

commit: Add `--sign-from-file`

2 years agoMerge pull request #2931 from cgwalters/prepare-root-man
Eric Curtin [Sun, 16 Jul 2023 20:59:32 +0000 (21:59 +0100)]
Merge pull request #2931 from cgwalters/prepare-root-man

man: Add ostree-prepare-root

2 years agoMerge pull request #2929 from cgwalters/prepare-root-drop-pivot
Eric Curtin [Sat, 15 Jul 2023 16:33:56 +0000 (17:33 +0100)]
Merge pull request #2929 from cgwalters/prepare-root-drop-pivot

prepare-root: Drop dead `pivot_root` code

2 years agoMerge pull request #2927 from cgwalters/sysroot-errprefix-bootlinks
Eric Curtin [Sat, 15 Jul 2023 16:31:53 +0000 (17:31 +0100)]
Merge pull request #2927 from cgwalters/sysroot-errprefix-bootlinks

sysroot: Add some error prefixing for bootversion

2 years agoMerge pull request #2935 from cgwalters/prepare-root-config4
Colin Walters [Sat, 15 Jul 2023 13:52:11 +0000 (09:52 -0400)]
Merge pull request #2935 from cgwalters/prepare-root-config4

prepare-root: Refactor composefs config handling

2 years agocommit: Add `--sign-from-file`
Colin Walters [Fri, 14 Jul 2023 23:20:45 +0000 (19:20 -0400)]
commit: Add `--sign-from-file`

Passing the private key via a direct command line argument
is just a bad idea because it's highly likely to get logged
or appear in `ps`.
Spotted in review of work for composefs signatures.

2 years agoprepare-root: Refactor composefs config handling
Colin Walters [Thu, 13 Jul 2023 20:37:41 +0000 (16:37 -0400)]
prepare-root: Refactor composefs config handling

- Convert the current enum into a struct, using `OtTristate` and
  two member variables (expected signature and digest)
- Factor out a helper function to parse this config
- Clean up the logging by consistently using `composefs:` as a prefix
- Add more assertions to more strictly verify our runtime state
  since this is security relevant

2 years agoMerge pull request #2934 from cgwalters/enable-composefs-default
Eric Curtin [Fri, 14 Jul 2023 15:40:42 +0000 (16:40 +0100)]
Merge pull request #2934 from cgwalters/enable-composefs-default

build-sys: Enable composefs at *build time* by default

2 years agobuild-sys: Enable composefs at *build time* by default
Colin Walters [Fri, 14 Jul 2023 14:34:46 +0000 (10:34 -0400)]
build-sys: Enable composefs at *build time* by default

There's no additional dependencies, and it's a small amount
of new code.

The riskiest thing is the changes to ostree-prepare-root, but
I believe that things are in a good state now there.

Again, this just enables it at *build time* - it's still
off at runtime by default.

2 years agoMerge pull request #2928 from cgwalters/prepare-root-config
Colin Walters [Fri, 14 Jul 2023 14:26:25 +0000 (10:26 -0400)]
Merge pull request #2928 from cgwalters/prepare-root-config

More prepare-root cleanups

2 years agoMerge pull request #2932 from cgwalters/aboot-fix-nullderef
Eric Curtin [Fri, 14 Jul 2023 12:48:17 +0000 (13:48 +0100)]
Merge pull request #2932 from cgwalters/aboot-fix-nullderef

mount: Fix gcc -fanalyzer warning for parsing androidboot.slot_suffix

2 years agomount: Fix gcc -fanalyzer warning for parsing androidboot.slot_suffix
Colin Walters [Fri, 14 Jul 2023 10:51:34 +0000 (06:51 -0400)]
mount: Fix gcc -fanalyzer warning for parsing androidboot.slot_suffix

If the karg wasn't present, we'd do a NULL deref which is undefined
behavior.

2 years agoMerge pull request #2920 from ostreedev/dependabot/submodules/composefs-1704f82
Colin Walters [Thu, 13 Jul 2023 21:53:10 +0000 (17:53 -0400)]
Merge pull request #2920 from ostreedev/dependabot/submodules/composefs-1704f82

build(deps): bump composefs from `ac729b5` to `1704f82`

2 years agoman: Add ostree-prepare-root
Colin Walters [Thu, 13 Jul 2023 21:20:32 +0000 (17:20 -0400)]
man: Add ostree-prepare-root

Add an overdue man page that describes this.  Prep for also
documenting composefs things here.

2 years agoUse /run/ostree-booted metadata for sysroot-ro state passing
Colin Walters [Thu, 13 Jul 2023 11:56:29 +0000 (07:56 -0400)]
Use /run/ostree-booted metadata for sysroot-ro state passing

Just like we did with composefs, use the new metadata instead
of a "stamp file".

2 years agoprepare-root: Drop dead `pivot_root` code
Colin Walters [Thu, 13 Jul 2023 12:27:41 +0000 (08:27 -0400)]
prepare-root: Drop dead `pivot_root` code

I think this was only ever used in the "static pid1" path which
is now split out into a separate file.

We always expect that e.g. systemd does the switchroot in
the initramfs, so drop this dead code.

2 years agoremount: Use new metadata in `/run/ostree-booted` for composefs
Colin Walters [Thu, 13 Jul 2023 11:47:32 +0000 (07:47 -0400)]
remount: Use new metadata in `/run/ostree-booted` for composefs

Since we now have a generalized more structured way of serializing
state in the initramfs instead of "stamp files", use it for
passing the composefs state.

2 years agoremount: Don't overwrite /run/ostree-booted
Colin Walters [Thu, 13 Jul 2023 11:28:07 +0000 (07:28 -0400)]
remount: Don't overwrite /run/ostree-booted

Since it should always be written in the initramfs.

2 years agoprepare-root: Add metadata for composefs to `/run/ostree-booted`
Colin Walters [Wed, 12 Jul 2023 20:48:56 +0000 (16:48 -0400)]
prepare-root: Add metadata for composefs to `/run/ostree-booted`

Particularly for the signature case, having this metadata
acts as a reliable "proof of execution" of the signature verification
code (as opposed to parsing a log file or so).

Besides that, this is also just a stronger check for "we're using
composefs" instead of checking for "overlayfs on /".

2 years agoprepare-root: Use constant for ed25519 signature
Colin Walters [Wed, 12 Jul 2023 12:35:17 +0000 (08:35 -0400)]
prepare-root: Use constant for ed25519 signature

Minor cleanup.

2 years agoMerge pull request #2926 from cgwalters/otcore-cfs-constants
Colin Walters [Thu, 13 Jul 2023 11:10:59 +0000 (07:10 -0400)]
Merge pull request #2926 from cgwalters/otcore-cfs-constants

prepare-root: A few cleanups

2 years agosysroot: Add some error prefixing for bootversion
Colin Walters [Wed, 12 Jul 2023 23:29:20 +0000 (19:29 -0400)]
sysroot: Add some error prefixing for bootversion

This came up in https://issues.redhat.com/browse/OCPBUGS-15955
and I'm 90% sure it's this readlink failing, but let's make
it extra clear.

2 years agoprepare-root: Drop unused verity flag querying
Colin Walters [Tue, 11 Jul 2023 22:02:51 +0000 (18:02 -0400)]
prepare-root: Drop unused verity flag querying

This logic got pushed down into libcomposefs.

2 years agoprepare-root: Use otutil and g_print
Colin Walters [Tue, 11 Jul 2023 22:00:03 +0000 (18:00 -0400)]
prepare-root: Use otutil and g_print

Now that we link to libotutil (and glib) we don't need separate
handling for conditionalizing on the presence of systemd.

Further, there's no value in `sd_journal_send(MESSAGE=)` over
just printing to stdout.

2 years agoAdd an internal constant for the composefs image name
Colin Walters [Tue, 11 Jul 2023 21:50:43 +0000 (17:50 -0400)]
Add an internal constant for the composefs image name

Just a minor cleanup.

2 years agoMerge pull request #2924 from cgwalters/drop-syntax-check
Dan Nicholson [Tue, 11 Jul 2023 19:31:14 +0000 (13:31 -0600)]
Merge pull request #2924 from cgwalters/drop-syntax-check

build: Drop `make syntax-check`

2 years agobuild: Drop `make syntax-check`
Colin Walters [Tue, 11 Jul 2023 18:09:42 +0000 (14:09 -0400)]
build: Drop `make syntax-check`

As of lately it emits a ton of errors from `grep` about having `*`
at the start of a line, but more generally it's only generally
found papercut-style issues that aren't worth carrying a distinct
checking system for.

2 years agoMerge pull request #2921 from alexlarsson/composefs-sign-v2
Colin Walters [Tue, 11 Jul 2023 18:09:07 +0000 (14:09 -0400)]
Merge pull request #2921 from alexlarsson/composefs-sign-v2

ostree-prepare-root: Validate ed25519 signatures when requested

2 years agoostree-prepare-root: Validate ed25519 signatures when requested
Alexander Larsson [Fri, 7 Jul 2023 09:29:31 +0000 (11:29 +0200)]
ostree-prepare-root: Validate ed25519 signatures when requested

If requested, by specifying ot-composefs=signed=/path/to/pub.key then
the commit object is validated against the specified ed25519 public
key, and if valid, the composefs digest from the commit object is used
to ensure we boot the right digest.

2 years agoFactor out a libotcore
Colin Walters [Fri, 7 Jul 2023 20:31:58 +0000 (16:31 -0400)]
Factor out a libotcore

This will contain logic shared between ostree-prepare-root
and libostree-1.so.  It will just link to libgio.so, so as
to avoid pulling in e.g. libcurl and other things.

In other words, `ostree-prepare-root` will not link to `libostree-1.so`,
but will pull in just what it needs from this library.

2 years agobuild-sys: Add libsodium to OT_DEP_CRYPTO
Colin Walters [Sat, 8 Jul 2023 19:42:12 +0000 (15:42 -0400)]
build-sys: Add libsodium to OT_DEP_CRYPTO

There's no reason to have these distinct really.  If we're using
libsodium, we want it in the same places we're using openssl.

Prep for further refactoring.

2 years agoMerge pull request #2922 from alexlarsson/openssl-ed25519
Colin Walters [Fri, 7 Jul 2023 19:25:27 +0000 (15:25 -0400)]
Merge pull request #2922 from alexlarsson/openssl-ed25519

Implement ed255519 using openssl too

2 years agolibotutil: Link to crypto libs
Alexander Larsson [Fri, 7 Jul 2023 18:19:59 +0000 (20:19 +0200)]
libotutil: Link to crypto libs

The checksum utils uses the crypto lib, but we're not explicitly linking
to it. I think this is why the CI got this error when using openssl
on debian, during ostree binary linking:

/usr/bin/ld: ./.libs/libotutil.a(libotutil_la-ot-checksum-utils.o): undefined reference to symbol 'EVP_DigestInit_ex@@OPENSSL_3.0.0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libcrypto.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

2 years agoCI: Enable --with-crypto=openssl on debian testing to test openssl signatures
Alexander Larsson [Thu, 6 Jul 2023 16:05:07 +0000 (18:05 +0200)]
CI: Enable --with-crypto=openssl on debian testing to test openssl signatures

2 years agosign-ed25519: Implement sign and verify using openssl
Alexander Larsson [Thu, 6 Jul 2023 15:12:46 +0000 (17:12 +0200)]
sign-ed25519: Implement sign and verify using openssl

libsodium is used if configured to keep the old behaviour, but if
it is not enabled, and openssl is used, then ed25519 is now supported.

2 years agosign-ed25519: Drop some uses of libsodium
Alexander Larsson [Thu, 6 Jul 2023 14:41:30 +0000 (16:41 +0200)]
sign-ed25519: Drop some uses of libsodium

This adds some defines for ed25519 key sizes and drops uses
of the libsodium defines for these, as well as replacing sodium_bin2hex
use with ot_bin2hex. Some code that wes optionally built before are now
always built.

The goal for this is to support both libsodium and openssl.

Also fixes return value of _load_pk_from_stream(). It used
to always return FALSE.

2 years agoMerge pull request #2923 from alexlarsson/fix-composefs-test
Colin Walters [Fri, 7 Jul 2023 15:12:52 +0000 (11:12 -0400)]
Merge pull request #2923 from alexlarsson/fix-composefs-test

tests: Fix composefs test

2 years agotests: Fix composefs test
Alexander Larsson [Thu, 6 Jul 2023 17:31:18 +0000 (19:31 +0200)]
tests: Fix composefs test

- Was using the wrong metadata key
- We were missing setting the canonical commit args which assigns
  e.g. owner uid 0, which is important for reproducibility
- Use the new --print-hex to make things easier to read

2 years agoshow: Add --print-hex
Colin Walters [Fri, 7 Jul 2023 13:00:31 +0000 (09:00 -0400)]
show: Add --print-hex

The default GVariant output for byte arrays is illegible to humans,
and byte arrays are super common for us.

2 years agoMerge pull request #2913 from cgwalters/tmpfile-not-on-revokefs
Joseph Marrero Corchado [Thu, 6 Jul 2023 00:00:30 +0000 (20:00 -0400)]
Merge pull request #2913 from cgwalters/tmpfile-not-on-revokefs

fetcher: Always open tmpfiles in repo (except on FUSE)

2 years agobuild(deps): bump composefs from `ac729b5` to `1704f82`
dependabot[bot] [Wed, 5 Jul 2023 12:48:46 +0000 (12:48 +0000)]
build(deps): bump composefs from `ac729b5` to `1704f82`

Bumps [composefs](https://github.com/containers/composefs) from `ac729b5` to `1704f82`.
- [Release notes](https://github.com/containers/composefs/releases)
- [Commits](https://github.com/containers/composefs/compare/ac729b579dd332938c6ad43ba83b2b896631dad4...1704f823db41b1056cabfba51254f8afa8bae41d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #2918 from ostreedev/dependabot/submodules/composefs-ac729b5
Colin Walters [Wed, 5 Jul 2023 10:26:42 +0000 (06:26 -0400)]
Merge pull request #2918 from ostreedev/dependabot/submodules/composefs-ac729b5

build(deps): bump composefs from `412cb5e` to `ac729b5`

2 years agoMerge pull request #2912 from cgwalters/itest-transactionality-debug
Colin Walters [Wed, 5 Jul 2023 09:47:05 +0000 (05:47 -0400)]
Merge pull request #2912 from cgwalters/itest-transactionality-debug

tests/inst: A few small patches

2 years agoMerge pull request #1633 from cgwalters/pkglibexec-tests
Colin Walters [Wed, 5 Jul 2023 08:51:29 +0000 (04:51 -0400)]
Merge pull request #1633 from cgwalters/pkglibexec-tests

Drop "ostree trivial-httpd" CLI, move to tests directory

2 years agofetcher: Always open tmpfiles in repo (except on FUSE)
Colin Walters [Thu, 29 Jun 2023 06:42:04 +0000 (02:42 -0400)]
fetcher: Always open tmpfiles in repo (except on FUSE)

This reverts commit 4e61e6f7d0d6aebd6abcdc455ec53164afe39e8d
and re-instates the fix for ensuring that we download temporary
files into the repository location.

However in order to ensure we don't re-introduce
https://github.com/ostreedev/ostree/issues/2900
we detect the case where we're writing to a FUSE mount
and keep the prior behavior.

I've verified that this works with flatpak.

Note a downside of this is the change needs to be triplicated
across the 3 http backends.

This then again
Closes: https://github.com/ostreedev/ostree/issues/2571
2 years agoMerge pull request #2905 from cgwalters/prepare-root-static-split
Colin Walters [Tue, 4 Jul 2023 13:05:31 +0000 (09:05 -0400)]
Merge pull request #2905 from cgwalters/prepare-root-static-split

Separate prepare-root static path + link to glib

2 years agobuild(deps): bump composefs from `412cb5e` to `ac729b5`
dependabot[bot] [Tue, 4 Jul 2023 12:25:19 +0000 (12:25 +0000)]
build(deps): bump composefs from `412cb5e` to `ac729b5`

Bumps [composefs](https://github.com/containers/composefs) from `412cb5e` to `ac729b5`.
- [Release notes](https://github.com/containers/composefs/releases)
- [Commits](https://github.com/containers/composefs/compare/412cb5e6aaf516c5e2a7f67e426a25ed2926e101...ac729b579dd332938c6ad43ba83b2b896631dad4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoDrop "ostree trivial-httpd" CLI, move to tests directory
Colin Walters [Tue, 19 Jun 2018 13:34:18 +0000 (09:34 -0400)]
Drop "ostree trivial-httpd" CLI, move to tests directory

See https://github.com/ostreedev/ostree/issues/1593

Basically this makes it easier for people packaging, as the trivial-httpd
is only for tests, and this way the binary will live with the tests.

Also at this point nothing should depend on `ostree trivial-httpd`.

2 years agoMerge pull request #2916 from cgwalters/release
Colin Walters [Fri, 30 Jun 2023 19:07:15 +0000 (15:07 -0400)]
Merge pull request #2916 from cgwalters/release

Release 2023.5

2 years agoMerge pull request #2914 from cgwalters/doc-usergroups
Colin Walters [Fri, 30 Jun 2023 15:49:30 +0000 (11:49 -0400)]
Merge pull request #2914 from cgwalters/doc-usergroups

docs: Update user and group section

2 years agoconfigure: post-release version bump
Colin Walters [Fri, 30 Jun 2023 15:10:25 +0000 (11:10 -0400)]
configure: post-release version bump

2 years agoRelease 2023.5
Colin Walters [Fri, 30 Jun 2023 15:07:18 +0000 (11:07 -0400)]
Release 2023.5

2 years agoMerge pull request #2899 from ostreedev/dependabot/submodules/composefs-412cb5e
Colin Walters [Fri, 30 Jun 2023 15:01:59 +0000 (11:01 -0400)]
Merge pull request #2899 from ostreedev/dependabot/submodules/composefs-412cb5e

build(deps): bump composefs from `08bdb03` to `412cb5e`

2 years agoprepare-root: Link to glib
Colin Walters [Wed, 21 Jun 2023 17:25:52 +0000 (13:25 -0400)]
prepare-root: Link to glib

Since we've split off the "prepare root as init" code
into a separate file, we can now use glib to parse
the config file again, which is a lot less hacky.

This is particularly motivated by composefs, where
we want to do more in the initramfs.  Future patches
may also link to parts of libostree.

2 years agoSeparate prepare-root static path
Colin Walters [Sat, 17 Jun 2023 14:05:22 +0000 (10:05 -0400)]
Separate prepare-root static path

We should have done this a long time ago.  We don't have any test
coverage for the no-initramfs path, and I think it's not long
term supportable as we want to add more features like composefs.

Particularly now that there's good support for embedding an
initramfs in a kernel image, I see little value in a path for
having custom static linking for this prepare root flow.

That said, we will continue to make a best-effort "it compiles"
attempt to support it.

Fork the "pid 1" prepare root code into a new
`ostree-prepare-root-static.c` file, and drop the runtime conditionals.

We can drop the composefs logic from `-static.c` which ends up
keeping that file much smaller.

A further next step here will be to actually fold the
`prepare-root.c` logic into the main `ostree` binary which we
can then just include in the initramfs.

2 years agobuild(deps): bump composefs from `08bdb03` to `412cb5e`
dependabot[bot] [Fri, 30 Jun 2023 09:13:46 +0000 (09:13 +0000)]
build(deps): bump composefs from `08bdb03` to `412cb5e`

Bumps [composefs](https://github.com/containers/composefs) from `08bdb03` to `412cb5e`.
- [Release notes](https://github.com/containers/composefs/releases)
- [Commits](https://github.com/containers/composefs/compare/08bdb030fcff4f55ef63aa828b09b57a6cd4d234...412cb5e6aaf516c5e2a7f67e426a25ed2926e101)

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

Signed-off-by: dependabot[bot] <support@github.com>
2 years agodocs: Update user and group section
Colin Walters [Thu, 29 Jun 2023 15:05:31 +0000 (11:05 -0400)]
docs: Update user and group section

- mention `DynamicUser=yes`
- mention the recent systemd JSON bits
- mention sysusers.doc

And briefly talk about the tradeoffs in these.

2 years agoMerge pull request #2911 from cgwalters/fix-generator-regression
Dan Nicholson [Thu, 29 Jun 2023 08:16:52 +0000 (02:16 -0600)]
Merge pull request #2911 from cgwalters/fix-generator-regression

Fix return value of generator on non-ostree systems

2 years agoMerge pull request #2910 from cgwalters/more-ci-fixes
Colin Walters [Thu, 29 Jun 2023 06:38:00 +0000 (02:38 -0400)]
Merge pull request #2910 from cgwalters/more-ci-fixes

ci: Fix executability

2 years agotests: Enable mtime test
Colin Walters [Thu, 29 Jun 2023 06:11:09 +0000 (02:11 -0400)]
tests: Enable mtime test

I think this just accidentally was never enabled.

While looking at the code, add a sleep here to be resilient to
filesystems with only second mtime granularity.

2 years agotests: Drop unused alias
Colin Walters [Thu, 29 Jun 2023 06:09:51 +0000 (02:09 -0400)]
tests: Drop unused alias

2 years agotests/transactionality: Port a bit to xshell
Colin Walters [Thu, 29 Jun 2023 06:08:56 +0000 (02:08 -0400)]
tests/transactionality: Port a bit to xshell

This will give us more useful error messages which should
help debug a flake.

2 years agoMerge pull request #2907 from cgwalters/test-composefs
Joseph Marrero Corchado [Wed, 28 Jun 2023 23:44:52 +0000 (19:44 -0400)]
Merge pull request #2907 from cgwalters/test-composefs

tests: Source libtest before exiting

2 years agotest-composefs: Sync flow with other tests
Colin Walters [Tue, 27 Jun 2023 10:59:51 +0000 (06:59 -0400)]
test-composefs: Sync flow with other tests

I am not sure why this is failing on older Debian systems,
but I'm wildly guessing that something being done in `libtest.sh`
is setting up automake in a way that we need.  This is done
in other tests.

Or maybe it's the missing `$CMD_PREFIX`?  Let's see...

2 years agoFix return value of generator on non-ostree systems
Colin Walters [Wed, 28 Jun 2023 15:45:15 +0000 (11:45 -0400)]
Fix return value of generator on non-ostree systems

Commit aa72caffb540114a0e8635ab2990b9c8b0b8f9db
regressed the `ostree-system-generator` on non-ostree systems.
If there's no `ostree=` karg, we need to just exit 0.

Closes: https://github.com/ostreedev/ostree/issues/2909
Fixes: aa72caffb540114a0e8635ab2990b9c8b0b8f9db
2 years agoci: Fix executability
Colin Walters [Wed, 28 Jun 2023 06:37:31 +0000 (02:37 -0400)]
ci: Fix executability

2 years agoMerge pull request #2904 from cgwalters/prow-ci
Colin Walters [Tue, 27 Jun 2023 21:16:18 +0000 (17:16 -0400)]
Merge pull request #2904 from cgwalters/prow-ci

ci/prow: Build tests before trying to install

2 years agoMerge pull request #2906 from cgwalters/compiletest-static-prepareroot
Joseph Marrero Corchado [Tue, 27 Jun 2023 13:55:15 +0000 (09:55 -0400)]
Merge pull request #2906 from cgwalters/compiletest-static-prepareroot

ci: Add "it compiles" coverage for --with-static-compiler

2 years agoci: Add "it compiles" coverage for --with-static-compiler
Colin Walters [Tue, 27 Jun 2023 10:26:08 +0000 (06:26 -0400)]
ci: Add "it compiles" coverage for --with-static-compiler

Prep for further changes.

2 years agoci/prow: Build tests before trying to install
Colin Walters [Tue, 27 Jun 2023 09:27:23 +0000 (05:27 -0400)]
ci/prow: Build tests before trying to install

Our `install` target doesn't depend on `all` unlike the
rpm-ostree version; not doing so is arguably better, so let's
explicitly build before installing.

2 years agoMerge pull request #2902 from ericcurtin/ostree-aboot-pass-options
Colin Walters [Tue, 27 Jun 2023 06:50:49 +0000 (02:50 -0400)]
Merge pull request #2902 from ericcurtin/ostree-aboot-pass-options

bootloader: Pass "options" to aboot bootloader backend

2 years agoMerge pull request #2901 from cgwalters/revert-fetcher-change
Colin Walters [Tue, 27 Jun 2023 04:18:17 +0000 (00:18 -0400)]
Merge pull request #2901 from cgwalters/revert-fetcher-change

Revert "fetcher: Always open tmpfiles in repo location"

2 years agoRevert "fetcher: Always open tmpfiles in repo location"
Colin Walters [Mon, 26 Jun 2023 09:17:45 +0000 (05:17 -0400)]
Revert "fetcher: Always open tmpfiles in repo location"

This reverts commit f7f6f87c513c9f35bc24f35e909779c19cb49d3a.

This seems to have broken flatpak, so we'll revert and then
investigate.

Closes: https://github.com/ostreedev/ostree/issues/2900
2 years agoMerge pull request #2903 from dbnicholson/composefs-digest-fix
Dan Nicholson [Mon, 26 Jun 2023 23:08:48 +0000 (17:08 -0600)]
Merge pull request #2903 from dbnicholson/composefs-digest-fix

prepare-root: Adjust to composefs mount struct changes

2 years agoprepare-root: Adjust to composefs mount struct changes
Dan Nicholson [Mon, 26 Jun 2023 15:47:00 +0000 (09:47 -0600)]
prepare-root: Adjust to composefs mount struct changes

This fixes a regression from the latest composefs submodule update in
1582edd1d4a6b26874d3897de8a5586f979a0715. In composefs commit
7560a4fd388481f479c0b3fc2e6d20c6321d9b74 the struct field was changed
from the generic `expected_digest` with the thought that there may be
other signatures or digests in the future.

2 years agobootloader: Pass "options" to aboot bootloader backend
Eric Curtin [Mon, 26 Jun 2023 10:44:32 +0000 (11:44 +0100)]
bootloader: Pass "options" to aboot bootloader backend

aboot-deploy must know where the next root filesystem to boot is to set
up a symlink /ostree/root.a or /ostree/root.b , this location is in the
ostree= part of these passed in options.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2 years agoMerge pull request #2896 from akiernan/main
Colin Walters [Wed, 21 Jun 2023 12:06:52 +0000 (08:06 -0400)]
Merge pull request #2896 from akiernan/main

lib/deploy: Use off_t not __off_t