Skip to content

Comments

Support the /boot/coreos/first_boot flag file#68

Merged
pothos merged 1 commit intoflatcar-masterfrom
kai/coreos-first-boot
May 22, 2020
Merged

Support the /boot/coreos/first_boot flag file#68
pothos merged 1 commit intoflatcar-masterfrom
kai/coreos-first-boot

Conversation

@pothos
Copy link
Member

@pothos pothos commented May 22, 2020

If a user or old software creates the flag file on the old CoreOS location,
nothing would happen.
Check the old location, too, so that Ignition is rerun.

How to use

Requires flatcar/bootengine#13 and flatcar/update_engine#5

Build available here:

$ wget 'https://storage.googleapis.com/flatcar-jenkins/developer/boards/amd64-usr/2345.3.1+dev-flatcar-master-449/flatcar_production_qemu.sh'
$ chmod +x flatcar_production_qemu.sh
$ wget 'https://storage.googleapis.com/flatcar-jenkins/developer/boards/amd64-usr/2345.3.1+dev-flatcar-master-449/flatcar_production_qemu_image.img.bz2'

Testing done

  1. Boot up without an Ignition config: ./flatcar_production_qemu.sh
  2. Create the flag file and shutdown via SSH mkdir /boot/coreos; touch /boot/coreos/first_boot
  3. Boot up with an Ignition config ./flatcar_production_qemu.sh -i someconfig.ign
  4. Check that the config was applied

set first_boot="flatcar.first_boot=detected"
fi
if [ -f "($root)/coreos/first_boot" ]; then
set first_boot="coreos.first_boot=detected"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why set coreos.first_boot instead of flatcar.first_boot?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On one hand because it allows us to test this parameter and on the other because we could in the future give a deprecation warning for the old flag file location.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flag file location is separate from the grub command line parameter. I don't think it's good to add now a command line parameter that we don't intend to support.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We indent to support for now it because we aim to be a drop-in replacement.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But sure, I can remove it here as it's an internal thing.

If a user or old software creates the flag file on the old CoreOS location,
nothing would happen.
Check the old location, too, so that Ignition is rerun.
@pothos pothos force-pushed the kai/coreos-first-boot branch from c8a4589 to f4aa56a Compare May 22, 2020 13:20
@pothos pothos merged commit 677f141 into flatcar-master May 22, 2020
@pothos pothos deleted the kai/coreos-first-boot branch May 22, 2020 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants