-
Notifications
You must be signed in to change notification settings - Fork 16
bootloader: stop MenuEntry.contents getting clobbered by setNextBoot #184
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
Conversation
|
@rosslagerwall @freddy77 @GeraldEV sorry it looks like I don't have permission to add reviewers. |
xcp/bootloader.py
Outdated
|
|
||
| clear_default = ['\tunset override_entry', '\tsave_env override_entry'] | ||
| self.menu[entry].contents = clear_default | ||
| self.menu[entry].contents = clear_default + self.menu[entry].contents |
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 was idempotent before but now it is not. Could it be made idempotent?
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.
Added a check to make sure the data isn't already in the list before adding it
26f4b66#diff-ef827c75981754adfd2ddfe6664bca4b0642718b9a3fe197f9b54bd0ed53e48cR377
|
Can you please add a ticket reference to the commit message? I believe that @alexbrett was planning to open a PR with a significant rework of this code imminently so maybe check with him if these changes will collide. |
1360962 to
26f4b66
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #184 +/- ##
========================================
+ Coverage 83.2% 83.6% +0.3%
========================================
Files 23 23
Lines 3348 3368 +20
========================================
+ Hits 2788 2817 +29
+ Misses 560 551 -9
|
|
The Fixed this by adding cmdline args so |
26f4b66 to
bb777a0
Compare
…tNextBoot This makes MenuEntry.contents more useful as a way to inject arbitrary data into a menuentry. Before this change setNextBoot assumed it was the only user of this field as was clobbering any existing data. New method setGrubVariable() which will be used by an external tool. Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
|
Now it's failing because my test function names are too long and descriptive. |
Variable name "COUNTER" doesn't conform to '[a-z_][a-zA-Z0-9_]{0,30}$' pattern
Method name "test_set_grub_variable_throws_without_envfile" doesn't conform to '[a-z_][a-zA-Z0-9_]{2,34}$' pattern
Method name "test_contents_not_clobbered_by_setnextboot" doesn't conform to '[a-z_][a-zA-Z0-9_]{2,34}$' pattern
Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
|
Added an extra commit to fix the pylint errors
Alex said he will incorporate these changes as his aren't ready yet. |
|
Pylint failed because |
407265e to
3726ead
Compare
Doing RPU from a host with Secure Boot has extra challenges. We can't do XS9 Shim -> XS9 GRUB -> XS10 Xen because XS9 Shim can't verify XS10 Xen's signature. We need to chainload XS10 Shim before loading any XS10 components. XS9 Shim -> XS9 GRUB -> XS10 Shim -> XS10 Xen -> ... After chainloading XS10 Shim the system will end up back in the same GRUB menu so we also have a guard variable to ensure on first boot we chainload the shim and on second been we proceed with the RPU. Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
3726ead to
592acd3
Compare
|
Changes in last push: |
This makes MenuEntry.contents more useful as a way to inject arbitrary data into a menuentry. Before this change setNextBoot assumed it was the only user of this field as was clobbering any existing data.
New method setGrubVariable() which will be used by an external tool.