Commit 37a1853
committed
overlay/ignition: delete pre-existing bootuuid.cfg
In our disk images, bootupd inject a grub script that looks for a
`/boot/grub2/bootuuid.cfg` to find the boot partition. If the file is not
present, the label `boot` is used to find the partition. See [1] for more.
During the first boot, the hard-coded uuid of the boot partition is
replaced with a random one [2].
However this happen in two phases:
First `coreos-gpt-setup.service` assigns a new UUID to the partition,
Then `coreos-boot-edit.service` writes that new uuid to
`/boot/grub2/bootuuid.cfg`.
However, when ignition needs to reboot (e.g. for applying a karg),
the reboot happens between the two.
In `bootc install to-disk` the UUID of the boot partition is written
to `/boot/grub2/bootuuid.cfg`, so it will be present at first boot. But
if we restamp the parition then reboot, the original `bootuuid.cfg` is
still there, preventing the reboot.
So let's delete this file just before the restamp, so we don't end up
in this inconsistent state.
This allows us to use `bootc install to-disk` to build our disk images.
See [3][4].
[1] https://github.com/coreos/bootupd/blob/1768f31c85b5d8cd72f4339ab669b703d7071b51/src/grub2/grub-static-pre.cfg
[2] https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-gpt-setup.service
[3] https://issues.redhat.com/browse/COS-3374
[4] coreos/coreos-assembler#42241 parent 79736c3 commit 37a1853
File tree
2 files changed
+16
-0
lines changed- overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition
2 files changed
+16
-0
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
0 commit comments