如何在不同架构的 chroot 中进行名称解析?

如何在不同架构的 chroot 中进行名称解析?

amd64运行 Manjaro Linux 的计算机上,我希望能够解析armchroot(即 Arch Linux ARM)内的名称。不幸的是,它不起作用。我怀疑这可能与不同的 glibc 版本有关,但不知道如何解决这个问题。AUR 的预编译包qemu-static-arm和自编译包都存在该问题。qemu-user-static

以下是我为进入访客系统所做的操作以及到目前为止已完成的操作,包括错误消息:

[t440s ~]# ping -c 1 unix.stackexchange.com
PING unix.stackexchange.com (151.101.65.69) 56(84) bytes of data.
64 bytes from 151.101.65.69 (151.101.65.69): icmp_seq=1 ttl=60 time=22.5 ms

--- unix.stackexchange.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.549/22.549/22.549/0.000 ms
[t440s ~]# mount /dev/mmcblk0p1 root/
[t440s ~]# mount --bind /dev/ root/dev/
[t440s ~]# mount --bind /proc/ root/proc/
[t440s ~]# mount --bind /dev/pts/ root/dev/pts/
[t440s ~]# mount --bind /run/ root/run/
[t440s ~]# cp /usr/bin/qemu-arm-static root/usr/bin/
[t440s ~]# chroot root/ qemu-arm-static /bin/bash
[root@t440s /]# cat etc/resolv.conf 
nameserver 141.1.1.1
[root@t440s /]# ping unix.stackexchange.com
/usr/bin/ping: unix.stackexchange.com: Temporary failure in name resolution
[root@t440s /]# ls -ltr /etc/resolv.conf 
lrwxrwxrwx 1 root root 32 Aug  9 03:54 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
[root@t440s /]# ls -ltr /run/systemd/resolve/resolv.conf
-rw-r--r-- 1 root root 21 Jan 17 18:42 /run/systemd/resolve/resolv.conf
[root@t440s /]# rm /etc/resolv.conf 
[root@t440s /]# cp /run/systemd/resolve/resolv.conf /etc/
[root@t440s /]# ping unix.stackexchange.com
/usr/bin/ping: unix.stackexchange.com: Temporary failure in name resolution

如何利用这项技术来实现名称解析呢?

答案1

binfmt-qemu-static也许也可以从 AUR安装?

相关内容