-
Notifications
You must be signed in to change notification settings - Fork 54
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
make configurable boot-assessment checks #2018
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2018 +/- ##
==========================================
+ Coverage 72.34% 72.36% +0.01%
==========================================
Files 76 76
Lines 8992 9009 +17
==========================================
+ Hits 6505 6519 +14
- Misses 1944 1946 +2
- Partials 543 544 +1 ☔ View full report in Codecov by Sentry. |
pkg/features/embedded/boot-assessment/usr/sbin/elemental-boot-assessment
Show resolved
Hide resolved
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.
Nice improvement to the boot-assessment!
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.
If no checkers are provided boot-assessment behaves as it used to do, with the only real difference that the boot-assessment is verified as passed in a slightly later phase than it used to do (boot
yip's stage).
|
||
StartLimitAction=reboot | ||
StartLimitIntervalSec=300 | ||
StartLimitBurst=5 |
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.
If there are more than 5 failures within a time frame of 5min this will trigger a reboot.
#!/bin/bash | ||
|
||
declare checkResultsPath="/run/elemental/boot-assessment" | ||
declare checkersPath="/usr/libexec/elemental-checker" |
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.
Any script/executable included in this folder will be executed with check
argument. If it returns no error marks the script as passed (so it won't be executed again in any eventual retry), if it returns an error raises the error flag and continues with the rest of the checks. In case any of the executed scripts fails this script runs an exit 1
which causes the service to fail and restart again after 30seconds.
pkg/features/embedded/boot-assessment/usr/sbin/elemental-boot-assessment
Outdated
Show resolved
Hide resolved
9797424
to
2128723
Compare
pkg/features/embedded/boot-assessment/usr/sbin/elemental-boot-assessment
Show resolved
Hide resolved
# sourced in /grubcustom/custom.cfg file, which is only meant to source additional files. | ||
# So far there is no regexp module in most grub2 efi signed images, hence it is not possible to | ||
# to iterate over the configuration files in /grubcustom folder to load them all. Instead the | ||
# pattern is to manually append additional sourced files in /grubcustom/custom.cfg. |
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.
I could not manage to find a proper way of doing it. I did not want to include this in grub.cfg because this is coupled with the boot-assessment feature and grub is provided by another independent feature. I like the idea of keeping the option of installing without any kind of boot-assessment logic.
My desired setup was defining a /grubcustom
folder for which the main grub.cfg
would source all the existing configuration files, this way we could easily include additional custom changes besides the bootassessment.cfg
. However I could not find a way to iterate over files found in a path, this could be possible by using the regexp
grub2 module, but this does not come included signed efi images by default.
The fallback test new logic tests the following: upgrades to a broken system:
|
3fc254c
to
bdc94a5
Compare
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.
Awesome, great job!
Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: David Cassany <dcassany@suse.com>
This commit refactors the boot-assessment logic to run checks with a customizable service and to store grub variables in already existing files in EFI partition and OEM. Also the EFI partition is made accessible in after-*-chroot hooks. This makes easier to write and manage files in EFI partition if needed (e.g. grub_oem_env variable file), without having to relay on mounts or remounts. Signed-off-by: David Cassany <dcassany@suse.com>
bdc94a5
to
f4f5dcb
Compare
Part of rancher/elemental#1263