首页 > 解决方案 > RaspberryPi 上的 Qemu Debian x86

问题描述

我想在 Raspberry Pi 上创建i386环境。我正在使用 Raspberry Pi ver B,但我想使用哪个版本并不重要。QEMUchroot

到目前为止,我做了:

apt-get install qemu qemu-user qemu-user-static binfmt-support debootstrap binutils

然后我chroot将目录安装到/tmp/mnt并运行:

sudo debootstrap --foreign --arch i386 buster  ./ http://deb.debian.org/debian/

然后我安装:

mount -t sysfs /sys /tmp/mnt/sys/
mount -t proc /proc /tmp/mnt/proc/
mount –bind /dev /tmp/mnt/dev/
mount –bind /dev/pts /tmp/mnt/dev/pts/
mount –bind /dev/shm /tmp/mnt/dev/shm/

现在,当我尝试运行第二阶段时debootstrap

sudo chroot ./ ./debootstrap/debootstrap --second-stage

我收到以下错误消息:

W: Failure trying to run:  /sbin/ldconfig
W: See //debootstrap/debootstrap.log for details

我检查了debootstrap/debootstrap.log

qemu: uncaught target signal 11 (Segmentation fault) - core dumped 
Segmentation fault

事实上,当我尝试时,sudo chroot ./ ./sbin/ldconfig我得到了同样的 Seg 错误。但是当我尝试sudo chroot ./ ./bin/bash它的工作。

我不确定下一步应该是什么。

我想这与我的 qemu 配置或版本有关(我正在使用version 2.8.1(Debian 1:2.8+dfsg-6+deb9u4))。我检查了许多关于类似问题的主题,但找不到可以帮助我找到解决方案的主题。

标签: raspberry-piqemu

解决方案


好吧,我想我明白了。

当我在命令中选择stretchDebian 版本时,它可以工作。debootstrap

sudo debootstrap --foreign --arch i386 stretch  ./ http://deb.debian.org/debian/

现在,当我更多地考虑它时,它是有道理的。我猜想在 chroot 中运行 i386 Debian 并没有提供与主机操作系统的完全分离(我挂载了proc,sys等)。


推荐阅读