Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New module to handle firstboot detection in the initrd #4

Merged
merged 5 commits into from Aug 21, 2023

Conversation

Vogtinator
Copy link
Member

@Vogtinator Vogtinator commented Aug 8, 2023

Look at /etc/machine-id in the /sysroot, similar to what ConditionFirstBoot in
the real root would do. If firstboot is detected, start firstboot.target.

TODO:

  • Import better x-initrd.mount handling into firstboot-detect
  • Remove 755 on firstboot-detect.sh
  • Only install the combustion module if no /etc/machine-id on the host
  • Adjust README.md
  • Make ignition use this, or at least compatible. Currently there's an ordering dep between ignition-fetch.service/network.target/firstboot-detect.service

Copy link

@laenion laenion left a comment

Choose a reason for hiding this comment

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

The firstboot-detect.sh script looks as horrible as expected, but fine with me. At least it's mounting into a separate namespace...

30firstboot/firstboot-detect.service Outdated Show resolved Hide resolved
@Vogtinator
Copy link
Member Author

The firstboot-detect.sh script looks as horrible as expected

Horrible? I think it turned out fine actually...

@Vogtinator Vogtinator force-pushed the firstbootdetect branch 3 times, most recently from 3914972 to 59d3cc7 Compare August 9, 2023 13:51
@Vogtinator Vogtinator force-pushed the firstbootdetect branch 3 times, most recently from 9aa0711 to 624b553 Compare August 16, 2023 13:50
@Vogtinator Vogtinator marked this pull request as ready for review August 16, 2023 13:50
@Vogtinator Vogtinator changed the title PoC: New module to handle firstboot detection in the initrd New module to handle firstboot detection in the initrd Aug 16, 2023
@Vogtinator Vogtinator force-pushed the firstbootdetect branch 2 times, most recently from fb008f2 to 160d767 Compare August 18, 2023 13:11
Look at /etc/machine-id in the /sysroot, similar to what ConditionFirstBoot in
the real root would do. If firstboot is detected, start firstboot.target.
If the initrd is hostonly and /etc/machine-id already exists, don't include
the combustion dracut module and its dependencies.
Previously this was done by the ignition.firstboot handling code in grub.cfg.
Ignition meanwhile uses ignition-umount-initrd-fstab.service instead.
If firstboot was triggered by presence of the reconfig_system marker,
ignition-kargs-helper's call to combustion removes the marker and after the
reboot the other firstboot stages would not run. Only remove the marker if it
was an actual combustion run.
@Vogtinator Vogtinator merged commit ce3c7ff into master Aug 21, 2023
@Vogtinator Vogtinator deleted the firstbootdetect branch August 21, 2023 06:13
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.

None yet

2 participants