mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-trx.git
synced 2025-10-23 08:22:00 +00:00
contrib/jenkins: remove broken chroot + qemu code
The mirror where it would download images from is not online anymore, and it looks like this whole block has not been executed in years (we always test the arm builds on native arm machines nowadays, and run all builds in docker). Replace the whole block with a simple check that ensures when arm flags are used, that the build is actually running on an arm machine. Change-Id: I2e204e4a0a7dfcf32f011ed6fb403b564f8155a7
This commit is contained in:
@@ -9,60 +9,19 @@
|
|||||||
#
|
#
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
substr() { [ -z "${2##*$1*}" ]; }
|
case "$INSTR" in
|
||||||
|
"--with-neon"*)
|
||||||
#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot
|
case "$(arch)" in
|
||||||
mychroot_nocwd() {
|
arm*)
|
||||||
# LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container
|
;;
|
||||||
# PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH.
|
*)
|
||||||
# PROOT_NO_SECCOMP is required due to proot bug #106
|
set +x
|
||||||
LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@"
|
echo "ERROR: trying to build with INSTR=$INSTR but not running on a 32-bit arm machine! (arch=$(arch))"
|
||||||
}
|
exit 1
|
||||||
|
;;
|
||||||
mychroot() {
|
esac
|
||||||
mychroot_nocwd -w / "$@"
|
;;
|
||||||
}
|
esac
|
||||||
|
|
||||||
if [ -z "${INSIDE_CHROOT}" ]; then
|
|
||||||
|
|
||||||
# Only use ARM chroot if host is not ARM and the target is ARM:
|
|
||||||
if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then
|
|
||||||
|
|
||||||
OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh
|
|
||||||
ROOTFS_PREFIX="${ROOTFS_PREFIX:-$HOME}"
|
|
||||||
ROOTFS="${ROOTFS_PREFIX}/qemu-img"
|
|
||||||
mkdir -p "${ROOTFS_PREFIX}"
|
|
||||||
|
|
||||||
# Prepare chroot:
|
|
||||||
if [ ! -d "$ROOTFS" ]; then
|
|
||||||
mkdir -p "$ROOTFS"
|
|
||||||
if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then
|
|
||||||
fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/
|
|
||||||
# Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it:
|
|
||||||
sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script"
|
|
||||||
mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/
|
|
||||||
else
|
|
||||||
YESTERDAY=$(python -c 'import datetime ; print((datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y%m%d"))')
|
|
||||||
wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/${YESTERDAY}_22:42/rootfs.tar.xz"
|
|
||||||
tar -xf rootfs.tar.xz -C "$ROOTFS/" || true
|
|
||||||
echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf"
|
|
||||||
fi
|
|
||||||
mychroot -b /dev apt-get update
|
|
||||||
mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev git libtalloc-dev libgnutls28-dev stow
|
|
||||||
fi
|
|
||||||
# Run jenkins.sh inside the chroot:
|
|
||||||
INSIDE_CHROOT=1 mychroot_nocwd \
|
|
||||||
-w /osmo-trx \
|
|
||||||
-b "$OSMOTRX_DIR:/osmo-trx" \
|
|
||||||
-b "$(which osmo-clean-workspace.sh):/usr/bin/osmo-clean-workspace.sh" \
|
|
||||||
-b "$(which osmo-build-dep.sh):/usr/bin/osmo-build-dep.sh" \
|
|
||||||
-b "$(which osmo-deps.sh):/usr/bin/osmo-deps.sh" \
|
|
||||||
./contrib/jenkins.sh
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
|
if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
|
||||||
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
|
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
|
||||||
|
Reference in New Issue
Block a user