Skip to content
Snippets Groups Projects
Commit 87d1970f authored by Guido Gunther's avatar Guido Gunther :zzz:
Browse files

Merge branch 'master' into 'master'

Allow jenkins to specify the kernel and u-boot urls

See merge request Librem5/image-builder!114
parents 1f9c2e04 6df5645d
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,8 @@ node {
string(name: 'dist', defaultValue: "buster+ci", description: 'What distribuition 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: 'kernel_url', defaultValue: "", description: 'The URL of the kernel')
string(name: 'uboot_url', defaultValue: "", description: 'The URL for u-boot')
}
if (build_on_x86.contains(params.board)) {
......@@ -43,7 +45,7 @@ node {
}
stage('Publish') {
if( "${params.publish}"=="true" ) {
sh "make DIST='${params.dist}' BOARD='${params.board}' TYPE='${params.build_type}' sha256sums"
sh "make DIST='${params.dist}' BOARD='${params.board}' TYPE='${params.build_type}' KERNEL_URL='${params.kernel_url}' UBOOT_URL='${params.uboot_url}' sha256sums"
sh "bin/publish_ci_files -t image -T ${params.build_type} ${params.board}.img.xz sha256sums"
} else {
echo 'This image will not be published'
......
......@@ -46,8 +46,13 @@ 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_url}"
wget "${JENKINS_AUTH[@]}" -nv --no-glob -Pfiles/ "${kernel_url}"
(cd files/ && unzip -ojq archive.zip)
if [[ "${kernel_url}" =~ https:// ]]; then
wget "${JENKINS_AUTH[@]}" -nv --no-glob -Pfiles/ "${kernel_url}"
(cd files/ && unzip -ojq archive.zip)
else
# shellcheck disable=SC2086
cp ${kernel_url} files/
fi
}
......@@ -57,11 +62,18 @@ fetch_uboot() {
[ -n "${uboot_url}" ] || { echo "uboot_url not set in board config"; exit 1; }
rm -f "${dir}/archive.zip"
echo "Fetching uboot from ${uboot_url}"
wget "${JENKINS_AUTH[@]}" -nv --no-glob -P"${dir}" "${uboot_url}"
(cd "${dir}" && unzip -ojq archive.zip)
if [[ "${kernel_url}" =~ https:// ]]; then
wget "${JENKINS_AUTH[@]}" -nv --no-glob -P"${dir}" "${uboot_url}"
(cd "${dir}" && unzip -ojq archive.zip)
else
mkdir -p "${dir}"
# shellcheck disable=SC2086
cp ${uboot_url} "${dir}/"
fi
}
setup_loop() {
local image="$1"
set -x
......@@ -120,7 +132,7 @@ NULL=
fdt_file=
uboot_type=
# The URL to download the (unpackged) uboot binaries from
uboot_url=
uboot_url=${UBOOT_URL:-}
build_tarball=
want_qcow2=
want_boot_image=
......@@ -128,7 +140,7 @@ apt_sources=
debootstrap_dist=
kernel_deb=
# The URL to download the kernel deb from
kernel_url=
kernel_url=${KERNEL_URL:-}
custom_package_opt=
# Extra board specific packages to install
board_packages=
......@@ -168,7 +180,13 @@ distro="${distro/+ci}"
mainimg="${pureos_board}.img"
# remember command line setting
_kernel_url="${kernel_url}"
_uboot_url="${uboot_url}"
. conf/board
# make sure command line setting takes precedenc over configuration file
[ -z "${_kernel_url}" ] || kernel_url="${_kernel_url}"
[ -z "${_uboot_url}" ] || uboot_url="${_uboot_url}"
. conf/packages
# shellcheck source=conf/dists/buster
. conf/dists/"${distro}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment