Skip to content

Commit e9f4759

Browse files
committed
add warning for foreign architecture builds
1 parent cde32d3 commit e9f4759

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

build_complete.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,21 @@ if [ "$(check_deps "$needed_deps")" ]; then
6262
if [ -f "/etc/debian_version" ]; then
6363
print_title "attempting to install build deps"
6464
apt-get install wget python3 unzip zip debootstrap cpio binwalk pcregrep cgpt kmod pv lz4 -y
65-
if [ "$arch" != "$host_arch" ]; then
65+
fi
66+
assert_deps "$needed_deps"
67+
fi
68+
69+
#install qemu-user-static on debian if needed
70+
if [ "$arch" != "$host_arch" ]; then
71+
if [ -f "/etc/debian_version" ]; then
72+
if ! dpkg --get-selections | grep -v deinstall | grep "qemu-user-static\|box64\|fex-emu" > /dev/null; then
73+
print_info "automatically installing qemu-user-static because we are building for a different architecture"
6674
apt-get install qemu-user-static binfmt-support -y
6775
fi
76+
else
77+
print_error "Warning: You are building an image for a different CPU architecture. It may fail if you do not have qemu-user-static installed."
78+
sleep 1
6879
fi
69-
assert_deps "$needed_deps"
7080
fi
7181

7282
cleanup_path=""

0 commit comments

Comments
 (0)