kairos-io / kairos

The immutable Linux meta-distribution for edge Kubernetes.
https://kairos.io
Apache License 2.0
1.15k stars 97 forks source link

Reset fails on raw images #3025

Open Itxaka opened 2 hours ago

Itxaka commented 2 hours ago

Reset fails in arm images because it cant find the state partition. But on RAW images we only ship the recovery and oem partition so this doesnt work.

image

dnugmanov commented 2 hours ago

You need to create partition before resetting, your disk should have enough free space in the end of the disk where COS_RECOVERY is located or separate disk.

I am using:

    - name: "Repart image"
      layout:
        device:
          label: COS_RECOVERY
        add_partitions:
          - fsLabel: COS_STATE
            size: 50000 <-- adjust this.
            pLabel: state
          - fsLabel: COS_PERSISTENT
            pLabel: persistent
            size: 0
            filesystem: "ext4"
    - name: "Deploy kairos"
      commands:
      - kairos-agent --debug reset --unattended
      - touch /usr/local/.deployed
      - reboot
      if: '[ -f "/run/cos/recovery_mode" ] && [ ! -e /usr/local/.deployed ]'
Itxaka commented 2 hours ago

yeah, this used to work automatically without the need for creating the partition, as the reset would recreate it. There is even a comment on the reset part as we could not remember where the state recreation was needed for: https://github.com/kairos-io/kairos-agent/blob/main/pkg/action/reset.go#L119