Commit b8cd48fe authored by Rabeeh Khoury's avatar Rabeeh Khoury Committed by GitHub

Merge pull request #8 from olofj/fix-docker

A few more docker/script fixes
parents 2ef43563 3a3eccee
......@@ -8,7 +8,7 @@ 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 with Docker
A docker image providing a consistent build environment can be used:
A docker image providing a consistent build environment can be used as below. Since some steps require mounting a loopback device, you need to grant permission for the container to do so when launching:
1. build container image (first time only)
```
......@@ -16,7 +16,7 @@ A docker image providing a consistent build environment can be used:
```
2. invoke build script in working directory
```
docker run -i -t -v "$PWD":/work lx2160a_build $(id -u) $(id -g)
docker run --cap-add SYS_ADMIN --device /dev/loop0 --device /dev/loop-control -i -t -v "$PWD":/work lx2160a_build $(id -u) $(id -g)
```
## Build with host tools
......@@ -39,11 +39,11 @@ Selecting boot loader - *BOOT_LOADER=u-boot,uefi*
### 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)`
- `docker run --cap-add SYS_ADMIN --device /dev/loop0 --device /dev/loop-control -i -t -v "$PWD":/work lx2160a_build $(id -u) $(id -g)`
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)`
- `docker run --cap-add SYS_ADMIN --device /dev/loop0 --device /dev/loop-control -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 -
......
......@@ -7,7 +7,11 @@ RUN set -e; \
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 e2tools multistrap qemu-user-static
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 e2tools multistrap \
qemu-user-static g++ cpio python unzip rsync
# build environment
WORKDIR /work
......
......@@ -21,9 +21,14 @@ _GID=$2
groupadd -g $_GID build 2>/dev/null || true
useradd -s /bin/bash -m -u $_UID -g $_GID build
# passwordless sudo for build user
adduser build sudo
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# 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"
cd /work
# now run the build script as the build user
sudo -u build -E bash /work/runme.sh
sudo -u build ./runme.sh
......@@ -41,7 +41,7 @@ if [ "x$UEFI_RELEASE" == "x" ]; then
fi
mkdir -p build images
ROOTDIR=`pwd`
PARALLEL=32 # Amount of parallel jobs for the builds
PARALLEL=$(getconf _NPROCESSORS_ONLN) # Amount of parallel jobs for the builds
SPEED=2000_700_${DDR_SPEED}
TOOLS="wget tar git make 7z unsquashfs dd vim mkfs.ext4 sudo parted mkdosfs mcopy dtc iasl mkimage e2cp truncate multistrap qemu-aarch64-static"
......@@ -195,7 +195,8 @@ echo "Building buildroot"
cd $ROOTDIR/build/buildroot
cp $ROOTDIR/configs/buildroot/lx2160acex7_defconfig configs/
make lx2160acex7_defconfig
make
make source -j${PARALLEL}
make -j${PARALLEL}
echo "Building restool"
cd $ROOTDIR/build/restool
......@@ -204,14 +205,14 @@ CC=${CROSS_COMPILE}gcc DESTDIR=./install prefix=/usr make install
echo "Building RCW"
cd $ROOTDIR/build/rcw/lx2160acex7
make clean
make -j32
make -j${PARALLEL}
if [ "x$BOOT_LOADER" == "xu-boot" ]; then
echo "Build u-boot"
cd $ROOTDIR/build/u-boot
#make distclean
make lx2160acex7_tfa_defconfig
make -j32
make -j${PARALLEL}
export BL33=$ROOTDIR/build/u-boot/u-boot.bin
fi
......@@ -252,7 +253,7 @@ if [ "x${BOOT}" == "xsd" ]; then
else
ATF_BOOT=flexspi_nor
fi
make -j32 PLAT=lx2160acex7 all fip pbl RCW=$ROOTDIR/build/rcw/lx2160acex7/XGGFF_PP_HHHH_RR_19_5_2/rcw_${SPEED}_${SERDES}_${BOOT}.bin TRUSTED_BOARD_BOOT=0 GENERATE_COT=0 BOOT_MODE=${ATF_BOOT} SECURE_BOOT=false
make -j${PARALLEL} PLAT=lx2160acex7 all fip pbl RCW=$ROOTDIR/build/rcw/lx2160acex7/XGGFF_PP_HHHH_RR_19_5_2/rcw_${SPEED}_${SERDES}_${BOOT}.bin TRUSTED_BOARD_BOOT=0 GENERATE_COT=0 BOOT_MODE=${ATF_BOOT} SECURE_BOOT=false
echo "Building mc-utils"
cd $ROOTDIR/build/mc-utils
......@@ -262,7 +263,7 @@ make -C config/
echo "Building the kernel"
cd $ROOTDIR/build/linux
./scripts/kconfig/merge_config.sh arch/arm64/configs/defconfig arch/arm64/configs/lsdk.config $ROOTDIR/configs/linux/lx2k_additions.config
make -j$PARALLEL all #Image dtbs
make -j${PARALLEL} all #Image dtbs
cat > kernel2160cex7.its << EOF
/dts-v1/;
......
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