Skip to content

Support reading platforms.json from the rootfs #1778

Description

@jbtrystram

Currently we source grub console arguments and kernel arguments reading platforms.json [1], allowing us to use the metal image to install on other platforms.
This file is sourced from the boot partition [2] because that's where it historically got written but it exists in the container rootfs already, and have been for while now [3][4][5]

It makes sense to embed this file in the container, because we are making the initial container the source of truth as much as possible.

Image-builder already knows [6] how to read platforms-specific blueprints so we could derive blueprints from this platforms.json as done in this experimentation repo, the only blocker remaining is coreos-installer.

So my proposal is to source that file from /usr/lib/image-builder/<something> or /usr/share/coreos/platforms.json or something like that. We should probably drop the coreos-assembler reference since we'll no longer use it to build images longer term. The copy in /boot will disappear when we'll move to a pure image-builder build and drop coreos-assembler.

[1]

match fs::read_to_string(mountpoint.join("coreos/platforms.json")) {

[2]
let mount = Disk::new(device)?.mount_partition_by_label("boot", mount::MsFlags::empty())?;

[3] coreos/coreos-assembler#3709
[4] https://github.com/osbuild/osbuild/blob/346ea5159bac62f846c0630605974bb38817e111/stages/org.osbuild.coreos.platform#L14-L15
[5] https://github.com/coreos/fedora-coreos-config/blob/201b221eaabf924c0968102af84525f842a7b43d/build-rootfs#L664-L671
[6] osbuild/image-builder#2754

Ref joelcapitao/bib-fcos-experimentation#84

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions