Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY --chmod=0755 retry /usr/local/bin/retry
COPY --chmod=0755 apt_check /usr/local/bin/apt_check
COPY --chmod=0755 apt_update /usr/local/bin/apt_update
COPY --chmod=0755 apt_install /usr/local/bin/apt_install
RUN apt_update && apt_install -y wget iproute2 && apt_check
RUN apt_update && apt_install -y curl wget iproute2 netcat-openbsd && apt_check

# Checks if the 'crossbuilder' user exists.
RUN if ! id crossbuilder 2>/dev/null;then \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-cross
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY --chmod=0755 retry /usr/local/bin/retry
COPY --chmod=0755 apt_check /usr/local/bin/apt_check
COPY --chmod=0755 apt_update /usr/local/bin/apt_update
COPY --chmod=0755 apt_install /usr/local/bin/apt_install
RUN apt_update && apt_install -y wget iproute2 && apt_check
RUN apt_update && apt_install -y curl wget iproute2 netcat-openbsd && apt_check

RUN groupadd -g $BUILD_GID crossbuilder
RUN useradd -d /home/crossbuilder -m -g $BUILD_GID -u $BUILD_UID -s /bin/bash crossbuilder
Expand Down
51 changes: 37 additions & 14 deletions apt_check
Original file line number Diff line number Diff line change
@@ -1,36 +1,59 @@
#!/bin/bash

set -e

REPO_HOST="aptrepo.effective-range.com"

echo -n "ℹ️ Runner public IP: "
curl -s https://api.ipify.org
echo

echo

echo "ℹ️ Checking DNS resolution for $REPO_HOST..."
DNS_RESULT=$(getent hosts "$REPO_HOST")
echo "$DNS_RESULT"
if [ -z "$DNS_RESULT" ]; then
echo "[ERROR] DNS resolution failed for $REPO_HOST" >&2
echo " DNS resolution failed for $REPO_HOST" >&2
exit 1
else
echo "[INFO] DNS resolution for $REPO_HOST: $DNS_RESULT"
echo " DNS resolution successful for $REPO_HOST"
REPO_IP=$(echo "$DNS_RESULT" | awk '{print $1}')
fi

echo

echo "ℹ️ Checking route to host $REPO_HOST..."
ROUTE_RESULT=$(ip route get "$REPO_IP" 2>&1)
if [ $? -ne 0 ]; then
echo "[ERROR] No route to host $REPO_HOST ($REPO_IP)" >&2
echo "$ROUTE_RESULT"
echo "$ROUTE_RESULT" | head -n 1
echo "❌ No route to host $REPO_HOST ($REPO_IP)" >&2
exit 2
else
echo "[INFO] Route to $REPO_HOST ($REPO_IP):"
echo "$ROUTE_RESULT"
echo "$ROUTE_RESULT" | head -n 1
echo "✅ Found route to host $REPO_HOST ($REPO_IP)"
fi

KEY_URL="http://$REPO_HOST/effectiverange.gpg.key"
echo "[INFO] Checking HTTP connectivity to $KEY_URL..."
if ! wget --spider --timeout=10 --tries=2 "$KEY_URL"; then
echo "[ERROR] Failed to fetch $KEY_URL" >&2
echo

echo "ℹ️ Checking TCP connectivity to $REPO_HOST..."
if ! nc -vz -w 5 "$REPO_IP" 80; then
echo "❌ TCP connectivity to $REPO_HOST ($REPO_IP) on port 80 failed" >&2
exit 3
else
echo "[INFO] Successfully fetched $KEY_URL"
echo "✅ TCP connectivity to $REPO_HOST ($REPO_IP) on port 80 is successful"
fi

echo "[INFO] All connectivity checks passed for $REPO_HOST"
echo

KEY_URL="http://$REPO_HOST/effectiverange.gpg.key"
echo "ℹ️ Checking HTTP connectivity to $KEY_URL..."
if ! wget -nv --spider --timeout=10 --tries=2 "$KEY_URL"; then
echo "❌ Failed to fetch $KEY_URL" >&2
exit 4
else
echo "✅ Successfully fetched $KEY_URL"
fi

echo

echo "✅ All connectivity checks passed for $REPO_HOST"
exit 0
1 change: 1 addition & 0 deletions build_tools/dpkgdeps_src/dpkgdeps/dpkgdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def install_in_buildroot(args, allDeps):


def install_in_hostroot(args, allDeps):
run_in_hostroot_with_lock(build_arch, "apt_check")
install_in_root(build_arch, run_in_hostroot_with_lock, allDeps, side="host")


Expand Down
Loading