fix: complete ARM64 RPi build pipeline
Some checks failed
CI / Go Tests (push) Has been cancelled
CI / Build Go Binaries (amd64, linux, linux-amd64) (push) Has been cancelled
CI / Build Go Binaries (arm64, linux, linux-arm64) (push) Has been cancelled
CI / Shellcheck (push) Has been cancelled
Release / Test (push) Has been cancelled
Release / Build Binaries (amd64, linux, linux-amd64) (push) Has been cancelled
Release / Build Binaries (arm64, linux, linux-arm64) (push) Has been cancelled
Release / Build ISO (amd64) (push) Has been cancelled
Release / Create Release (push) Has been cancelled
Some checks failed
CI / Go Tests (push) Has been cancelled
CI / Build Go Binaries (amd64, linux, linux-amd64) (push) Has been cancelled
CI / Build Go Binaries (arm64, linux, linux-arm64) (push) Has been cancelled
CI / Shellcheck (push) Has been cancelled
Release / Test (push) Has been cancelled
Release / Build Binaries (amd64, linux, linux-amd64) (push) Has been cancelled
Release / Build Binaries (arm64, linux, linux-arm64) (push) Has been cancelled
Release / Build ISO (amd64) (push) Has been cancelled
Release / Create Release (push) Has been cancelled
- fetch-components.sh: download ARM64 KubeSolo binary (kubesolo-arm64) - inject-kubesolo.sh: use arch-specific binaries for KubeSolo, cloud-init, and update agent; detect KVER from custom kernel when rootfs has none; cross-arch module resolution via find fallback when modprobe fails - create-rpi-image.sh: kpartx support for Docker container builds - Makefile: rootfs-arm64 depends on build-cross, includes pack-initramfs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -83,9 +83,38 @@ type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="Data"
|
||||
EOF
|
||||
|
||||
# --- Set up loop device ---
|
||||
LOOP=$(losetup --show -fP "$IMG_OUTPUT")
|
||||
LOOP=$(losetup --show -f "$IMG_OUTPUT")
|
||||
echo "==> Loop device: $LOOP"
|
||||
|
||||
# Use kpartx for reliable partition device nodes (works in Docker/containers)
|
||||
USE_KPARTX=false
|
||||
if [ ! -b "${LOOP}p1" ]; then
|
||||
if command -v kpartx >/dev/null 2>&1; then
|
||||
kpartx -a "$LOOP"
|
||||
USE_KPARTX=true
|
||||
sleep 1
|
||||
LOOP_NAME=$(basename "$LOOP")
|
||||
P1="/dev/mapper/${LOOP_NAME}p1"
|
||||
P2="/dev/mapper/${LOOP_NAME}p2"
|
||||
P3="/dev/mapper/${LOOP_NAME}p3"
|
||||
P4="/dev/mapper/${LOOP_NAME}p4"
|
||||
else
|
||||
# Retry with -P flag
|
||||
losetup -d "$LOOP"
|
||||
LOOP=$(losetup --show -fP "$IMG_OUTPUT")
|
||||
sleep 1
|
||||
P1="${LOOP}p1"
|
||||
P2="${LOOP}p2"
|
||||
P3="${LOOP}p3"
|
||||
P4="${LOOP}p4"
|
||||
fi
|
||||
else
|
||||
P1="${LOOP}p1"
|
||||
P2="${LOOP}p2"
|
||||
P3="${LOOP}p3"
|
||||
P4="${LOOP}p4"
|
||||
fi
|
||||
|
||||
MNT_CTL=$(mktemp -d)
|
||||
MNT_BOOTA=$(mktemp -d)
|
||||
MNT_BOOTB=$(mktemp -d)
|
||||
@@ -96,22 +125,25 @@ cleanup() {
|
||||
umount "$MNT_BOOTA" 2>/dev/null || true
|
||||
umount "$MNT_BOOTB" 2>/dev/null || true
|
||||
umount "$MNT_DATA" 2>/dev/null || true
|
||||
if [ "$USE_KPARTX" = true ]; then
|
||||
kpartx -d "$LOOP" 2>/dev/null || true
|
||||
fi
|
||||
losetup -d "$LOOP" 2>/dev/null || true
|
||||
rm -rf "$MNT_CTL" "$MNT_BOOTA" "$MNT_BOOTB" "$MNT_DATA" 2>/dev/null || true
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# --- Format partitions ---
|
||||
mkfs.vfat -F 32 -n KSOLOCTL "${LOOP}p1"
|
||||
mkfs.vfat -F 32 -n KSOLOA "${LOOP}p2"
|
||||
mkfs.vfat -F 32 -n KSOLOB "${LOOP}p3"
|
||||
mkfs.ext4 -q -L KSOLODATA "${LOOP}p4"
|
||||
mkfs.vfat -F 32 -n KSOLOCTL "$P1"
|
||||
mkfs.vfat -F 32 -n KSOLOA "$P2"
|
||||
mkfs.vfat -F 32 -n KSOLOB "$P3"
|
||||
mkfs.ext4 -q -L KSOLODATA "$P4"
|
||||
|
||||
# --- Mount all partitions ---
|
||||
mount "${LOOP}p1" "$MNT_CTL"
|
||||
mount "${LOOP}p2" "$MNT_BOOTA"
|
||||
mount "${LOOP}p3" "$MNT_BOOTB"
|
||||
mount "${LOOP}p4" "$MNT_DATA"
|
||||
mount "$P1" "$MNT_CTL"
|
||||
mount "$P2" "$MNT_BOOTA"
|
||||
mount "$P3" "$MNT_BOOTB"
|
||||
mount "$P4" "$MNT_DATA"
|
||||
|
||||
# --- Boot Control Partition (KSOLOCTL) ---
|
||||
echo " Writing autoboot.txt..."
|
||||
|
||||
Reference in New Issue
Block a user