This removes the code from export that links duplicate xattrs to
a single xattrs file. This is to avoid creating too many (over 65,000)
hardlinks to a single file. This might cause some image sizes to
increase, however compression should limit the size increase.
This is accomplished by creating the file-xattrs-link file directly,
instead of creating it as a link. This is to support backwards
compatibility in import.rs
Assisted-by: Claude Code
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
For image building, we want to be able to run this on a non-bootc host
or in a container. There we'll manipulate the composefs repo in a
provided tempdir.
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
We debugged https://github.com/ostreedev/ostree/issues/3503 and
it's basically a systemd/Anaconda bug. So we can consider
soft reboots an available feature from our end (as systemd
does), but certainly one that will require integration testing on
the OS/distro side.
If you're building a system and you don't want to enable
soft reboots, just `rm /usr/lib/systemd/system/soft-reboot.target`
or so should do the trick.
Signed-off-by: Colin Walters <walters@verbum.org>
As part of the tracing-subscriber CVE I did a quick audit
for usages of `tracing::error!` and I noticed when
we updated the `main()` function in the primary
crate we missed also doing the same for system-reinstall-bootc.
Move the handling of that to utils.
xref: https://bugzilla.redhat.com/show_bug.cgi?id=2392017
Signed-off-by: Colin Walters <walters@verbum.org>
This appears to have been accidentally added somewhere along the way,
and I would like to use these in composefs-boot.
Also fixes duplicate docstring copy/paste error on
`require_value_of_utf8`.
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
While merging, existing directory in new_etc was being recursively
deleted which is not correct as any new files might also be deleted.
Instead, we simply create a directory if it doesn't exists, or if it
does exists, we update its metadata accordingly.
Add some test cases for the above.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
cli: Add internal opt for printing etc-diff
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: Add license to Cargo.toml
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: More refactoring
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Merge added, modified, removed files from the current etc into the new
etc directory, following the rules
1. If file is removed from current_etc, it will be removed from new_etc
2. If file is modified in current_etc, it will be copied to the new_etc
overwriting any existing files
3. If a file is added in current_etc, then the above modification rule
applies
Modification includes change in content/permissions. Changed in Xattrs
and/or ownership is not handled yet.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: Handle ownership changes
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: Handle xattrs
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: Ignore mtime while comparing stat
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Remove chown test
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: Use `llistxattr` and `lgetxattr`
Use the non symlink following counterparts for getting xattrs. Document
public functions and structures
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: Incremental hash computation + test verity
Test for whether the file has fs-verity enabled or not, and if it does
we simply check the verity.
Incrementally compute hash for files rather than reading the entire file
in memory.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
etc-merge: Use generic-tree from composefs-rs
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Get removed files by traversing
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
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>