-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add boot assesment for install and bootentry #604
Conversation
I need to check upgrade as Its not clear what it does. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #604 +/- ##
==========================================
+ Coverage 48.14% 48.47% +0.32%
==========================================
Files 48 48
Lines 6023 6100 +77
==========================================
+ Hits 2900 2957 +57
- Misses 2844 2862 +18
- Partials 279 281 +2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Itxaka <[email protected]>
Signed-off-by: Itxaka <[email protected]>
Signed-off-by: Itxaka <[email protected]>
d7454bc
to
a15632a
Compare
Signed-off-by: Itxaka <[email protected]>
Signed-off-by: Itxaka <[email protected]>
Seems to work. During install:
During boot:
On upgrade and reset:
|
Signed-off-by: Itxaka <[email protected]>
This output is strange:
how did active.conf end up with title "Kairos recovery" (you run a reset before?). When we reset from recovery, shouldn't we replace the I'm not sure how the above state was reached so I may be confusing things. |
yes, this was a reset from recovery, which I guess makes sense somehow? Notice that it was after 32 runs so that may not be the usual as I was testing with different things all the time. In any case, this PR does not change that code, nor it modifies the contents of the entries themselves, just the filenames to append +3 AND it does it after that output, so if there is any issue with that, it happens before and not due to this PR....I think. As the boot assessment is triggered afterwards |
} | ||
|
||
// Read the directory. | ||
entries, err := fs.ReadDir(dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is assuming the glob character will be in the file part. It will not work for patterns like "/mydir/*/myfile". I guess we don't care but maybe pattern
should be called filePattern
instead and have another argument for the directory (which will not support globing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm good point, it wont.
}) | ||
It("fails to write the boot assessment in non existing dir", func() { | ||
err := utils.AddBootAssessment(fs, "/fake", logger) | ||
Expect(err).To(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use MatchError
to match the specific error. Just in case something else fails in the future instead of the expected error.
I wonder if it would be possible to have an e2e test for this. Unit testing doesn't really test that we indeed boot into fallback automatically. Setting this up will definitely be tricky... |
I tried this branch and it seems to be doing correct things in regards to naming conf files. What we miss is:
mount -o remount,rw /efi
/usr/lib/systemd/systemd-bless-boot bad
reboot (From the FAQ here) We probably need to play with Merge and create tickets for the additional stuff? |
Part of kairos-io/kairos#2864
The way it works: