Commit 343376e0 authored by Angus Ainslie's avatar Angus Ainslie

Merge branch 'drop_builders' into 'master'

Drop builders

See merge request !86
parents e2281900 8aed3faa
Pipeline #4962 passed with stage
in 17 seconds
node {
gitUrl = 'https://source.puri.sm/librem5/image-builder.git'
artifacts = 'files/linux-*.deb,kernel-git*.txt,files/rsi_*.tar'
branch = 'master'
parameters {
string(name: 'board', defaultValue: "imx6", description: 'What board type to build for?')
string(name: 'build_type', defaultValue: "unstable", description: 'What type of build is this?')
string(name: 'publish', defaultValue: "false", description: 'Should the image get published?')
string(name: 'MAKE_OPTS', defaultValue: "", description: 'extra make options')
}
stage('Setup') {
git url: gitUrl, branch: branch
}
stage('Build kernel') {
sh "cd build && MAKE_OPTS=${MAKE_OPTS} ./build_kernel_deb.sh -b ${board}"
}
stage('Publish') {
if( "${params.publish}"=="true" ) {
sh "bin/publish_ci_files -b ${BUILD_NUMBER} -t kernel -T ${build_type} -o files files/*"
} else {
echo "This kernel will not be published"
}
}
stage('Results') {
archive artifacts
}
stage( 'Clean up' ) {
deleteDir() /* clean up our workspace */
}
stage( 'Notify' ) {
mail to: 'librem5-team@lists.puri.sm',
subject: "Build: ${currentBuild.fullDisplayName}",
body: "Build finished ${env.BUILD_URL}"
}
}
node {
gitUrl = 'https://source.puri.sm/librem5/image-builder.git'
artifacts = 'files/uboot-*/*'
branch = 'master'
parameters {
string(name: 'board', defaultValue: "imx6", description: 'What board type to build for?')
string(name: 'build_type', defaultValue: "unstable", description: 'What type of build is this?')
string(name: 'publish', defaultValue: "false", description: 'Should the image get published?')
string(name: 'MAKE_OPTS', defaultValue: "", description: 'extra make options')
}
stage('Setup') {
git url: gitUrl, branch: branch
}
stage('Build u-boot') {
sh "cd build && MAKE_OPTS=${MAKE_OPTS} ./build_uboot.sh -b ${board}"
}
stage('Publish') {
if( "${params.publish}"=="true" ) {
sh "bin/publish_ci_files -b ${BUILD_NUMBER} -t uboot -T ${build_type} -o files files/*"
} else {
echo "This u-boot will not be published"
}
}
stage('Results') {
archive artifacts
}
stage( 'Clean up' ) {
deleteDir() /* clean up our workspace */
}
stage( 'Notify' ) {
mail to: 'librem5-team@lists.puri.sm',
subject: "Build: ${currentBuild.fullDisplayName}",
body: "Build finished ${env.BUILD_URL}"
}
}
#!/bin/bash
#
# Copyright (C) 2017 Purism SPC
#
# SPDX-License-Identifier: GPL-3.0+
#
set -e
set -x
UBOOT_REPO=https://github.com/Freescale/u-boot-fslc.git
CROSS_COMPILER=arm-linux-gnueabihf-
ARCH=arm
UBOOT_BRANCH=2017.11+fslc
COPY_UBOOT=copy_uboot
pureos_board=imx6
make_clean=1
CWD=`pwd`
usage() {
echo "Usage : $1 "
echo " -h Display this help message."
echo " -b [imx6|imx8|ec-som|devkit-recovery|devkit] select the board type."
echo " -c don't make clean."
}
function checkout_uboot()
{
local board=$1
local repo=$2
local branch=$3
if [ ! -e u-boot-${board} ]; then
git clone ${repo} u-boot-${board} -b ${branch}
fi
cd u-boot-${board}
git pull
git checkout ${branch}
}
function build_uboot()
{
local board=$1
local arch=$2
local cc=$3
local config=$4
if [ ${make_clean} -eq 1 ]; then
make distclean
fi
make ARCH=${arch} CROSS_COMPILE=${cc} ${config}
make ARCH=${arch} CROSS_COMPILE=${cc}
}
function build_cortex_m4()
{
local out=$1
if [ ! -e Cortex_M4 ]; then
git clone https://source.puri.sm/Librem5/Cortex_M4.git Cortex_M4
fi
cd Cortex_M4
make
mkdir -p ${out}
cp m4.bin ../
cp m4.bin ${out}/
cd ..
}
function copy_uboot()
{
local board=$1
local out=$2
local uboot_bin=$3
local uboot=u-boot-${board}.imx
mkdir -p ${out}
cp ${uboot_bin} ../${uboot}
cp ${uboot_bin} ${out}/${uboot}
}
function copy_uboot_nitrogen()
{
local board=$1
local out=$2
copy_uboot $1 $2 $3
./copy_upgrade.sh ${out}
}
function combine_uboot_bins()
{
local pureos_board=$1
local CWD=`pwd`
# Additional imx8 build instructions
# https://patchwork.ozlabs.org/patch/864859/
cd ${CWD}
if [ ! -z ${ATF_REPO} ]; then
ATF_DIR=`echo ${ATF_REPO} | awk -F '/' '{ print $NF }'`
if [ ! -e ${ATF_DIR} ]; then
git clone ${ATF_REPO}
fi
cd ${ATF_DIR}
git checkout ${ATF_BRANCH}
set +e
case ${pureos_board} in
ec-som|devkit*)
patch -N -p1 < ${CWD}/files/imx-atf-disable-lpddr4-init.patch
;;
esac
set -e
make PLAT=${ATF_PLAT} CROSS_COMPILE=${CROSS_COMPILER} bl31
fi
cd ${CWD}
if [ ! -z ${DDR_URL} ]; then
DDR_BIN=`echo ${DDR_URL} | awk -F '/' '{ print $NF }'`
if [ ! -e ${DDR_BIN} ]; then
wget ${DDR_URL}
chmod +x ${DDR_BIN}
./${DDR_BIN} --auto-accept
fi
fi
if [ ! -z ${DDR_FILE} ]; then
mkdir -p firmware-${pureos_board}
tar -C firmware-${pureos_board} -xf ${DDR_FILE}
fi
cd ${CWD}
if [ ${MKIMAGE_REPO} != "" ]; then
MKIMAGE_DIR=`echo ${MKIMAGE_REPO} | awk -F '/' '{ print $NF }'`
if [ ! -e ${MKIMAGE_DIR} ]; then
git clone ${MKIMAGE_REPO} -b ${MKIMAGE_BRANCH}
fi
#Copy the following binaries to imx-mkimage/iMX8M folder:
cp imx-atf/build/imx8mq/release/bl31.bin imx-mkimage/iMX8M/
cp u-boot-${pureos_board}/u-boot-nodtb.bin imx-mkimage/iMX8M/
cp u-boot-${pureos_board}/u-boot.bin imx-mkimage/iMX8M/
cp u-boot-${pureos_board}/spl/u-boot-spl.bin imx-mkimage/iMX8M/
cp u-boot-${pureos_board}/arch/arm/dts/${UBOOT_DTB} imx-mkimage/iMX8M/fsl-imx8mq-evk.dtb
#Copy the following firmwares to imx-mkimage/iMX8 folder :
if [ ! -z ${DDR_URL} ]; then
cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin imx-mkimage/iMX8M/
cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin imx-mkimage/iMX8M/
cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin imx-mkimage/iMX8M/
cp firmware-imx-7.2/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin imx-mkimage/iMX8M/
cp firmware-imx-7.2/firmware/hdmi/cadence/signed_hdmi_imx8m.bin imx-mkimage/iMX8M/
else
cp firmware-${pureos_board}/imx-mkimage/iMX8M/*.bin imx-mkimage/iMX8M/
fi
#Before generating the flash.bin, transfer the mkimage generated by U-Boot to iMX8M folder:
cp u-boot-${pureos_board}/tools/mkimage imx-mkimage/iMX8M/
mv imx-mkimage/iMX8M/mkimage imx-mkimage/iMX8M/mkimage_uboot
cd imx-mkimage/
git pull
#make SOC=iMX8M flash_spl_uboot
#Or for using HDMI:
make SOC=iMX8M flash_hdmi_spl_uboot
fi
cd ${CWD}
}
while getopts ":hb:d:c" opt; do
case ${opt} in
b)
pureos_board=$OPTARG
;;
c)
make_clean=0
;;
\?)
echo "Invalid Option: -$OPTARG" 1>&2
usage $0
exit 0
;;
h )
usage $0
exit 0
;;
esac
done
UBOOT_OUTPUT=../../files/uboot-${pureos_board}
case ${pureos_board} in
imx6|nitrogen6qp_max)
HW_DEFCONFIG=nitrogen6qp_max_defconfig
UBOOT_REPO=https://github.com/boundarydevices/u-boot-imx6.git
UBOOT_BRANCH=boundary-v2017.07
ARCH=arm
COPY_UBOOT=copy_uboot_nitrogen
UBOOT_BIN=u-boot.imx
;;
imx8)
ATF_REPO=https://source.codeaurora.org/external/imx/imx-atf
ATF_BRANCH=imx_4.9.51_imx8m_beta
ATF_PLAT=imx8mq
DDR_URL=https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.2.bin
MKIMAGE_REPO=https://source.codeaurora.org/external/imx/imx-mkimage
MKIMAGE_BRANCH=imx_4.9.51_imx8m_beta
UBOOT_REPO=https://source.puri.sm/Librem5/uboot-imx.git
HW_DEFCONFIG=imx8mq_evk_defconfig
CROSS_COMPILER=aarch64-linux-gnu-
UBOOT_BRANCH=pureos-patches
UBOOT_BIN=iMX8M/flash.bin
UBOOT_DTB=fsl-imx8mq-evk.dtb
ARCH=arm
COPY_UBOOT=copy_uboot
;;
ec-som)
ATF_REPO=https://source.codeaurora.org/external/imx/imx-atf
ATF_BRANCH=imx_4.9.51_imx8m_beta
ATF_PLAT=imx8mq
DDR_FILE=files/imx-mkimage-emcraft.tar.gz
MKIMAGE_REPO=https://source.codeaurora.org/external/imx/imx-mkimage
MKIMAGE_BRANCH=imx_4.9.51_imx8m_beta
UBOOT_REPO=https://source.puri.sm/Librem5/uboot-imx.git
HW_DEFCONFIG=imx8m_lpddr4_som_defconfig
CROSS_COMPILER=aarch64-linux-gnu-
UBOOT_BRANCH=pureos-emcraft
UBOOT_BIN=iMX8M/flash.bin
UBOOT_DTB=emcraft-imx8m-som.dtb
ARCH=arm
COPY_UBOOT=copy_uboot
;;
devkit*)
ATF_REPO=https://source.codeaurora.org/external/imx/imx-atf
ATF_BRANCH=imx_4.9.51_imx8m_ga
ATF_PLAT=imx8mq
DDR_FILE=files/imx-mkimage-emcraft.tar.gz
MKIMAGE_REPO=https://source.codeaurora.org/external/imx/imx-mkimage
MKIMAGE_BRANCH=imx_4.9.51_imx8m_ga
UBOOT_REPO=https://source.puri.sm/Librem5/uboot-imx.git
case ${pureos_board} in
devkit)
HW_DEFCONFIG=librem5_devkit_defconfig
;;
devkit-recovery)
HW_DEFCONFIG=librem5_devkit_base_defconfig
;;
esac
CROSS_COMPILER=aarch64-linux-gnu-
UBOOT_BRANCH=devkit-wip
UBOOT_BIN=iMX8M/flash.bin
UBOOT_DTB=librem5-evk.dtb
ARCH=arm
COPY_UBOOT=copy_uboot
;;
*)
echo "unrecognized board type ${pureos_board}"
exit 1
;;
esac
checkout_uboot ${pureos_board} ${UBOOT_REPO} ${UBOOT_BRANCH}
build_uboot ${pureos_board} ${ARCH} ${CROSS_COMPILER} ${HW_DEFCONFIG} ${make_clean}
cd ${CWD}
case ${pureos_board} in
imx8|ec-som|devkit*)
build_cortex_m4 ${UBOOT_OUTPUT}
combine_uboot_bins ${pureos_board}
cd imx-mkimage
;;
*)
cd u-boot-${pureos_board}
;;
esac
${COPY_UBOOT} ${pureos_board} ${UBOOT_OUTPUT} ${UBOOT_BIN}
echo ${UBOOT_REPO} > ${UBOOT_OUTPUT}/u-boot-${pureos_board}-git.txt
git log --format=format:%H -1 >> ${UBOOT_OUTPUT}/u-boot-${pureos_board}-git.txt
cd ${CWD}
To build the kernel on x86 there are some prerequisits, a crosscompiler and build essentials.
sudo apt-get install gcc-arm-linux-gnueabihf build-essential crossbuild-essential-armhf
Checkout the kernel
git clone https://code.puri.sm/Librem5/linux-nitrogen6.git
cp imx6_dot_config linux-nitrogen6/.config
cd linux-nitrogen6
Build it
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- deb-pkg
Copy the generated deb into the folder files/ folder.
Install the same prerequisists as the kernel
Clone the fslc u-bbot repo
git clone https://github.com/Freescale/u-boot-fslc.git
cd u-boot-fslc
git checkout 2017.05+fslc
To configure for the imx6 nitrgoen board
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- nitrogen6q_defconfig
Now build it
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
Copy u-boot to where the customize script looks for it.
cp u-boot.imx ../..
......@@ -70,8 +70,8 @@ case ${pureos_board} in
arch=arm64
kernel_arch=arm64
kernel_version=4.18.11-g73af4578_4.18.11-g73af4578-1
kernel_latest_url='https://arm01.puri.sm/job/Kernel_builds/job/devkit_kernel_build/lastSuccessfulBuild/artifact/*zip*/archive.zip'
uboot_latest_url='https://arm01.puri.sm/job/u-boot_builds/job/devkit_uboot_build/lastSuccessfulBuild/artifact/*zip*/archive.zip'
kernel_latest_url='https://arm01.puri.sm/job/Kernel_builds/job/kernel_devkit_linux-emcraft_imx8-4.18-wip/lastSuccessfulBuild/artifact/*zip*/archive.zip'
uboot_latest_url='https://arm01.puri.sm/job/u-boot_builds/job/uboot_devkit_build/lastSuccessfulBuild/artifact/*zip*/archive.zip'
board_type=unknown
fdt_file=librem5-evk.dtb
qemu=/usr/bin/qemu-aarch64-static
......
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