Commit e01d90d
committed
container: Add export --format=tar command
Implement bootc container export command to export container filesystems
as bootable tar archives with proper metadata preservation and bootc-
specific features.
Key features:
- Export container filesystems to tar format
- Preserve file permissions, ownership, and metadata using secure metadata calls
- Kernel relocation from /usr/lib/modules to /boot for legacy compatibility
- Support for output to file or stdout
- Comprehensive error handling and validation
- SELinux labeling support when policy is available
- Basic test coverage for core functionality
Security improvements:
- Use entry.entry.metadata() to get correct metadata for each walk entry
- Avoid symlink-following metadata calls that could leak host files
- Ensure proper metadata retrieval for directories, files, and symlinks
Code quality improvements:
- Extract relocate_kernel_artifact() helper to eliminate duplication
- Clean, maintainable kernel relocation logic
- Comprehensive documentation and help text
Fixes #1957
Assisted-by: OpenCode (Sonnet 4.5)1 parent 51dabaa commit e01d90d
9 files changed
Lines changed: 703 additions & 1 deletion
File tree
- crates
- lib/src
- tests-integration
- src
- docs/src/man
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
418 | 457 | | |
419 | 458 | | |
420 | 459 | | |
| |||
1626 | 1665 | | |
1627 | 1666 | | |
1628 | 1667 | | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
1629 | 1684 | | |
1630 | 1685 | | |
1631 | 1686 | | |
| |||
0 commit comments