Skip to content

Commit

Permalink
oe-build: Further update to readme
Browse files Browse the repository at this point in the history
Also copy the default user files when creating the "oe-builder" folder
so that the bash prompt looks familiar (the .bashrc file is existing)

Signed-off-by: Joerg Hofrichter <[email protected]>
  • Loading branch information
joergho authored and mbr0wn committed May 10, 2019
1 parent f6940ca commit aa03d18
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions oe-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,39 @@

To build this container from source, navigate to this directory and run:

$ sudo docker build -t ettusresearch/oe-build .
$ sudo docker build -t ettusresearch/oe-build .

## Building an SD card image using the Docker container

Navigate to a location with sufficient disk space. There, create a new directory
called `oe-builder` and make it writable by everyone:
called `oe-builder`, and make it writable by everyone. Also copy the default
user files like .bashrc:

$ mkdir oe-builder && chmod 777 oe-builder
$ mkdir oe-builder && chmod 777 oe-builder && cp -r /etc/skel/. oe-builder

Then run the Docker container:

$ docker run -i -t -v $(pwd)/oe-builder:/home/oe-builder:rw,z ettusresearch/oe-build /bin/bash
$ docker run -i -t -v $(pwd)/oe-builder:/home/oe-builder:rw,z ettusresearch/oe-build /bin/bash

Note the order of the naming above might vary by Docker version, sometimes it
might need to be:

$ docker run -i -t ettusresearch/oe-build -v $(pwd)/oe-builder:/home/oe-builder:rw,z /bin/bash
$ docker run -i -t ettusresearch/oe-build -v $(pwd)/oe-builder:/home/oe-builder:rw,z /bin/bash

After running the previous command, you will be inside the container.
The first time you run the Docker container, you need to setup the layers.
There are various ways to do this, the easiest is to refer to a branch or tag
on the oe-manifests repository, and have it instantiate the defaults. Here, we
grab the defaults from the `sumo` branch:

$ repo init -u git://github.com/EttusResearch/oe-manifests.git -b sumo
$ repo sync
$ repo init -u git://github.com/EttusResearch/oe-manifests.git -b sumo
$ repo sync

Recent versions of meta-ettus contain a script that will automate building a
filesystem for you. For example, if you want to build an N310 filesystem, run
the following command from your home directory:

$ ./meta-ettus/contrib/build_imgs_package.sh n3xx v3.14.0.0
$ ./meta-ettus/contrib/build_imgs_package.sh n3xx v3.14.0.0

Note this will not only build the filesystem, but it will also zip it up in the
same way files are packaged for shipping with `uhd_image_downloader`.
Expand All @@ -44,21 +45,33 @@ If you prefer a more manual process, the following steps will guide you:

Before compiling, configure your build environment:

$ TEMPLATECONF=`pwd`/meta-ettus/conf/sulfur source ./oe-core/oe-init-build-env ./build ./bitbake
$ TEMPLATECONF=$(pwd)/meta-ettus/<MACHINELAYER>/conf
$ source ./oe-core/oe-init-build-env ./build ./bitbake

If you get a warning regarding chmod, you can ignore it.

Then, you can invoke bitbake to build the image:
This will setup the following configuration files inside the `conf` directory:

$ bitbake developer-image
- `local.conf` - this file includes the local user configurations for the build environment like the Distribution (`DISTRO`) and the target hardware (`MACHINE`) to be used
- `bblayers.conf`- this file includes the list of layers to be used

To build the according SDK, run
`<MACHINELAYER>` can be either of the following:

- `meta-neon-mender` for E320 (with Mender support)
- `meta-sulfur-mender` for N3xx series (with Mender support)

More information on the configuration options and the required layers is provided in the `meta-ettus/README` file ([the latest version is available here](https://github.com/EttusResearch/meta-ettus)). It lists the supported values for `MACHINE` which look something like this:

MACHINE="ni-sulfur-rev6-mender" # for N3xx
MACHINE="ni-neon-rev2-mender" # for E320

$ bitbake developer-image -cpopulate_sdk

Note that "developer-image" is the name of the build target; the machine (i.e.,
the USRP) that you're targeting is defined in the conf/local.conf file in the
build directory. It will look something like this:
Then, you can invoke bitbake to build the image:

$ bitbake developer-image

To build the according SDK, run

MACHINE="ni-sulfur-rev2-mender"
$ bitbake developer-image -cpopulate_sdk

Note that "developer-image" is the name of the build target.

0 comments on commit aa03d18

Please sign in to comment.