sh OSX覆盆子pi仿真通过QEMU。 v2尝试@ https://gist.github.com/JasonGhent/922f38f57c8cb77b10f3

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh OSX覆盆子pi仿真通过QEMU。 v2尝试@ https://gist.github.com/JasonGhent/922f38f57c8cb77b10f3相关的知识,希望对你有一定的参考价值。

# pulled from  http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
# expanded via http://superuser.com/questions/690060/how-to-enable-network-with-a-raspberry-pi-emulated-on-qemu
# tested with  2015-02-16-raspbian-wheezy.zip on OSX Mavericks

# OSX terminal
brew install qemu
# kernel-qemu is a linux kernel compiled with ARM1176 support.
# learn more here: http://xecdesign.com/compiling-a-kernel/
curl -OL http://xecdesign.com/downloads/linux-qemu/kernel-qemu
curl -o raspbian_latest.zip -L http://downloads.raspberrypi.org/raspbian_latest
unzip raspbian_latest.zip
mv 20* raspbian_latest.img

# not easily possible to mount ext4 to make the following change to the image, so we load the filesystem by running the image
qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -hda raspbian_latest.img

# QEMU window (guest) - spawned by previous line
sed -i -e 's/^/#/' /etc/ld.so.preload
# TODO: clean this up with a bash var for path
touch /etc/udev/rules.d/90-qemu.rules
echo 'KERNEL=="sda", SYMLINK+="mmcblk0"' >> /etc/udev/rules.d/90-qemu.rules
echo 'KERNEL=="sda?", SYMLINK+="mmcblk0p%n"' >> /etc/udev/rules.d/90-qemu.rules
echo 'KERNEL=="sda2", SYMLINK+="root"' >> /etc/udev/rules.d/90-qemu.rules
exit

# OSX terminal (host)
#   start the final raspberry pi image and specify a network mapping
#   of local port 5022 to the pi's port 22
qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda raspbian_latest.img -redir tcp:5022::22

# QEMU (guest) - raspberry pi emulation
#   @FIXME
#   for some reason it drops out of the startup procedure
#   and dumps you to the terminal prematurely
exit
#   if this is not first-run, we are done..
#   else we are ushered into raspi-config (first run only)
#   select "Finish" when done configuring

# OSX terminal (host)
ssh -p 5022 pi@localhost

# If we want to create a Heroku-like atmosphere, we can do
# with Dokku
## Still figuring this part out..

以上是关于sh OSX覆盆子pi仿真通过QEMU。 v2尝试@ https://gist.github.com/JasonGhent/922f38f57c8cb77b10f3的主要内容,如果未能解决你的问题,请参考以下文章

sh 覆盆子-PI-2

sh 覆盆子pi

sh 覆盆子pi

sh 覆盆子pi

sh PI覆盆子VPN设置步骤

sh 查看网络上覆盆子Pi的IP地址