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
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.jsonas 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.jsonor something like that. We should probably drop thecoreos-assemblerreference since we'll no longer use it to build images longer term. The copy in/bootwill disappear when we'll move to a pureimage-builderbuild and drop coreos-assembler.[1]
coreos-installer/src/install.rs
Line 629 in 9534bac
[2]
coreos-installer/src/install.rs
Line 426 in 9534bac
[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