init: Add a hook to download files

Add a hook to run a shell command line that is stored in a u-boot
environment variable.  Only execute this command if the previously
established options file has a keyword trigger.  Do not even consider
the option if a build option flag is not set to y.

This allows one to specify at u-boot commands that would download
a read-only file system into memory for execution this boot instead
of needing to create a custom initramfs to netboot or specifing
debug-init-sh, entering the password, and doing the download from
the shell.

If the u-boot environment variable is empty or missing but both
the build variable is set and the keyword trigger are set print
a diagnostic message.  If the command fails invoke standard
debug_takeover for corrective action.

An example script:
fw_setenv openbmcinitdownload 'cp /proc/net/pnp /run/resolv.conf ; ln -snf ../run/resolv.conf /etc/resolv.conf ; wget -O /run/image-rofs http://server.example.com/path/image-test-rofs'
1 file changed
tree: 52eea1931c3441e518a347c76b14076e8d3ffb90
  1. meta-openbmc-bsp/
  2. meta-openbmc-machines/
  3. meta-phosphor/
  4. yocto-poky/
  5. .gitignore
  6. .templateconf
  7. openbmc-env
  8. README.md
README.md

OpenBMC

Build Status

Building

OpenBMC uses Yocto/Open-Embedded for a build system, which supports an out-of-tree build. It is recommended that you create an empty directory somewhere to hold the build. This directory will get big.

On Ubuntu 14.04 the following packages are required to build the default target

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

On Fedora 23 the following packages are required to build the default target:

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

To start a build:

cd <builddir>
. <repodir>/openbmc-env
bitbake obmc-phosphor-image