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

Hook up blueprint filesystem customizations #124

Merged
merged 7 commits into from
Jun 3, 2024
Merged

Commits on May 28, 2024

  1. Use blueprint filesystem customizations to create partitions

    This also allows the root filesystem size to be increased if the default
    of 10GiB isn't enough.
    bcl authored and mvo5 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    b5bbe60 View commit details
    Browse the repository at this point in the history
  2. test: Check the qcow2 image filesystem changes

    Make sure / is larger than the default of 10GiB and make sure there is a
    new /var/log mountpoint.
    bcl authored and mvo5 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    452ac25 View commit details
    Browse the repository at this point in the history
  3. Check blueprint mountpoints against OSTree mountpoint policies

    This requires a new release of images that exposes the policies package.
    bcl authored and mvo5 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    419111c View commit details
    Browse the repository at this point in the history
  4. test: Add a test for mountpoint policy violations

    Users cannot create a mountpoint on /ostree, make sure that an error is
    returned when this happens.
    bcl authored and mvo5 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    95e8e12 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    017c424 View commit details
    Browse the repository at this point in the history
  6. test: small pytest related tweaks

    This commit tweaks the test setup slightly to use pytest.raises
    for exception checking and also run test_mount_ostree_error()
    only for the centos image (as the error checking/policies are
    exactly the same for both images).
    mvo5 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    191a221 View commit details
    Browse the repository at this point in the history
  7. image: only allow tweaks to /, /boot for now

    The "images" library does not support custom mount points for
    bootc based images just yet. The reason is that images will
    generate an osbuild manifest that contains all the "mounts"
    for the generated disk. This means that with an extra partition
    like `/var/log` this is visible for the "bootc install-to-filesystem"
    stage. And that will trip up bootc because it validates the content
    of the target directory. Example error with `/var/log` as a custom
    mount point:
    ```
    ...
    Installing image: docker://quay.io/centos-bootc/centos-bootc:stream9
    ERROR Installing to filesystem: Verifying empty rootfs: Non-empty root filesystem; found "var"
    Traceback (most recent call last):
      File "/run/osbuild/bin/org.osbuild.bootc.install-to-filesystem", line 53, in <module>
        r = main(args["options"], args["inputs"], args["paths"])
      File "/run/osbuild/bin/org.osbuild.bootc.install-to-filesystem", line 48, in main
        subprocess.run(pargs, env=env, check=True)
      File "/usr/lib64/python3.9/subprocess.py", line 528, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['bootc', 'install', 'to-filesystem', '--source-imgref', 'containers-storage:[overlay@/run/osbuild/containers/storage+/run/containers/storage]3b612dd1fae2437c00ae3187d0e63daa7a94711560fb1712389edd4121668c96', '--skip-fetch-check', '--generic-image', '--karg', 'rw', '--karg', 'console=tty0', '--karg', 'console=ttyS0', '--karg', 'systemd.journald.forward_to_console=1', '--target-imgref', 'quay.io/centos-bootc/centos-bootc:stream9', '/run/osbuild/mounts']' returned non-zero exit status 1.
    ```
    
    So AFAICT "images" need sto be changed so that:
    
    1. The "install-to-filesystem" stage only takes the "essential" mounts (/, /boot/, /boot/efi)
    2. After "install-to-filesystem" ran we need a "org.osbuild.mkdir" stage for the extra mount points that also only mounts the "essential" mounts
    
    As a first step on the journy this commit limits customizations to
    "/" and "/boot" which is already very useful as many people have
    asked for precisely those.
    mvo5 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    75fb7cd View commit details
    Browse the repository at this point in the history