Commit dff79d20 authored by Josua Mayer's avatar Josua Mayer

create container build environment

parent 4ec41a94
......@@ -7,9 +7,22 @@ They are used in SolidRun quickly build images for development where those image
The sources are pulled from NXP's codeaurora repository and patched after being clone using the patches in the patches/ directory
## Build
## Build with Docker
A docker image providing a consistent build environment can be used:
1. build container image (first time only)
```
docker build -t lx2160a_build docker
```
2. invoke build script in working directory
```
docker run -i -t -v "$PWD":/work lx2160a_build $(id -u) $(id -g)
```
## Build with host tools
Simply running ./runme.sh will check for required tools, clone and build images and place results in images/ directory.
## Customize
By default the script will create an image bootable from SD (ready to use .img file) with DDR4 SO-DIMMs 3200Mtps, SERDES configuration 8/5/2 (SERDES1 = 8, SERDES2 = 5, SERDES = 2) and u-boot as boot loader.
Following are the environment variables that can be modified -
......@@ -23,10 +36,14 @@ Selecting SERDES configuration - *SERDES=SD1_SD2_SD3*
Selecting boot loader - *BOOT_LOADER=u-boot,uefi*
Examples -
`./runme.sh` will generate *images/lx2160acex7_2000_700_3200_8_5_2_sd.img*
### Examples:
generate *images/lx2160acex7_2000_700_3200_8_5_2_sd.img*:
- `./runme.sh` **or**
- `docker run -i -t -v "$PWD":/work lx2160a_build $(id -u) $(id -g)`
`BOOT=xspi ./runme` will generate *images/lx2160acex7_2000_700_3200_8_5_2_xspi.img*
generate *images/lx2160acex7_2000_700_3200_8_5_2_xspi.img*:
- `BOOT=xspi ./runme` **or**
- `docker run -i -t -v "$PWD":/work -e BOOT=xspi lx2160a_build $(id -u) $(id -g)`
## Deploying
For SD card bootable images, plug in a micro SD into your machine and run the following, where sdX is the location of the SD card got probed into your machine -
......
# use debian base
FROM debian:buster-slim
# update
RUN set -e; \
apt-get update; \
apt-get -y upgrade; \
:
RUN apt-get -y install wget make tar p7zip-full squashfs-tools vim e2fsprogs parted dosfstools acpica-tools mtools device-tree-compiler xz-utils sudo gcc libssl-dev python2 bison flex u-boot-tools git bc fuseext2
# build environment
WORKDIR /work
COPY entry.sh /
ENTRYPOINT ["/bin/sh", "/entry.sh"]
#!/bin/sh -e
# Copyright 2018-2019 Josua Mayer <josua@solid-run.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
if [ $# -ne 2 ]; then
echo "Error: Missing arguments uid and gid!"
echo "Maybe you forgot to pass <uid> <gid> to docker run?"
exit 1
fi
_UID=$1
_GID=$2
# create build user (and group if it does not exist)
groupadd -g $_GID build 2>/dev/null || true
useradd -s /bin/bash -m -u $_UID -g $_GID build
# preconfigure git identity
sudo -u build git config --global user.name "LX2160A Toolchain Container"
sudo -u build git config --global user.email "support@solid-run.com"
# now run the build script as the build user
sudo -u build bash /work/runme.sh
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment