Commit 766f0e0e authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge branch 'drop-boards' into 'master'

Drop support for NXP and Emcraft EVKs and the nitrogen board

See merge request !186
parents 5df6de73 3b37036d
Pipeline #65030 passed with stage
in 9 seconds
......@@ -11,7 +11,7 @@ set -u
usage() {
echo "Usage : $1 "
echo " -h Display this help message."
echo " -b [imx6|imx8|devkit|librem5|qemu-x86_64] select the board type."
echo " -b [devkit|librem5r1|librem5r2|librem5r3|librem5r4|qemu-x86_64] select the board type."
echo " -d <distro> distro to use. [ amber-phone, byzantium ]"
# TODO: add stable and drop ci
echo " -T kernel/uboot build type (legacy/current/next/plain)"
......@@ -29,20 +29,6 @@ build_auth () {
}
fetch_nitrogen_uboot_upgrade() {
local board="$1"
local url="$2"
local out="$3"
dest="${out}/uboot-${board}"
[ ! -d "${dest}" ] || return 0
echo -n "Fetching uboot upgrade..."
wget -q -Ascr -Aupgrade -A"*nitrogen*" -P"${dest}" -nd -l 1 --mirror "${url}/uboot-${board}/"
echo "done."
}
fetch_kernel() {
[ -n "${kernel_url}" ] || { echo "kernel_url not set in board config"; exit 1; }
rm -f files/archive.zip
......@@ -147,7 +133,6 @@ build_type=plain
NULL=
# Device tree file name. Only set this if you're not using
# flash-kernel and want manual uboot script configuration.
fdt_file=
uboot_type=
# The URL to download the (unpackged) uboot binaries from
uboot_url=${UBOOT_URL:-}
......@@ -272,7 +257,6 @@ sudo pureos_board="${pureos_board}" \
http_proxy="${http_apt_proxy:-${http_proxy:-}}" \
https_proxy="${https_apt_proxy:-${https_proxy:-}}" \
qemu="${qemu}" \
fdt_file="${fdt_file}" \
build_tarball="${build_tarball}" \
apt_sources="${escaped_apt_sources}" \
kernel_deb="${kernel_deb}" \
......
......@@ -5,68 +5,6 @@ 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_arch=armhf
board_type=nitrogen6
uboot_type=imx6
fdt_file=imx6qp-nitrogen6_max_purism.dtb
# Prefer a local qemu-arm-static until
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=887892
# if fixed
if [ -f ./bin/qemu-arm-static ]; then
qemu=./bin/qemu-arm-static
else
qemu=/usr/bin/qemu-arm-static
fi
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 512M
--boottype ext2
--bootoffset 1M
--no-kernel
--no-update-initramfs
--arch="${arch}"
--no-extlinux
)
;;
imx8)
arch=arm64
kernel_arch=arm64
board_type=unknown
fdt_file=fsl-imx8mq-evk-m4.dtb
qemu=/usr/bin/qemu-aarch64-static
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 512M
--boottype ext2
--bootoffset 5M
--no-kernel
--no-update-initramfs
--arch="${arch}"
)
;;
ec-som)
arch=arm64
kernel_arch=arm64
board_type=unknown
fdt_file=emcraft-imx8-som.dtb
qemu=/usr/bin/qemu-aarch64-static
kernel_url="${kernel_base}/Emcraft_kernel_build/${archive_path}"
uboot_url="${uboot_base}/ec-som_uboot_CI_build/${archive_path}"
uboot_type=ec-som
vmdebootstrap_opts=(--foreign="${qemu}"
--bootsize 512M
--boottype ext2
--bootoffset 5MiB
--no-kernel
--no-update-initramfs
--arch="${arch}"
)
;;
devkit)
arch=arm64
kernel_arch=arm64
......
......@@ -14,7 +14,6 @@
# Optional
: "${build_tarball:-}"
: "${fdt_file:-}"
: "${kernel_deb:-}"
: "${packages_early:-}"
: "${packages_remove:-}"
......@@ -114,65 +113,10 @@ function cleanup_cryptroot()
function setup_kernel()
{
local link
local fdt_source
fdt_source=""
mkdir -p tmp/
mkdir -p "${basedir}/boot/dtbs"
case "${pureos_board}" in
imx6)
# TODO: use flash-kernel
fdt_source="${basedir}/usr/lib/linux-image-*/${fdt_file}"
link=$(basename "${basedir}"/boot/vmlinuz-*)
rm -f "${basedir}/boot/zImage"
ln -s "${link}" "${basedir}/boot/zImage"
cp data/update-zImage-link "${basedir}/etc/kernel/postinst.d/"
cp "${basedir}/boot/zImage" "tmp/"
;;
ec-som|imx8)
fdt_source="${basedir}/usr/lib/linux-image-*/freescale/${fdt_file}"
cp "${basedir}/boot/${link}" "${basedir}/boot/Image.gz"
gunzip "${basedir}/boot/Image.gz"
;;
*)
if [ -n "${kernel_deb}" ]; then
# Reconfigure kernel package to trigger kernel hooks
chroot "${basedir}" dpkg-reconfigure "$(basename "${kernel_deb%%_*}")"
fi
;;
esac
[ -z "${fdt_source}" ] || cp "${fdt_source}" "${basedir}/boot/dtbs/"
}
function setup_uboot()
{
[ -n "${fdt_file}" ] || return
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${uboot_type}.txt.in" > "${basedir}/boot/boot_emmc.txt"
sed -e "s/##RFSPART##/0/" -i "${basedir}/boot/boot_emmc.txt"
mkimage -A arm -T script -O linux -d "${basedir}/boot/boot_emmc.txt" "${basedir}/boot/boot_emmc.scr"
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${uboot_type}.txt.in" > "${basedir}/boot/boot_sd.txt"
sed -e "s/##RFSPART##/1/" -i "${basedir}/boot/boot_sd.txt"
mkimage -A arm -T script -O linux -d "${basedir}/boot/boot_sd.txt" "${basedir}/boot/boot_sd.scr"
# TODO: Use flash-kernel for these boards too
case "${pureos_board}" in
imx6)
ln -fs boot_sd.scr "${basedir}/boot/6x_bootscript"
;;
imx8|em-som)
ln -fs boot_sd.scr "${basedir}/boot/boot.scr"
;;
*)
echo "setup_uboot: Unhandled board type ${pureos_board} for"
exit 1
;;
esac
[ ! -d "files/uboot-${uboot_type}" ] || cp -a "files/uboot-${uboot_type}/"* "${basedir}/boot/"
if [ -n "${kernel_deb}" ]; then
# Reconfigure kernel package to trigger kernel hooks
chroot "${basedir}" dpkg-reconfigure "$(basename "${kernel_deb%%_*}")"
fi
}
......@@ -424,15 +368,6 @@ if [ -n "${use_luks}" ]; then
fi
setup_kernel
case "${pureos_board}" in
# Non flash-kernel boards
imx6|imx8|ec-som)
setup_uboot
;;
?)
echo "No u-boot needed for ${pureos_board}"
;;
esac
[ -z "${use_luks}" ] || cleanup_cryptroot
......
Supports Markdown
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