Skip to content

Fix/cleanup chassis bootparam and bootdev options#165

Merged
AlexanderAmelkin merged 6 commits intomasterfrom
bugfix/163-boot-options-parsing-persistent-efiboot
Nov 12, 2019
Merged

Fix/cleanup chassis bootparam and bootdev options#165
AlexanderAmelkin merged 6 commits intomasterfrom
bugfix/163-boot-options-parsing-persistent-efiboot

Conversation

@AlexanderAmelkin
Copy link
Copy Markdown
Contributor

This resolves #163 and also cleans up chassis bootparam get decoding and chassis bootdev options=... parsing.

Please read individual commit messages.

@AlexanderAmelkin
Copy link
Copy Markdown
Contributor Author

@jvillal-amp, please check if this works for you.

Copy link
Copy Markdown

@jvillal-amp jvillal-amp left a comment

Choose a reason for hiding this comment

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

@jvillal-amp, please check if this works for you.

This resolved my issue. I tested setting DISK to PERSISTENT boot with EFI and it stayed that way for multiple boots. I also tested setting PXE to PERSISTENT boot with EFI and it stayed that way for multiple boots.

My testing command (without username/password/host):

ipmitool -I lanplus chassis bootdev disk options=efiboot,persistent
ipmitool -I lanplus chassis power cycle

and

ipmitool -I lanplus chassis bootdev pxe options=efiboot,persistent
ipmitool -I lanplus chassis power cycle

Thank you! 😊

vmauery
vmauery previously approved these changes Nov 6, 2019
Refactor the boot flags decoder:

* Add macros for boot flag bits, replace magic numbers in
  the `chassis bootparam get 5` and in `chassis bootdev`
  handlers.

  The macros are prefixed with BFx_ where x stands for the
  boot flags data byte as per IPMI 2.0 specification Table 28-14;

* Add decoding of remote/redirected media boot flags;

* Remove erroneous decoding of boot flags byte 3 bit 1 as
  Sleep button lockout whereas the bit is a part of console
  redirection setting;

* Fix console redirection settings reported under the 'BIOS verbosity'
  header and vice versa;

* Fix resetting of all other boot flags in the data byte when
  setting any of the bits in the same byte. This fixes inability
  to set both 'efiboot' and 'persistent' bits at the same time,
  and other similar cases.

Resolves #163
Signed-off-by: Alexander Amelkin <[email protected]>
There was a wrong help message regarding the console redirection,
and also the help formatting was a bit off. Straightened this all up.

Signed-off-by: Alexander Amelkin <[email protected]>
Move bootdev options parsing to a separate helper function

Signed-off-by: Alexander Amelkin <[email protected]>
* Get rid of magic '8' in bootdev options processing.

* Optimize the code of bootdev arguments processing, remove the
  special crafting of flags for 'clear-cmos' argument, make it use
  the same code as other options.

Signed-off-by: Alexander Amelkin <[email protected]>
In ipmi_chassis_main:

* Default to error return code (-1).

* Use centralized exit.

Signed-off-by: Alexander Amelkin <[email protected]>
For parameter checking replace calls to strncmp() with calls
to strcmp() in order to improve readability and get rid of literal
string lengths.

Signed-off-by: Alexander Amelkin <[email protected]>
@AlexanderAmelkin AlexanderAmelkin merged commit 42a023f into master Nov 12, 2019
@rustydb rustydb mentioned this pull request Apr 19, 2023
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to set options=efiboot,persistent

5 participants