Petitboot

From RCS Wiki
Revision as of 17:57, 8 April 2022 by Borley (talk | contribs) (Clarify optional involvement of router/switch)
Jump to navigation Jump to search

Petitboot (Petitboot): OS bootloader implemented as a Linux userspace application using kexec. The Petitboot bootloader provides a boot menu and boots the chosen boot option using the Linux kernel's kexec functionality. Generally runs under Skiroot as part of the boot process.

Because Petitboot runs in a Linux environment, it is able to detect any storage devices or network adapters which are detected by the Linux kernel embedded in the firmware. This avoids the need to implement drivers for boot devices twice (once for Linux, once for a bootloader): if Linux can see it, you can boot it.

Petitboot is open source.

Reset lost Petitboot credentials

In the event of a lost or forgotten Petitboot menu passphrase, it should be possible to clear as long as the BMC remains accessible. Credentials for Petitboot reside separate from the BMC. This procedure will completely rewrite the Power NOR (PNOR) flash chip to defaults.

Prepare the following:

  • A helper computer. Preferably of reasonable trustworthiness as your BMC credentials will be handed through this device.
  • Ethernet cabling and possibly a router (only required if the BMC static IP is also unknown/forgotten) which will never touch the public internet afterward.
  • The OpenPOWER firmware for your PNOR flash chip, verified with GPG. The release version should match the same release as your BMC.

Establish that you can first log into the BMC. If you are uncertain which static IP it was set to, run nmap from your helper computer. Assuming it is known the range was originally set within 10.0.10.*:

my_helper_pc$ nmap -v 10.0.10.1/24

The helper computer (or router between the two computers) should be set to this same address space.

Acquire the OpenPOWER firmware, verify and decompress it, then copy the *.pnor (or *.bin if 1.00 series) to the helper system.

Following the steps outlined in Compiling Firmware, transfer the firmware image:

my_helper_pc$ scp <APPROPRIATE_FIRMWARE>.pnor root@$10.0.10.99:/tmp/

With host power off, log into the BMC and apply the new firmware following the Updating Firmware procedure:

root@blackbird:~# pflash -E -p /tmp/<APPROPRIATE_FIRMWARE>.pnor

root@blackbird:~# pflash -P CVPD -c

The process will take a few minutes to complete. Let the system, a Blackbird in this example, restart. You will find that the Petitboot menu credentials can now be set anew.

Whenever entering new credentials into the Petitboot passphrase prompt, please note that Petitboot menu does not check against typos by using multiple entries. It also does not display any characters as you type. This leaves a lot of room for user error and one needs to be absolutely mindful of what is entered into this form.

References