Commit 58bf4bdd authored by Angus Ainslie (Purism)'s avatar Angus Ainslie (Purism)
Browse files

Drop dependancy on storage



storage.puri.sm is no longer used so get all kernels and u-boot from
jenkins.
Signed-off-by: default avatarAngus Ainslie (Purism) <angus@akkea.ca>
parent 718b52e6
......@@ -14,7 +14,7 @@ usage() {
echo " -b [imx6|imx8|devkit|qemu-x86_64] select the board type."
echo " -d <distro> distro to use. [ green, purple, buster, green+ci, buster+ci, purple+ci ]"
# TODO: add stable and drop ci
echo " -T kernel/uboot build type (unstable/ci/latest)"
echo " -T kernel/uboot build type (legacy/current/next)"
echo " -B build rootfs tarball as well"
}
......@@ -33,22 +33,22 @@ fetch_nitrogen_uboot_upgrade() {
}
fetch_latest_kernel() {
[ -n "${kernel_latest_url}" ] || { echo "kernel_latest_url not set in board config"; exit 1; }
fetch_kernel() {
[ -n "${kernel_url}" ] || { echo "kernel_url not set in board config"; exit 1; }
rm -f files/archive.zip
echo "Fetching kernel from ${kernel_latest_url}"
wget -nv --no-glob -Pfiles/ "${kernel_latest_url}"
echo "Fetching kernel from ${kernel_url}"
wget -nv --no-glob -Pfiles/ "${kernel_url}"
(cd files/ && unzip -ojq archive.zip)
}
fetch_latest_uboot() {
fetch_uboot() {
local dir="files/uboot-${1}"
[ -n "${uboot_latest_url}" ] || { echo "uboot_latest_url not set in board config"; exit 1; }
[ -n "${uboot_url}" ] || { echo "uboot_url not set in board config"; exit 1; }
rm -f "${dir}/archive.zip"
echo "Fetching uboot from ${uboot_latest_url}"
wget -nv --no-glob -P"${dir}" "${uboot_latest_url}"
echo "Fetching uboot from ${uboot_url}"
wget -nv --no-glob -P"${dir}" "${uboot_url}"
(cd "${dir}" && unzip -ojq archive.zip)
}
......@@ -104,7 +104,7 @@ cwd=$(pwd)
distro=${DIST:-buster+ci}
mirror=${MIRROR:-"http://deb.debian.org/debian"}
pureos_board=imx6
build_type=latest
build_type=current
NULL=
uboot_bin=
uboot_type=
......@@ -166,33 +166,19 @@ rm -f "./tmp/${pureos_board}-report.log"
# Create meta.yml here so it belongs to the user running image-builder
echo > "${meta_yml}"
if [ "${build_type}" == "latest" ]; then
fetch_latest_kernel
fetch_latest_uboot "${uboot_type}"
kernel_deb=
for deb in files/linux-image-*-*_arm64.deb; do
! [[ "${deb}" =~ dbg ]] || continue
if [ -n "${kernel_deb}" ]; then
echo "Found more than one possible kernel deb in files/"
exit 1
fi
kernel_deb="$deb"
done
[ -n "${kernel_deb}" ] || { echo "No kernel found."; exit 1; }
custom_package_opt=(--custom-package "${kernel_deb}")
else
kernel_url=https://storage.puri.sm/librem5/binaries/${build_type}/latest/files/
if [ -n "${kernel_deb}" ]; then
if [ ! -f "files/${kernel_deb}" ]; then
wget -Pfiles/ "${kernel_url}/${kernel_deb}"
fi
custom_package_opt=(--custom-package "files/${kernel_deb}")
fi
if [ -n "${uboot_bin}" ] && [ ! -f "files/uboot-${uboot_type}/${uboot_bin}" ]; then
wget -Pfiles/uboot-${uboot_type} "${kernel_url}/uboot-${uboot_type}/${uboot_bin}"
fi
[ "${board_type}" != "nitrogen6" ] || fetch_nitrogen_uboot_upgrade "${pureos_board}" "${kernel_url}" files/
if [ -n "${kernel_url}" ]; then
fetch_kernel
fetch_uboot "${uboot_type}"
for deb in files/linux-image-*-*_arm64.deb; do
! [[ "${deb}" =~ dbg ]] || continue
if [ -n "${kernel_deb}" ]; then
echo "Found more than one possible kernel deb in files/"
exit 1
fi
kernel_deb="$deb"
done
[ -n "${kernel_deb}" ] || { echo "No kernel found."; exit 1; }
custom_package_opt=(--custom-package "${kernel_deb}")
fi
echo "Using kernel ${kernel_deb}"
......
# board specific variables
kernel_base="https://arm01.puri.sm/job/Kernel_builds/job"
uboot_base="https://arm01.puri.sm/job/u-boot_builds/job"
archive_path="lastSuccessfulBuild/artifact/*zip*/archive.zip"
case ${pureos_board} in
imx6)
arch=armhf
kernel_version=4.15.0-g837bff1_4.15.0-g837bff1-1
kernel_arch=armhf
board_type=nitrogen6
uboot_type=imx6
......@@ -16,7 +19,8 @@ case ${pureos_board} in
else
qemu=/usr/bin/qemu-arm-static
fi
kernel_deb=linux-image-${kernel_version}_${kernel_arch}.deb
kernel_url="${kernel_base}/iMX6_CI_kernel_build/${archive_path}"
uboot_url="${uboot_base}/imx6_uboot_CI_build/${archive_path}"
vmdebootstrap_opts=(--foreign=${qemu}
--bootsize 200M
--boottype ext2
......@@ -30,14 +34,13 @@ case ${pureos_board} in
imx8)
arch=arm64
kernel_arch=arm64
kernel_version=4.9.51-07589-gdfe3af50fa88_4.9.51-07589-gdfe3af50fa88-1
board_type=unknown
fdt_file=fsl-imx8mq-evk-m4.dtb
qemu=/usr/bin/qemu-aarch64-static
kernel_deb=linux-image-${kernel_version}_${kernel_arch}.deb
uboot_bin=u-boot-imx8.imx
uboot_type=imx8
kernel_url="${kernel_base}/imx8_kernel_build/${archive_path}"
uboot_url="${uboot_base}/imx8_uboot_CI_build/${archive_path}"
vmdebootstrap_opts=(--foreign="${qemu}"
--bootsize 200M
--boottype ext2
......@@ -50,11 +53,11 @@ case ${pureos_board} in
ec-som)
arch=arm64
kernel_arch=arm64
kernel_version=4.18.0-g231e3e21_4.18.0-g231e3e21-1
board_type=unknown
fdt_file=emcraft-imx8-som.dtb
qemu=/usr/bin/qemu-aarch64-static
kernel_deb=linux-image-${kernel_version}_${kernel_arch}.deb
kernel_url="${kernel_base}/Emcraft_kernel_build/${archive_path}"
uboot_url="${uboot_base}/ec-som_uboot_CI_build/${archive_path}"
uboot_bin=u-boot-ec-som.imx
uboot_type=ec-som
vmdebootstrap_opts=(--foreign="${qemu}"
......@@ -69,13 +72,27 @@ case ${pureos_board} in
devkit)
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/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'
case "${build_type}" in
legacy)
kernel_url="${kernel_base}/kernel_devkit_linux-emcraft_imx8-4.18-wip/${archive_path}"
uboot_url="${uboot_base}/uboot_418-devkit_build/${archive_path}"
;;
next)
kernel_url="${kernel_base}/kernel_devkit_linux-next_imx8-linux-next-devkit/${archive_path}"
uboot_url="${uboot_base}/uboot_devkit_build/${archive_path}"
;;
current)
kernel_url="${kernel_base}/kernel_devkit_linux-next_imx8-5.2-devkit/${archive_path}"
uboot_url="${uboot_base}/uboot_devkit_build/${archive_path}"
;;
*)
echo "unknown kernel type for devkit build ${build_type}"
exit 1
;;
esac
board_type=unknown
fdt_file=librem5-evk.dtb
fdt_file=imx8mq-librem5-devkit.dtb
qemu=/usr/bin/qemu-aarch64-static
kernel_deb=linux-image-${kernel_version}_${kernel_arch}.deb
uboot_bin=u-boot-devkit.imx
uboot_type=devkit
fk_machine="Purism Librem 5 devkit"
......
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