Merge pull request #1649 from fewtarius/dev

Add simple container to provide linaro toolchains to build OGU kernel and u-boot.
This commit is contained in:
fewtarius 2023-06-30 16:19:08 -04:00 committed by GitHub
commit 63e22ea72d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 88 additions and 0 deletions

30
linaro/Dockerfile Normal file
View file

@ -0,0 +1,30 @@
FROM ubuntu:22.04
RUN dpkg --add-architecture i386
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive \
apt install -y \
git lzop build-essential gcc bc libncurses5-dev libc6-i386 lib32stdc++6 zlib1g:i386 wget curl \
&& apt autoremove --purge -y \
&& apt clean -y \
&& rm -rf /var/lib/apt/lists/*
RUN adduser --disabled-password --gecos '' docker
RUN mkdir -p /work && chown docker /work
RUN mkdir -p /opt/toolchains
RUN wget -L https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz
RUN wget -L https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
RUN wget -L https://releases.linaro.org/archive/14.04/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz
RUN tar -Jxvf gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/toolchains/
RUN tar -xvf gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz -C /opt/toolchains/
RUN tar -xvf gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz -C /opt/toolchains/
RUN rm -f gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz
WORKDIR /work
USER docker

27
linaro/build_linaro Executable file
View file

@ -0,0 +1,27 @@
#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2023-present Fewtarius
###
### Provision a container containing linaro toolchains
### and use it to build the OGU kernel and u-boot.
###
###
### Export PROJECTS="kernel uboot" or the default will
### only build u-boot.
###
PROJECTS="${PROJECTS:-uboot}"
CONTAINER="linaro:latest"
echo "Provisioning container..."
docker build -t "${CONTAINER}" .
for BUILD in ${PROJECTS}
do
echo "Building ${BUILD}..."
docker run -it --rm --user $(id -u):$(id -g) -v $(pwd):/work -w /work ${CONTAINER} /work/${BUILD}
done

16
linaro/kernel Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export PATH=/opt/toolchains/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/:$PATH
if [ ! -d "linux" ]
then
git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidgoU-4.9.y
fi
cd linux
git pull
make odroidgou_defconfig
make -j$(expr $(expr $(nproc) \* 6) \/ 5)

15
linaro/uboot Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
export ARCH=arm64
export CROSS_COMPILE=aarch64-none-elf-
export PATH=/opt/toolchains/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:/opt/toolchains/gcc-linaro-arm-none-eabi-4.8-2014.04_linux/bin:$PATH
if [ ! -d "u-boot" ]
then
git clone https://github.com/hardkernel/u-boot.git -b odroidgoU-v2015.01
fi
cd u-boot
git pull
make odroidgou_defconfig
make