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

Add erofs compressed rootfs support #1403

Closed
wants to merge 4 commits into from
Closed

Conversation

bcl
Copy link
Contributor

@bcl bcl commented Jun 28, 2024

This adds support for creating the rootfs using the erofs compression format. https://erofs.docs.kernel.org/en/latest/quickstart.html

You can run it by checking out this branch from github (into /root/lorax in this example) and running:

#!/bin/bash

# Gather up the list of system repo files and use them for lorax
REPOS=$(for f in /etc/yum.repos.d/*repo; do echo -n "--repo $f "; done)
if [ -z "$REPOS" ]; then
    echo "No system repos found"
    exit 1
fi

PATH=/root/lorax/src/bin:/root/lorax/src/sbin:$PATH PYTHONPATH=/root/lorax/src/ \
/root/lorax/src/sbin/lorax --product="Fedora" --version=41  --release=41 \
--volid="Fedora-rawhide-test" \
--rootfs-type erofs \
--proxy http://proxy.notae.us:8123 \
$REPOS /var/tmp/lorax-fedora-iso/ || exit 1

There will be a boot.iso and an install.img in /var/tmp/lorax-fedora-iso/images/

The resulting boot.iso will boot and mount the erofs filesystem, but the overlay doesn't appear to work so it is read only. Dracut still needs some work to fully support this, but this should be a good starting point.

bcl added 2 commits June 27, 2024 16:47
The cmdline switch, --squashfs-only, now sets this and the new
--rootfs-type can be used to select other rootfs types. Currently only
squashfs and squashfs-ext4 are actually implemented.

This also changes the default to a plain squashfs without the wrapped
ext4 image. This speeds up image creation and there is no longer a
reason to use the wrapped ext4 method.
@coveralls
Copy link

coveralls commented Jun 28, 2024

Pull Request Test Coverage Report for Build 9718884846

Details

  • 24 of 74 (32.43%) changed or added relevant lines in 5 files are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.2%) to 43.483%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pylorax/cmdline.py 0 6 0.0%
src/pylorax/creator.py 12 20 60.0%
src/pylorax/treebuilder.py 5 17 29.41%
src/pylorax/init.py 3 27 11.11%
Files with Coverage Reduction New Missed Lines %
src/pylorax/creator.py 1 39.0%
src/pylorax/cmdline.py 2 0.0%
src/pylorax/init.py 2 17.26%
Totals Coverage Status
Change from base Build 9665356445: -0.2%
Covered Lines: 1640
Relevant Lines: 3568

💛 - Coveralls

@bcl
Copy link
Contributor Author

bcl commented Jul 11, 2024

This requires this dracut PR - dracut-ng/dracut-ng#490

Passing 'erofs' will create a plain erofs compressed image. Passing
'erofs-ext4' will create a LiveOS/rootfs.img ext4 filesystem compressed
by erofs.
@coveralls
Copy link

coveralls commented Jul 13, 2024

Pull Request Test Coverage Report for Build 9942739515

Details

  • 18 of 64 (28.13%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.2%) to 43.457%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pylorax/cmdline.py 0 5 0.0%
src/pylorax/creator.py 6 11 54.55%
src/pylorax/treebuilder.py 5 17 29.41%
src/pylorax/init.py 3 27 11.11%
Files with Coverage Reduction New Missed Lines %
src/pylorax/cmdline.py 1 0.0%
src/pylorax/init.py 2 17.26%
Totals Coverage Status
Change from base Build 9665356445: -0.2%
Covered Lines: 1634
Relevant Lines: 3559

💛 - Coveralls

Set the default compression style to lzma and use the config values when
creating the erofs compressed rootfs.
@bcl
Copy link
Contributor Author

bcl commented Jul 15, 2024

Merged to master.

@bcl bcl closed this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants