open-power / petitboot

GNU General Public License v2.0
212 stars 56 forks source link

Need a protocol to specify boot partition UUID from BMC #45

Closed AlexanderAmelkin closed 5 years ago

AlexanderAmelkin commented 6 years ago

IPMI Specification defines a number of "boot parameters" that can be set via Set System Boot Options command. Among those parameters are:

The former is fully supported by Petitboot, while the latter isn't. The data contained in the "mailbox" is not specified except for the size and the first four data bytes. It is proposed to develop a specification for this mailbox to be used to communicate additional boot parameters from BMC to Petitboot beyond those settable via "Boot flags". Specifically, a UUID of the desired boot partition needs to be settable.

Support for that will then be added into OpenBMC.

sammj commented 6 years ago

Reading from the spec:

IPMI allows software to use the boot initiator mailbox as a way for a remote application to pass OEM parameters for additional selection of the boot process and direction of the startup of post-boot software. If additional parameters are not included, the system boots the primary/first-scanned device of the type specified.

So that could be a nice way of doing a Petitboot/OpenPOWER specific way of specifying individual boot options. Better than just a UUID, we could format the info such that it matches what Petitboot stores in NVRAM.

jk-ozlabs commented 6 years ago

@sammj: good idea - in that case, we'd have free-form flexibility to define any boot option - not just partitions, but also network interfaces, etc.

causten commented 6 years ago

Any chance the free-form could be something that could be executed at the Petitboot prompt? My org wants to run a script from the command line which launches a Redhat Kickstart file. If my suggestion is not compatible with this issue I can open a different one. It just sounds like you are forming some boot features

AlexanderAmelkin commented 6 years ago

@causten, there are just 80 bytes of data in the mailbox. No space for scripts. Besides, it sounds to me like a security hole. What your organization wants sounds a lot like initrd loaded via BOOTP. And, yes, it doesn't look compatible with this issue.

ghost commented 6 years ago

Chris Austen notifications@github.com writes:

Any chance the free-form could be something that could be executed at the Petitboot prompt? My org wants to run a script from the command line which launches a Redhat Kickstart file. If my suggestion is not compatible with this issue I can open a different one. It just sounds like you are forming some boot features

Do keep in mind that we explicitly do not guarantee anything in the shell environment as ABI. We do say that petitboot plugins will continue to work though.

-- Stewart Smith OPAL Architect, IBM.

causten commented 6 years ago

I've opened a new issue for my request. Sorry for the interruption of your current request.

sammj commented 5 years ago

I've put together a WIP of the Petitboot support here: https://github.com/sammj/petitboot/tree/ipmi-mailbox Assuming I'm reading the spec right that could work as is, but I need to confirm a few details. I wonder if any of the BMCs around here support the mailbox feature.. :thinking:

sammj commented 5 years ago

Turns out AMI BMCs support this, eg:

➜  ~ ipmi-fstn3 raw 0x00 0x08 0x07 0x00 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
➜  ~ ipmi-fstn3 raw 0x00 0x09 0x07 0x00 0x00
 01 07 11 11 11 11 11 11 11 11 11 11 11 11 11 11
 11 11

Which supports the minimum of 5 blocks. I've updated https://github.com/sammj/petitboot/tree/ipmi-mailbox to match, and I'll post it after some testing. That's probably enough for OpenBMC to go on, as long as they provide a way for the user to set that buffer, or even set it themselves, everything should hook up fine.

sammj commented 5 years ago

Series posted: http://patchwork.ozlabs.org/project/petitboot/list/?series=79302

AlexanderAmelkin commented 5 years ago

@sammj, the series clearly lack documentation for BMC developers.

Also, is there a way to review/comment the patches there? I wonder why don't you use GitHub PRs...

sammj commented 5 years ago

Fair point, I'll add some description; it's largely described by the IPMI spec but there's one or two things to consider when setting it for Petitboot.

Petitboot uses the mailing list (https://lists.ozlabs.org/listinfo/petitboot) for development & discussion much like other projects like Skiboot and the kernel. Github tends to be a useful place to track issues and the like :)

sammj commented 5 years ago

I added a bit of description of the mailbox implementation here: https://lists.ozlabs.org/pipermail/petitboot/2018-December/001240.html

sammj commented 5 years ago

Petitboot now supports this via https://github.com/open-power/petitboot/commit/78c3a044d2302bacf27ac2d9ef179bc35824af4c