1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 15:45:53 +01:00
Commit Graph

3522 Commits

Author SHA1 Message Date
Colin Walters
f61ba60bbc Add initramfs infrastructure
This adds scaffolding to install a stub binary which can
optionally be added into the initramfs;
prep for us doing real work during setup as we aim
to move to the native composefs backend.

The binary is *built* but is only installed by a
new `Makefile` target, so existing build system
users won't pick it up. Our development-only
`Dockerfile` gains a build option to use it
(and also ensures the initramfs is regenerated).

However previously we also discussed moving the fstab
logic into the initramfs:
https://github.com/bootc-dev/bootc/pull/1113

I might try doing that once this lands.

One notable thing is that even this trivial nearly-no-op
binary is still 4MB which I think is mostly due
to linking in a whole copy of prebuilt rust `std`.
In theory we could try going to `#[no_std]` but I
don't think it'll be viable once we start doing more here.
Probably most practical thing re size is `-Z build-std` + LTO.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-08 09:30:32 -04:00
bootc-actions-token[bot]
acba07b6fb Release 1.6.0
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v1.6.0
2025-08-07 10:01:43 -04:00
ckyrouac
0da7858e4b ci: Refactor release action to use app and create-pull-request
This uses the token generated in the GitHub app that has a limited
scope. Also refactors the commit/push steps to use the
create-pull-request action rather than manually committing and pushing.
This simplifies the token usage when committing/pushing.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-08-07 08:40:00 -04:00
Colin Walters
3758da2859 Merge pull request #1490 from cgwalters/kernel-cleanups-3
kernel_cmdline: More cleanups and API additions
2025-08-06 17:26:27 -04:00
Colin Walters
e260212745 Merge pull request #1493 from ckyrouac/release-time2
ci: Release every 3 weeks starting from 2025-08-04
2025-08-06 10:50:25 -04:00
ckyrouac
08d2c982f2 ci: Release every 3 weeks starting from 2025-08-04
This modifies the scheduled release to happen every 3 weeks regardless
of when the previous release happened. This aligns with the team's
schedule.

Assisted-by: Claude code
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-08-06 10:04:45 -04:00
Colin Walters
17b4f7bf92 kernel_cmdline: Drop to_lossy, add more utf8 variants
I don't think anything should use to_lossy() by default.
It's great to have a correct kernel argument parser that
doesn't bomb on non-UTF8 but at the same time in our code
we can just I think ignore kernel arguments which aren't UTF-8.

Maybe we should warn if e.g. we find a `root=<nonutf8` or
so but eh.

Everything else in the bootc codebase works in terms of
strings so let's just make it really easy to only
get strings out.

Implementation notes:

- I struggled with lifetimes in this one and couldn't
  get it to work to reuse the Parameter (byte oriented)
  parser and just reimplemented it in the str path
- When I tossed this problem at both Claude and Gemini
  they both gave up; and Gemini ended up deleting
  all the code and declaring success

Unit tests (after I manually fixed up all the lifetime
stuff in the core code) are
Assisted-by: Gemini-CLI

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-05 18:40:10 -04:00
Colin Walters
664f06e0c2 kernel: Retain original full parameter
In some cases we want to return the value exactly as it
was originally.

Also drop the test-only APIs, those were really never needed.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-05 17:42:22 -04:00
Colin Walters
c5044b0a09 Merge pull request #1487 from jeckersb/fix-autovendor-cli-path
Fix autovendor workflow CLI directory path
2025-08-05 14:32:56 -04:00
Colin Walters
64f92b87bf Merge pull request #1489 from miabbott/kill_update_generated_files
Revert "ci: periodically run update-generated"
2025-08-05 14:32:13 -04:00
Micah Abbott
6bb02940cc Revert "ci: periodically run update-generated"
This reverts commit 9e0a0f887b.

Signed-off-by: Micah Abbott <miabbott@redhat.com>
2025-08-05 14:24:48 -04:00
John Eckersberg
2245c1a03e Fix autovendor workflow CLI directory path
Update the autovendor GitHub workflow to use the correct path 'crates/cli'
instead of 'cli', which was causing the job to fail with "No such file or
directory" error.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-08-05 12:50:34 -04:00
John Eckersberg
06a643cf56 Merge pull request #1486 from cgwalters/kernel-cleanups-2-rename
kernel args: Shuffle module names
2025-08-05 12:18:34 -04:00
Colin Walters
1cbfdc8c87 Rename kernel.rs -> kernel_cmdline.rs
To clarify what this does more.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-05 09:56:05 -04:00
Colin Walters
18f890f9bb Rename kargs.rs -> bootc_kargs.rs
It's confusing we have both kargs.rs and kernel.rs where
the latter is also handling kernel arguments.

Clarify what this does.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-05 09:52:54 -04:00
Colin Walters
a279555b25 Merge pull request #1480 from cgwalters/composefs-prep-grub
Write nom parser for Grub menuentries
2025-08-05 01:35:21 -04:00
Johan-Liebert1
3548a1d15b parsers/grub_menuconfig: New nom parser
This will be needed in some scenarios for composefs.

Assisted-by: Claude Code
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-04 16:40:11 -04:00
Colin Walters
735a0b0f61 Merge pull request #1483 from cgwalters/kernel-cleanups
kernel: Add value helpers
2025-08-04 15:15:30 -04:00
Colin Walters
58a37d7728 kernel: Add value helpers
Many cases want to find the value of an argument, no need
to return the key back to them.

Also IMO `value_lossy()` is a HUGE trap because aside from
logging it's almost never the right thing to do. I plan
to remove it in a followup.

So this also adds a `utf8` helper that returns an error,
and changes one case to use it.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-04 14:29:55 -04:00
Colin Walters
7a4abcc8fd Merge pull request #1478 from cgwalters/kargs-followup
Kargs followup
2025-08-02 09:29:14 -04:00
Colin Walters
30e9dc0c3b kernel: Add find API w/correct hyphen-dash equality, add docs
We had use cases which were doing `iter().find(|v| v.key ==`
which would NOT do the `-_` insensitive comparison. Add a newtype
`ParameterKey` and move the comparison there.

This makes the API slightly more awkward to use when inspecting
as one needs `.key.0` but eh.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-01 18:16:05 -04:00
Colin Walters
92409e905d Merge pull request #1477 from cgwalters/store-composefs-2
Add bootc internals cfs
2025-08-01 14:52:08 -04:00
Colin Walters
1532e74a17 Merge pull request #1476 from jeckersb/kernel-cmdline-v2
Improve kernel argument parsing
2025-08-01 14:41:19 -04:00
Colin Walters
9d3ccd048c Add bootc internals cfs
This exposes the current functionality of the cfsctl binary.
It's not a crate right now, and it's not a lot of code, so we just
fork it.

I did take the effort to use `git subtree merge` to do the import.
For the record, here's how I did it:

- In composefs-rs: git subtree split --prefix=crates/cfsctl
- In bootc: git subtree add --prefix=crates/lib/cfsctl ../../containers/composefs-rs/ <git sha1 from above>

In cfsctl I also:

- Adjusted it to accept the bootc-configured composefs repo
  (which note is right now hardcoded to sha512, not sha256)
- Dropped the http stuff since I don't think it really makes
  sense vs OCI

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-01 14:12:03 -04:00
Colin Walters
75785516f9 Merge pull request #1471 from cgwalters/store-composefs
store: Add support for composefs-rs
2025-08-01 14:04:45 -04:00
Colin Walters
825f7ace26 Drop a few more uses of Task
It wasn't a useful abstraction in the end for most cases.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-01 13:48:22 -04:00
John Eckersberg
cf7f15066d Improve kernel argument parsing
This adds a new `kernel::Cmdline` struct, which is populated either
via `Cmdline::from` (borrowed) or `Cmdline::from_proc` (owned).

This attempts to follow the same behavior as the kernel, which is
mostly covered in:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/cmdline.c?id=e8d780dcd957d80725ad5dd00bab53b856429bc0#n227

The algorithm is basically:
- Scan forward until you find the first unquoted isspace()
  byte. That's the end of the param.
- If you encounter an `=` along the way, note where. That's where it
  will terminate the key and split for the value. Any future `=` are
  not treated as special.
- The value can be quoted to allow spaces, but is unquoted only in as
  much as `"` is removed from the first or last byte. You can still
  have `"` in the middle of the value.

This operates on `&[u8]` because the kernel does not enforce any
particular encoding for the cmdline.  Iterating using
`Cmdline::iter()` will emit the `Parameter` type, which has helper
methods `key_lossy()` and `value_lossy()` to convert
potentially-non-UTF8 data into `String`s.

Resolves: #1425
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-08-01 13:43:09 -04:00
Colin Walters
4e455d6652 docs: We're read only by default in a container (#1474)
* docs: We're read only by default in a container

Closes: https://github.com/bootc-dev/bootc/issues/1461
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-01 13:06:29 -04:00
Colin Walters
21d41c1a66 Merge pull request #1472 from cgwalters/drop-another-task
reboot: Drop use of Task
2025-08-01 10:57:30 -04:00
Colin Walters
1cff1b32cf Add 'crates/lib/cfsctl/' from commit 'b46b1f781e0d963b9cd340f1bdda9ca28c985b06'
git-subtree-dir: crates/lib/cfsctl
git-subtree-mainline: 07faf7d052
git-subtree-split: b46b1f781e
2025-07-31 19:20:46 -04:00
Colin Walters
6770addeba reboot: Drop use of Task
It was not a useful abstraction in the end, just remove it.

While here, also extend a comment with rationale for why we
sleep.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-31 18:03:05 -04:00
Colin Walters
07faf7d052 store: Add support for composefs
This is prep for wider usage of it in this project.
Like the containers-image: storage, it is only initialized
on demand right now.

(An obvious next step is to redo things so the ostree storage is also on-demand)

- This is hardcoded to SHA512 right now...but we clearly want
  a way to configure that or maybe we just really default to 512?
- We explicitly bridge between the ostree fsverity enablement
  to the composefs verity enablement
- Right now the usage is just a stub but I plan to expose
  more here

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-31 17:54:19 -04:00
Gursewak Mangat
242f076e6b Merge pull request #1470 from gursewak1997/add-docs-transient-ro
docs: add documentation for root.transient-ro feature
2025-07-31 14:52:39 -07:00
gursewak1997
4407a371e5 docs: add documentation for root.transient-ro feature
Add comprehensive documentation for the root.transient-ro option that allows
privileged users to create dynamic top-level mountpoints at runtime while
keeping the filesystem read-only by default.
2025-07-31 13:45:53 -07:00
Colin Walters
88dd96379f build-sys: Move composefs imports to workspace
Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-31 16:09:17 -04:00
Colin Walters
e72aed0083 Merge pull request #1462 from ckyrouac/release-time
ci: Shorten the release interval to 19 days
2025-07-31 10:20:49 -04:00
Chris Kyrouac
e89d134bc7 Merge pull request #1464 from cgwalters/utilstracing-log-err
utils: Move ResultExt to bootc_utils
2025-07-31 09:58:48 -04:00
Colin Walters
bdd600ee8c utils: Move ResultExt to bootc_utils
This way it can be more easily used elsewhere.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-31 08:13:42 -04:00
Colin Walters
6c3bba5230 Merge pull request #1467 from castrojo/patch-2
docs: add LFX Insights badges
2025-07-31 08:03:57 -04:00
Colin Walters
69058952af Merge pull request #1420 from rsturla/systemd-run-reboot-test
test: add integration tests for 'bootc switch --apply'
2025-07-31 03:32:33 -04:00
Colin Walters
584a75416d Merge pull request #1463 from cgwalters/reexec-cleanup
tree-wide: Clean up our re-exec path
2025-07-31 01:39:46 -04:00
Jorge O. Castro
f746b0f498 docs: add LFX Insights badges
This adds the health check, contributor count, and contributor count (yearly) to the badges section of the readme.
2025-07-30 23:01:17 -04:00
Colin Walters
3f6d199d99 Merge pull request #1466 from LukeShortCloud/adopters-playtron-gameos
docs: add Playtron GameOS
2025-07-30 19:33:55 -04:00
Luke Short
57cf6cf68e docs: add Playtron GameOS
to the ADOPTERS.md. We have builds dating all the way back to 2022.

Signed-off-by: Luke Short <ekultails@gmail.com>
2025-07-30 16:29:55 -06:00
Robert Sturla
7cef4c541e test: add integration tests for 'bootc switch --apply'
Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-07-30 22:47:40 +01:00
Colin Walters
d71ec1c5f3 tree-wide: Clean up our re-exec path
Prep for fixing https://github.com/bootc-dev/bootc/issues/1434

Basically in the selinux path we copy our binary to a tempfile,
which breaks `/proc/self/exe`.

Fix this by setting an environment variable when we do that re-exec
and ensuring that *everything* references an internal API (now
moved to utils/ so it can be shared) that looks for the env
var first.
2025-07-30 13:42:42 -04:00
Colin Walters
689340333d Merge pull request #1457 from cgwalters/doc-non-root
docs: Elaborate a bit on sysusers and /usr
2025-07-30 13:26:56 -04:00
ckyrouac
4f61e710aa ci: Shorten the release interval to 19 days
Since there is some user intervention required for the scheduled
release, this adds a 2 day buffer in case the buttons weren't clicked
immediately last time.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-07-30 11:44:25 -04:00
Joseph Marrero Corchado
d35d2359d5 Merge pull request #1456 from imbev/patch-1
Update ADOPTERS.md: Label HeliumOS as vendor, not end-user
2025-07-30 08:36:06 -04:00
Colin Walters
47aad72657 Merge pull request #1459 from cgwalters/command-run-cleanups
command: Split up run() method
2025-07-30 08:34:04 -04:00