Skip to content

Commit

Permalink
bib: use plain squashfs for the ISO rootfs
Browse files Browse the repository at this point in the history
This commit moves to the new "flat" squashfs rootfs image
that is now available in the `images` library (c.f.
osbuild/images#1105).

This will ensures we are no longer using the previous "ext4"
intermediate image that gave problems for big rootfses.

Closes: #733
  • Loading branch information
mvo5 committed Jan 6, 2025
1 parent 1b44549 commit f796877
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Install test dependencies
run: |
sudo apt update
sudo apt install -y python3-pytest python3-paramiko python3-boto3 flake8 qemu-system-x86 qemu-efi-aarch64 qemu-system-arm qemu-user-static pylint libosinfo-bin
sudo apt install -y python3-pytest python3-paramiko python3-boto3 flake8 qemu-system-x86 qemu-efi-aarch64 qemu-system-arm qemu-user-static pylint libosinfo-bin squashfs-tools
- name: Diskspace (before)
run: |
df -h
Expand Down
3 changes: 2 additions & 1 deletion bib/cmd/bootc-image-builder/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, erro
default:
return nil, fmt.Errorf("unsupported architecture %v", c.Architecture)
}

// see https://github.com/osbuild/bootc-image-builder/issues/733
img.RootfsType = manifest.SquashfsRootfs
img.Filename = "install.iso"

mf := manifest.New()
Expand Down
18 changes: 17 additions & 1 deletion test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import subprocess
import tempfile
import uuid
from contextlib import contextmanager
from contextlib import contextmanager, ExitStack
from typing import NamedTuple
from dataclasses import dataclass

Expand Down Expand Up @@ -654,6 +654,22 @@ def test_iso_os_detection(image_type):
assert osinfo_output == expected_output


@pytest.mark.skipif(platform.system() != "Linux", reason="osinfo detect test only runs on linux right now")
@pytest.mark.skipif(not testutil.has_executable("unsquashfs"), reason="need unsquashfs")
@pytest.mark.parametrize("image_type", gen_testcases("anaconda-iso"), indirect=["image_type"])
def test_iso_install_img_is_squashfs(tmp_path, image_type):
installer_iso_path = image_type.img_path
with ExitStack() as cm:
mount_point = tmp_path / "cdrom"
mount_point.mkdir()
subprocess.check_call(["mount", installer_iso_path, os.fspath(mount_point)])
cm.callback(subprocess.check_call, ["umount", os.fspath(mount_point)])
# ensure install.img is the "flat" squashfs, before PR#777 the content
# was an intermediate ext4 image "squashfs-root/LiveOS/rootfs.img"
output = subprocess.check_output(["unsquashfs", "-ls", mount_point / "images/install.img"], text=True)
assert "usr/bin/bootc" in output


@pytest.mark.parametrize("images", gen_testcases("multidisk"), indirect=["images"])
def test_multi_build_request(images):
artifacts = set()
Expand Down

0 comments on commit f796877

Please sign in to comment.