image_builder: add qemu-arm-static to image-chroot.sh

This commit is contained in:
Artem Smirnov
2018-09-25 18:31:01 +03:00
parent 3dd5747b3c
commit 8c6af93fd1

View File

@@ -54,6 +54,15 @@ execute() {
mount "${DEV_IMAGE}p2" ${MOUNT_POINT}
mount "${DEV_IMAGE}p1" ${MOUNT_POINT}/boot
REGISTER=':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:'
if [[ $(arch) != 'armv7l' ]]; then
echo_stamp "Enable qemu-arm-static"
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc 2> /dev/null || true
echo ${REGISTER} > /proc/sys/fs/binfmt_misc/register 2> /dev/null || true
cp './qemu-arm-resin' "${MOUNT_POINT}/usr/bin/qemu-arm-static"
else echo_stamp "qemu-arm-static is not need"
fi
echo_stamp "Bind system dirs"
echo_stamp "Mounting /proc in chroot... "