질문이 있습니다 chroot
. amd64 호스트가 있고 qemu를 사용하여 작업하고 싶습니다 aarch64
. 다음 스크립트를 사용해 보았습니다.
#!/bin/bash
echo ">>>"
echo ">>> Configuring ARMv7-A environment"
echo ">>>"
echo $PWD
echo ':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/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
echo ">>> mounting filesystems"
mount -t proc proc $PWD/proc || echo "FAILED /proc"
mount -t sysfs sysfs $PWD/sys || echo "FAILED /sys"
mount --bind /dev $PWD/dev || echo "FAILED /dev"
mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime shm $PWD/dev/shm || echo "FAILED /dev/shm"
cat /proc/sys/fs/binfmt_misc/status
cat /proc/sys/fs/binfmt_misc/arm
cp /etc/resolv.conf $PWD/etc/resolv.conf || echo "FAILED resolv.conf"
echo ">>> entering ARMv7-A environment at $PWD"
chroot $PWD bin/bash
echo "<<<"
echo "<<< Back to native environment!"
echo "<<<"
umount $PWD/dev/shm
umount $PWD/dev
umount $PWD/sys
umount $PWD/proc
echo -1 > /proc/sys/fs/binfmt_misc/arm
그러나 실행할 때 예외가 발생합니다.
>>> entering ARMv7-A environment at /var/chroot/armv7a
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
../enterarmv7a.sh: line 18: 23146 Segmentation fault (core dumped) chroot $PWD bin/bash
뭐가 될수 있었는지? Ubuntu 20.04를 사용하고 있으며 qemu
다음을 사용하여 설치했습니다.apt