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

Trigger udev to populate disk info #328

Merged
merged 2 commits into from
May 23, 2024
Merged

Trigger udev to populate disk info #328

merged 2 commits into from
May 23, 2024

Conversation

jimmykarily
Copy link
Contributor

because otherwise, sometimes the encrypted partition doesn't show up as type: crypto_LUKS but as type: unknown making kcrypt skip it completely

Part of kairos-io/kairos#2511

(an additional seems to be needed in kairos-agent when locking the partitions to fully fix the issue)

because otherwise, sometimes the encrypted partition doesn't show up as
type: crypto_LUKS but as type: unknown making kcrypt skip it completely

Part of kairos-io/kairos#2511

(an additional seems to be needed in kairos-agent when locking the
partitions to fully fix the issue)

Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily jimmykarily self-assigned this May 23, 2024
@jimmykarily jimmykarily requested a review from a team May 23, 2024 10:41
Copy link
Member

@Itxaka Itxaka left a comment

Choose a reason for hiding this comment

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

Im wondering if we should also trigger + sync in the luksify part, where we create the device first, then wait for it and format it.

Seems like that has never hit an issue though, so maybe its not needed. But it may make us avoid having to trigger on agetn and consumers of the lib?

@jimmykarily
Copy link
Contributor Author

Im wondering if we should also trigger + sync in the luksify part, where we create the device first, then wait for it and format it.

Seems like that has never hit an issue though, so maybe its not needed. But it may make us avoid having to trigger on agetn and consumers of the lib?

I did hit this issue too and I was planning to do a similar call right after this: https://github.com/kairos-io/kairos-agent/blob/f39d257f2238f70c9399b02867f60c0d87ad1728/internal/agent/hooks/kcrypt_uki.go#L87

Should I do that in kcrypt instead (inside Luksify somewhere)?

@Itxaka
Copy link
Member

Itxaka commented May 23, 2024

Im wondering if we should also trigger + sync in the luksify part, where we create the device first, then wait for it and format it.
Seems like that has never hit an issue though, so maybe its not needed. But it may make us avoid having to trigger on agetn and consumers of the lib?

I did hit this issue too and I was planning to do a similar call right after this: kairos-io/kairos-agent@f39d257/internal/agent/hooks/kcrypt_uki.go#L87

Should I do that in kcrypt instead (inside Luksify somewhere)?

I think so yeah, so its the kcrypt lib the one responsible to search and retry properly to get the device. Maybe adding it in Luksify only its the correct choice (after all luksify is run in the install before the unlock fails) but triggering it twice should be of no issue.

Signed-off-by: Dimitris Karakasilis <[email protected]>
Copy link
Member

@Itxaka Itxaka left a comment

Choose a reason for hiding this comment

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

looks good to me, good work!

@Itxaka Itxaka mentioned this pull request May 23, 2024
@jimmykarily jimmykarily merged commit 3943784 into main May 23, 2024
7 checks passed
@jimmykarily jimmykarily deleted the 2511-call-udev branch May 23, 2024 13:01
if err != nil {
return "", fmt.Errorf("udevadm trigger failed: %w, out: %s", err, out)
}
SH("sync") //nolint:errcheck
Copy link
Member

Choose a reason for hiding this comment

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

ah this answers my question in the other repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants