Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cpio): improve initramfs image performance and efficiency via cpio reflinks #1531

Merged
merged 8 commits into from
Nov 24, 2021

Commits on Sep 17, 2021

  1. ci(TEST-60-BONDBRIDGEVLANIFCFG): use toplevel Makefile

    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    95a7754 View commit details
    Browse the repository at this point in the history
  2. ci(test): export basedir and testdir as absolute paths

    Individual test scripts may change working directory, so relative paths
    should be avoided.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    bff9aac View commit details
    Browse the repository at this point in the history
  3. ci(TEST-62-SKIPCPIO): add simple skipcpio test

    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    2ee6eed View commit details
    Browse the repository at this point in the history
  4. feat(cpio): add rust argument parsing library from crosvm

    Crosvm's rust argument library is very small and simple, while still
    providing helpful functionality. It will be consumed by dracut-cpio in a
    subsequent commit.
    
    The unmodified, BSD licensed argument.rs source is lifted as-is from
    https://chromium.googlesource.com/chromiumos/platform/crosvm
    (release-R92-13982.B b6ae6517aeef9ae1e3a39c55b52f9ac6de8edb31).
    The one-line crosvm.rs wrapper is needed to ensure that crosvm::argument
    imports continue to work.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    6a5ebcf View commit details
    Browse the repository at this point in the history
  5. feat(cpio): add newc archive creation utility

    dracut-cpio is a minimal cpio archive creation utility written in Rust.
    It provides support for a minimal set of features needed to create
    performant and space-efficient initramfs archives:
    - "newc" archive format only
    - reproducible; inode numbers, uid/gid and mtime can be explicitly set
    - data segment copy-on-write reflinks
      + using Rust io::copy()'s native copy_file_range() support[1]
      + optional archive data segment alignment for optimal reflink use[2]
    - hardlink support
    - comprehensive tests asserting GNU cpio binary output compatibility
    
    1. Rust io::copy() copy_file_range()
       rust-lang/rust#75272
    
    2. Data segment alignment
       We're bending the newc spec a bit to inject zeros after the file path
       to provide data segment alignment. These zeros are accounted for in
       the namesize, but some applications may only expect a single
       zero-terminator (and 4 byte alignment). GNU cpio and Linux initramfs
       handle this fine as long as PATH_MAX isn't exceeded.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    300e4b1 View commit details
    Browse the repository at this point in the history
  6. feat(Makefile): cargo wrapper for dracut-cpio build

    If configured with --enable-dracut-cpio, call cargo to build the
    dracut-cpio release binary.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    25cd05e View commit details
    Browse the repository at this point in the history
  7. feat(dracut.sh): add "--enhanced-cpio" option for calling dracut-cpio

    The new dracut-cpio binary is capable of performing copy-on-write
    optimized initramfs archive creation, but due to the rust dependency
    isn't built / installed by default.
    This change adds a new "--enhanced-cpio" parameter for dracut which
    sees dracut-cpio called for archive creation instead of GNU cpio.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    e197b8b View commit details
    Browse the repository at this point in the history
  8. ci(TEST-63-DRACUT-CPIO): kernel extraction tests for dracut-cpio

    dracut-cpio already carries a bunch of unit tests covering compression
    and GNU cpio extraction. The purpose of these tests is to exercise the
    dracut.sh --enhanced-cpio code-paths as well as kernel cpio archive
    extraction.
    
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    ddiss committed Sep 17, 2021
    Configuration menu
    Copy the full SHA
    d107e78 View commit details
    Browse the repository at this point in the history