coreos / fedora-coreos-docs

Documentation for Fedora CoreOS
https://docs.fedoraproject.org/en-US/fedora-coreos/
Other
51 stars 124 forks source link

BIOS partition copying should be skipped by ignition-ostree-transposefs on non-x86_64 #677

Open mikroskeem opened 1 month ago

mikroskeem commented 1 month ago

Describe the bug

https://github.com/coreos/fedora-coreos-config/blob/6e9f14e6f83ab13e58d81327d8c2d3e4f10d0bd3/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh#L288

When using boot_device.mirror.devices with Butane, it generates a configuration which is practically unusable on anything else but x86_64 - for example aarch64 does not ship with BIOS partition, it has only reserved partition with similar placement. I believe same issue is with PReP partition as well.

Reproduction steps

  1. Use supplied Butane configuration snippet
  2. Try installing FCOS via e.g. iPXE on non-x86_64 (e.g. aarch64)

Expected behaviour

Installation succeeds without attempting to copy existing BIOS partition (?)

Actual behaviour

Installation fails duringignition-ostree-transposefs with script attempting to copy non-existent partition.

System details

Butane or Ignition config

Butane snippet with `boot_device.mirror.devices` ```yaml --- variant: "fcos" version: "1.5.0" boot_device: mirror: devices: - "/dev/disk/by-path/pci-0000:02:00.0-nvme-1" - "/dev/disk/by-path/pci-0000:03:00.0-nvme-1" ```
Generated Ignition config snippet ```json { "storage": { "disks": [ { "device": "/dev/disk/by-path/pci-0000:02:00.0-nvme-1", "partitions": [ { "label": "bios-1", "sizeMiB": 1, "typeGuid": "21686148-6449-6E6F-744E-656564454649" }, { "label": "esp-1", "sizeMiB": 127, "typeGuid": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" }, { "label": "boot-1", "sizeMiB": 384 }, { "label": "root-1" } ], "wipeTable": true }, { "device": "/dev/disk/by-path/pci-0000:03:00.0-nvme-1", "partitions": [ { "label": "bios-2", "sizeMiB": 1, "typeGuid": "21686148-6449-6E6F-744E-656564454649" }, { "label": "esp-2", "sizeMiB": 127, "typeGuid": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" }, { "label": "boot-2", "sizeMiB": 384 }, { "label": "root-2" } ], "wipeTable": true } ], "raid": [ { "devices": [ "/dev/disk/by-partlabel/boot-1", "/dev/disk/by-partlabel/boot-2" ], "level": "raid1", "name": "md-boot", "options": [ "--metadata=1.0" ] }, { "devices": [ "/dev/disk/by-partlabel/root-1", "/dev/disk/by-partlabel/root-2" ], "level": "raid1", "name": "md-root" } ] } } ```

Additional information

I believe that it's easier to handle a workaround for this in ignition-ostree-transposefs than in Butane, as Butane is not aware about target system architecture currently.

travier commented 1 month ago

I moved this to the tracker. Please fill out the template from https://github.com/coreos/fedora-coreos-tracker/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml

jlebon commented 3 weeks ago

You have to specify the layout to match your target architecture: https://coreos.github.io/butane/config-fcos-v1_5/.

Transferred this to the docs repo since I think the issue is more that we need to make this clearer in https://docs.fedoraproject.org/en-US/fedora-coreos/storage/.

mikroskeem commented 3 weeks ago

Did not notice boot_device.layout option. Indeed - it's bit unobvious and due to style in Butane page, not very convenient to see either.

Now knowing that this option exists, it solves my original issue.