How to build openBMC binary for Barreleye

Barreleye is the openPOWER server that Rackspace helped build.  It runs openBMC for it’s management.

In my work at Rackspace, I often build custom openBMC builds for the sake of testing stability / new features.

Here’s how you can build your own openBMC binary for Barreleye.

If you are building on Ubuntu you need to install following packages before you build openBMC:

sudo apt-get install -y git build-essential libsdl1.2-dev texinfo gawk chrpath diffstat

If you are building on Fedora 23 you need to install the following packages before you build openBMC

sudo dnf install -y git patch diffstat texinfo chrpath SDL-devel bitbake
sudo dnf groupinstall "C Development Tools and Libraries"

 

Build Process:

First, clone the openBMC repository. If you are cloning form master this is how you’d do it:

git clone https://github.com/openbmc/openbmc

Then run the following commands:

cd openbmc
TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf . oe-init-build-env
bitbake obmc-phosphor-image

 

If you run it a laptop with decent power, it takes about 2-3 hours. If you run it on a Barreleye (this is where I make you jealous) it takes about 35 minutes to build the binary.

The built binaries are in openbmc/build/tmp/deploy/images/barreleye location

In my case I use the barreleye-20160818194255.all.tar image and untar it to get an file named ‘image-bmc’ about 32MB in size .

You can  use a flash programmer to flash your BMC chip with this new version or use the openBMC online upgrade process.

If you wanna rebuild your binary, then you will have to first clear your config before you run above 3 commands again.

This is the command to clear the config:

rm -rf build/conf

Comment here for any issues you run into, while building the binary or if you want a link to a latest binary.

 

Advertisements
How to build openBMC binary for Barreleye

4 thoughts on “How to build openBMC binary for Barreleye

  1. Hi, good stuff,
    how you are updating openbmc on your barreleye? Any best practices?
    i’ve got the barreleye server with quite old openbmc version and would like to update it to the latest one (to explore the features etc).
    What is the best (i.e safe way) from your experience?

    Like

    1. adi says:

      Hi Kachini

      The best way to upgrade the BMC is to move the image to /run/initramfs

      Here is the procedure I follow and it is very safe:

      Copy the full BMC flash file binary as /run/initramfs/image-bmc (Should be 32 MB big)
      Copy /dev/mtd2 to /run/initramfs/image-u-boot-env (This is to backup uboot environment variables and hence save the mac address )
      Restart the BMC with a ‘reboot’ command

      Like

  2. Basu says:

    Adi, if I understand correctly, you backup uboot environment, just in case if flash update failed due to some reason (may be image-bmc is corrupted or you hit the reboot before the copy finished, etc.)
    You would then be in limbo after reboot….
    If you get into this situation then you could get to uboot with the backup and try copying bmc-image again?

    Liked by 1 person

  3. Adi says:

    Hi Basu

    Uboot has it’s own ‘u-boot’ partition where it contains the core uboot bootloader .

    “u-boot-env” partition is different from above and has the mac address and other environment variables.

    Actually this is what happens when you copy ONLY ‘image-bmc’ in directory and ‘reboot’ :
    a) All services are brought down as a part of standard reboot script
    b) Now is when BMC is working from RAM only and has basic services needed for flashing the BMC Flash
    c) Complete BMC flash is over written with ‘image-bmc’ (including u-boot-env, which means your mac address is lost). There is how is was in 1.0.
    d) Then boot with the newly flashed BMC flash code that now has contents of ‘image-bmc’

    As you can imagine, now, if the image-bmc is corrupted while downloading itself, what happens when booting back up after flashing it depends on what part of it was corrupted. If ‘u-boot’ partition is fine u-boot will boot and will look for ‘u-boot-env’ partition to get the mac address and then boot with the kernel partition.

    This is what happens when you copy ‘image-bmc’ AND copy the ‘image-u-boot-env’ partition backup located at /dev/mtd2 in directory and ‘reboot’ :

    a) All services are brought down as a part of standard reboot script
    b) Now is when BMC is working from RAM only and has basic services needed for flashing the BMC Flash
    c) Complete BMC flash is over written with ‘image-bmc’ (including u-boot-env is over-written)
    d) Now the backed up ‘image-u-boot’ which contains the mac address is over written to restore the mac address
    e) Then boot with the newly flashed BMC flash code that now has contents of ‘image-bmc’ and backed up ‘image-u-boot-env’

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s