orangepi-xunlong / OrangePi_Build

The official build system for Orange Pi, support A64, RDA, RK3399
GNU General Public License v2.0
356 stars 180 forks source link

compile rootfs error: chroot: failed to run command ‘mount’: Exec format error #84

Closed chadsea closed 4 years ago

chadsea commented 4 years ago

我的编译环境是: ubuntu 18.04 x64 编译rootfs时报错如下: Extracting ... OK chroot: failed to run command ‘mount’: Exec format error chroot: failed to run command ‘mount’: Exec format error chroot: failed to run command ‘/second-phase’: Exec format error 这个错误产生在以下位置: 文件路径:scripts/lib/distributions.sh do_chroot() {

Add qemu emulation.

    cp /usr/bin/qemu-arm-static "$DEST/usr/bin"
    cmd="$@"
    chroot "$DEST" mount -t proc proc /proc || true
    chroot "$DEST" mount -t sysfs sys /sys || true
    chroot "$DEST" $cmd
    chroot "$DEST" umount /sys
    chroot "$DEST" umount /proc

    # Clean up
    rm -f "$DEST/usr/bin/qemu-arm-static"
}

能告诉我怎么解决这个问题吗?是qemu的问题吗

orangepi-xunlong commented 4 years ago

Try reinstall qemu-user-static

sudo apt purge qemu-user-static sudo apt install qemu-user-static

chadsea commented 4 years ago

Thank you very much, it works now