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

3641 Commits

Author SHA1 Message Date
Colin Walters
fd703ec5c4 Merge pull request #1560 from Johan-Liebert1/bind-mnt-etc
composefs/install: Copy /etc contents to state
2025-08-29 13:20:30 -04:00
Johan-Liebert1
1d8606c9e5 composefs/install: Copy /etc contents to state
For bind mounting /etc we copy the contents of the EROFS' /etc to the
deployment's state directory

Mounting the EORFS requires help from the initramfs crate, so we also
turn it into a library crate.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 20:43:45 +05:30
Colin Walters
d7adf7d842 Merge pull request #1558 from Johan-Liebert1/bls-version-fix
composefs/install/bls: Fix empty version in config
2025-08-29 09:37:35 -04:00
Johan-Liebert1
a8313cbbec composefs/install/bls: Fix empty version in config
Fill `version` field in generated BLS config

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:25:49 +05:30
John Eckersberg
b45ef30ce8 Post-rebase fixups:
- Use `read_file` from `composefs::fs`
- Always define `mod parsers`
- Re-alphabetize/group module definitions

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-08-29 17:05:12 +05:30
Robert Sturla
20bd11ff8c composefs-backend: store boot assets in ESP during install
Signed-off-by: Robert Sturla <robertsturla@outlook.com>

install: create temporary directory for ESP bls mount

Plus additional review comments:
- Created constant for EFI/LINUX
- Switched from Task to Command
- Create efi_dir as Utf8PathBuf

Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-08-29 17:05:12 +05:30
Colin Walters
705eaf8c9d status: Enhance composefs cmdline parsing to handle ?
The duplication between this and composefs-boot is high
and we need to squash it; an important step there
would probably be lowering the karg parsing.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-29 17:05:12 +05:30
Colin Walters
a324f580c4 status: Use constant for composefs
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-29 17:05:12 +05:30
Colin Walters
74353965fc install: Fix cargo fmt
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-29 17:05:12 +05:30
Colin Walters
01bade0db1 install: Use read_file from composefs-boot
Just reducing code here.
2025-08-29 17:05:11 +05:30
Colin Walters
0fb6edd9e8 Drop duplicate bls_config 2025-08-29 17:05:11 +05:30
Pragyan Poudyal
f65d5dd691 test: Add tests for reading boot entries
Add tests for functions `get_sorted_bls_boot_entries` and
`get_sorted_uki_boot_entries`

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:11 +05:30
Pragyan Poudyal
f3ab5b3ea3 refactor: Pass boot dir to boot entry readers
This allows for easier testing

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:11 +05:30
Johan-Liebert1
64f5ec3731 rollback/composefs: Print whether we are reverting the queued rollback
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:11 +05:30
Johan-Liebert1
e9206ff43b install/composefs/uki: Write only staged + booted menuentry on upgrade
Instaed of writing all present menuentries, only write the menuentry for
switch/upgrade and the menuentry for the currently booted deployment.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:10 +05:30
Johan-Liebert1
1425225d3c parser/bls: Add tests for bls parser
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:10 +05:30
Johan-Liebert1
f2d77c1286 composefs/state: Name state directory default
Instead of `/sysroot/state/os/fedora` use `/sysroot/state/os/default` as
the default state directory.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:10 +05:30
Johan-Liebert1
a6bcfbecd8 lib/composefs: Centralize constants
Centralize all constants in a separate file

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:10 +05:30
Johan-Liebert1
7e05aa641c parser/bls: impl Display for BLSConfig
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:10 +05:30
Johan-Liebert1
db487412d4 composefs/boot/bls: Handle duplicate VMLinuz + Initrd
If two deployments have the same VMLinuz + Initrd then, we can use the
same binaries for both the deployments.

Before writing the BLS entries to disk we calculate the SHA256Sum
of VMLinuz + Initrd combo, then test if any other deployment has the
same SHA256Sum for the binaries. Store the hash in the origin file under
`boot -> hash` for future lookups.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:09 +05:30
Johan-Liebert1
e95af760f6 composefs/state: Use atomic writes for origin and staged deployment files
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:09 +05:30
Johan-Liebert1
9f7ca60b7a composefs/rollback: Handle UKI rollback
We parse the grub menuentries, get the rollback deployment then perform
the rollback, which basically consists of writing a new .staged
menuentry file then atomically swapping the staged and the current
menuentry.

Rollback while there is a staged deployment is still to be handled.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:09 +05:30
Johan-Liebert1
839b8580b2 parser/grub: Use String instead of &str
Returning a local reference to a `&str` is quite tricky with rust.
Update `title` and `chainloader`, the two dynamic fields in the grub
menuentry, to be `String` instead of `&str`

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:09 +05:30
Johan-Liebert1
d562f07361 composefs/status: Read UKI entries to check for queued rollback
Parse the Grub menuentry file, `boot/grub2/user.cfg` to get a list of
bootable UKIs and figure out if a rollback is currently queued.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 17:05:09 +05:30
Colin Walters
c45dab5e12 Rework composefs_booted to use kernel cmdline
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-29 17:05:08 +05:30
Pragyan Poudyal
2bd9e4c90b WIP: composefs backend
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-29 17:05:07 +05:30
Colin Walters
1c552d8ccd Merge pull request #1561 from Johan-Liebert1/composefs-initramfs-lib
initramfs: Convert to library
2025-08-29 07:29:32 -04:00
Johan-Liebert1
b636b43c47 initramfs: Convert to library
Create a lib.rs as we'd like to utilize these functions elsewhere in the
codebase

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-29 15:52:30 +05:30
Pragyan Poudyal
7434b0fb0c Merge pull request #1556 from Johan-Liebert1/composefs-initramfs-error-handling
initramfs: Better error handling
2025-08-29 11:13:51 +05:30
Colin Walters
70c80c675c Merge pull request #1557 from Johan-Liebert1/bump-composefs
Bump composefs-rs
2025-08-28 08:54:13 -04:00
Johan-Liebert1
5cbc0be7a6 initramfs: Bind mount /etc
This is prep work for eventual integration with composefs-native backend

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-28 17:53:57 +05:30
Johan-Liebert1
50722fa3d3 initramfs: Better error handling
Add error contexts to functions. Create wrappers around intrenal
functions with error context added

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-28 17:53:31 +05:30
Johan-Liebert1
fbf25c4dad Bump composefs-rs 2025-08-28 15:11:31 +05:30
Colin Walters
a48dad7b50 Merge pull request #1554 from jeckersb/kernel-cmdline-crate
Move kernel cmdline parsing to dedicated crate
2025-08-27 14:26:03 -04:00
John Eckersberg
26a51a6ce2 Move kernel cmdline parsing to dedicated crate
Creates a new dedicated crate for kernel command line parsing functionality,
moving it out of bootc-lib for better separation of concerns and modularity.

Changes:
- Create new bootc-kernel-cmdline crate under crates/kernel_cmdline/
- Move kernel_cmdline.rs from bootc-lib to the new crate as lib.rs
- Add bootc-kernel-cmdline dependency to bootc-lib
- Update imports in bootc-lib to use bootc_kernel_cmdline:: namespace
- Add missing Debug derive and documentation to fix lints

🤖 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-26 13:30:44 -04:00
Colin Walters
1dd55c2ea4 Merge pull request #1550 from Johan-Liebert1/composefs-initramfs
Move composefs setup root to bootc initramfs
2025-08-26 11:10:52 -04:00
John Eckersberg
694e0ab5c5 Merge pull request #1552 from cgwalters/more-clippy
More clippy
2025-08-26 11:06:00 -04:00
Colin Walters
c23c9ae54c Fix (or allow) remaining clippy lints
Assisted-by: Claude Code
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 10:13:10 -04:00
Colin Walters
9bc7fe9d69 Fix use of str::len and deny in make validate-rust
Part of re-enabling clippy.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 09:53:30 -04:00
John Eckersberg
ea360d6d09 Merge pull request #1551 from cgwalters/various-clippy
crates/*: Fix most clippy lints
2025-08-26 09:39:26 -04:00
Johan-Liebert1
0ef1eca803 Move composefs setup root to bootc initramfs
Move the composefs-setup-root code from composefs-rs to bootc-initramfs
crate

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-26 19:00:59 +05:30
Colin Walters
adab6b0cc4 crates/lib: Fix various clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:37:49 -04:00
Colin Walters
d028fc80b6 crates/test-integration: Fix clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:08 -04:00
Colin Walters
c681354563 crates/xtask: Fix various clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:08 -04:00
Colin Walters
56ed02d8ee crates/system-reinstall-bootc: Fix various clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:08 -04:00
Colin Walters
a3fe7b2abc crates/blockdev: Fix various clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:06 -04:00
Colin Walters
bb8444dfe6 crates/tmpfiles: Fix various clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:04 -04:00
Colin Walters
950a03e09f crates/sysusers: Fix various clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:02 -04:00
Colin Walters
3ee4479d22 crates/utils: Fix clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:02 -04:00
Colin Walters
5e830a85c8 ostree-ext: Fix clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:02 -04:00