项目作者: u-root

项目描述 :
Open-source firmware for your baseboard management controller (BMC)
高级语言: Go
项目地址: git://github.com/u-root/u-bmc.git
创建时间: 2018-09-14T08:58:10Z
项目社区:https://github.com/u-root/u-bmc

开源协议:BSD 3-Clause "New" or "Revised" License

下载


u-bmc

Build
Status
Go Report
Card
License

Description

u-bmc uses u-root to create a Linux OS distribution that is fully open-source.

u-bmc borrows and contributes to OpenBMC which has
similar high-level goals. The main difference is that u-bmc chooses to challenge the industry status quo,
e.g. where OpenBMC uses IPMI, u-bmc uses gRPC.

Attention

This project is currently undergoing some heavy maintenance. Don’t use in production yet!

Demo

asciicast

Why?

BMC software has historically been known to be insecure. There is no inherent reason for that.
u-bmc sets out to improve this by offering an alternative built on modern technologies.

Support

u-bmc is still in experimental stage and is currently only supporting
BMCs based on ASPEED AST2400 and AST2500. Other BMC SOCs are planned, and if you want
to contribute let us know.

Currently the supported boards are:

  • Open Compute Project: Quanta F06 Leopard DDR3
  • Aspeed AST2500 Evaluation Board

Planned boards are:

  • ASRock Rack PAUL
  • Nuvoton Poleg BMC NPCM7XX Evaluation Board
  • Open Compute Project: Quanta F20 Yosemite
  • Tyan Tempest CX S7106

Do you want to become a contributor of a board? Let us know!

Roadmap

To give you some sense of what we want to create:

  • All function exported over gRPC like:
    • Serial-over-LAN
    • Sensor data
    • iKVM
    • Updating BIOS
    • POST information
  • Implementation of OpenMetrics for Prometheus integration for sensors
  • Offer SSH server for on-platform debugging
    • Support SSH CA-signed certificates to avoid having to upload a bunch of certs
  • USB device emulation
    • Must have: USB storage from image
    • Cool to have: USB ethernet to host, replaces KCS IPMI interface.
    • Cool to have: USB graphics card + mouse + keyboard for KVM
  • Optional WebUI
    • Uses the same API as the gRPC client
    • optional so the BMC can stay lean without loosing functionality

Usage

Prerequisites:

u-bmc uses the Taskfile build system, install it using their official installation guide.

Packages needed:

  • go (at least 1.17)
  • gcc-arm-none-eabi (for arm32)
  • gcc-aarch64-linux-gnu (for arm64)
  • mtd-utils (for targets using flash)
  • erofs-utils (for targets using block devices)
  • fakeroot
  • flex
  • bison
  • device-tree-compiler
  • bc
  • libssl-dev
  • libelf-dev
  • qemu-kvm

Get them for 32bit via e.g.:

  1. sudo apt install gcc-arm-none-eabi mtd-utils golang fakeroot flex bison device-tree-compiler bc libssl-dev libelf-dev qemu-kvm

We also need both u-bmc and u-root in our GOPATH so install them with:

  1. GO111MODULE=off go get github.com/u-root/u-root
  2. GO111MODULE=off go get github.com/u-root/u-bmc

Or use git clone:

  1. mkdir $GOPATH/src/github.com/u-root
  2. cd $GOPATH/src/github.com/u-root
  3. git clone https://github.com/u-root/u-root
  4. git clone https://github.com/u-root/u-bmc

Setup configuration:

  1. # SSH ECDSA public keys does not work for now
  2. cp ~/.ssh/*.pub config/ssh_keys.pub
  3. # Agree to the terms of the configured ACME server
  4. # By default it's just a toy ACME server so this is fine, but if you're
  5. # using another ACME server like Let's Encrypt (LE) ensure you agree to their terms.
  6. # For LE, you can find them at https://letsencrypt.org/repository/.
  7. touch i_agree_to_the_acme_terms
  8. task config:generate

Build image:

  1. cp TARGET.tmpl TARGET

then uncomment the desired target platform e.g. qemu-virt-a72 in TARGET and run

  1. task build

Since u-bmc uses signed binaries it is important that you back up the
contents of build/boot/keys/ after building as u-bmc will only accept updates
signed with these keys.

Simulator

Trying out u-bmc is easiest using the simulator.
First select a Qemu target in the TARGET file then to launch it, run:

  1. # Build Qemu target
  2. task build
  3. # Launch a local ACME server in one terminal
  4. task pebble
  5. # Launch the u-bmc simulator in another terminal
  6. task virtual-bmc -- 64bit
  7. # (Optional, run in another terminal) Launch a local emulated BIOS to produce some data on the UART
  8. # Needs to have u-bmc simulator above running for it to attach correctly.
  9. task virtual-host

When simulating the following TCP/IP ports are set up:

  • 6053/udp: u-bmc DNS
  • 6443/tcp: u-bmc gRPC
  • 9370/tcp: u-bmc OpenMetrics

When the u-bmc guest tries to access 10.0.2.100 a local service called
ubmc-pebble is started which uses Let’s Encrypt’s pebble service to generate
an HTTPS certificate. The CA used is located in config/sim-ca.crt.

You can interact with u-bmc running in the simulator by pressing Enter to get a shell
or by using ubmcctl:

  1. go install github.com/u-root/u-bmc/cmd/ubmcctl
  2. # The root CA is regenerated every time pebble is started to prevent
  3. # testing to accidentally become production
  4. curl https://localhost:14000/root --cacert config/sim-pebble.crt > root.crt
  5. echo '127.0.1.2 ubmc.example.com' | sudo tee -a /etc/hosts
  6. SSL_CERT_FILE=root.crt ubmcctl -host ubmc.example.com:6443

If you restart pebble you need to update root.crt.

Testing

The easiest way to run all unit tests is to run task test.

To run the integration tests: task test.

If you’re using a supported platform and want to try it on your hardware you
can use socflash_x64 provided by ASPEED like this:

  1. echo This is extremely likely to break things as u-bmc is still experimental
  2. sudo ./socflash_x64 of=bmc-backup.img if=flash.img lpcport=0x2e option=glc

Uploading a new version

If you want to quickly upload a new build of u-bmc without updating the kernel,
you can use SCP like this:

  1. scp build/rootfs/bin/bb my-ubmc:/bb
  2. scp build/rootfs/bin/bb.sig my-ubmc:/bb.sig
  3. ssh my-ubmc
  4. # Verify that bb is sane by executing /bb
  5. /bb
  6. # Should return:
  7. # <timestmap> You need to specify which command to invoke.
  8. # Exception: /bin/bb exited with 1
  9. # [tty], line 1: /bin/bb
  10. mv /bb /bin/bb
  11. mv /bb.sig /bin/bb.sig
  12. # Verify the signature before rebooting
  13. gpgv /etc/u-bmc.pub /bin/bb.sig /bin/bb
  14. sync
  15. shutdown -r

Contributions

See CONTRIBUTING.md

Since this is an early experiment if this is at all interesting for you or your
company, do reach out in our Slack channel: