-
Notifications
You must be signed in to change notification settings - Fork 97
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
Correctly identify the booting system with sentinel files #2226
Comments
Detection seems to happen here: https://github.com/kairos-io/kairos-sdk/blob/89782e99331ad4a703fe2b42f4fce4d9140635ab/state/state.go#L117-L135 |
@Itxaka is it the detectBoot that needs to change so that it detects "COS_OEM + install-mode" as |
detectBoot should be the correct one to change it, currently its set by immucore on boot using the sdk but with extra stuff to detect which mode we are in, that should be moved into the sdk: detect that we are on uki mode: https://github.com/kairos-io/immucore/blob/master/pkg/mount/dag_steps.go#L386 Hopefully the change would be there, otherwise immucore can be changed to just not write the |
Just for reference: we need to detect if we are either booting into active, passive, livecd or recovery. Basically we need to map the standard Kairos states of the system, but also in UKI mode. |
You are right. And it relates to this: #2051 (comment) , right? I wonder if this story depends on #2051 then. |
correct, maybe we should actually extract the state identification from the reset (to not overload the card) |
According to the discussion in the channel:
From my point of view is clear that there 2 sentinels needed, one for active/passive/recovery and one for uki as otherwise there is not enough info for the default config files to do the proper thing. There are things that we may run in active non-uki that we cannot run in active-uki, so it makes sense to have more than 1 sentinel otherwise a lot of issues are gonna arise (hence the need for a uki sentinel in the first place) Maybe we just set the liveCD when booting from media and a uki sentinel for any uki boot?
|
from an operational standpoint, the UKI sentinel is needed to have, but we really need the sentinel that a Kairos GRUB-based system has, as many of the cloud configs stages depend on that. That means to have a sentinel file for each of the state (active state sentinel, recovery mode sentinel, live cd sentinel, ... and so on so forth). |
yes, that was my point, "normal sentinel" + uki sentinel so we know we are on uki and with that combination we can know if we are on uki livecd or uki installed system |
WIP branch for kairos-sdk: 2226-detect-boot-state |
I've found out (the hard way) that:
|
With the various PRs integrated in one image, it now correctly identifies live mode:
active mode:
passive mode:
and recovery:
|
All PRs now merged. Keeping this ticket open, until we bump immucore and kairos-agent on this repository. |
All merged and working. Closing this. I built an image with:
|
In Kairos we use to have sentinel files either if we are booting for instance into active, passive, recovery or livecd. This is now not respected anymore when booting with UKI files.
Boot mode shows as unknown in /run/cos and kairos-agent get mode command.
Kairos Version: v3.0.0-alpha2
The text was updated successfully, but these errors were encountered: