在Linux搭建raspbian

学习arm,需要搭建相关的环境,在
1.安装qemu-system

sudo apt-get install qemu-system

2.下载raspbian镜像

https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-04-10/

3.下载适配的内核

https://raw.githubusercontent.com/dhruvvyas90/qemu-rpi-kernel/master/kernel-qemu-4.4.34-jessie

4.查看镜像大小,并分区挂载

fdisk -l 2017-04-10-raspbian-jessie.img
截屏2022-05-21 下午6.00.37.png

注意到img2的 开始大小为92160,当92160*512=47185920

sudo mkdir /mnt/raspbian
sudo mount -v -o offset=47185920 -t ext4 ~/qemu_vms/2017-04-10-raspbian-jessie.img /mnt/raspbian
sudo nano /mnt/raspbian/etc/ld.so.preload
#注释里面所有的行

5.加载内核和镜像,以及相关设置的命令

qemu-system-arm -kernel ~/qemu_vms/kernel-qemu-4.4.34-jessie -cpu arm1176 -m 256 -M versatilepb -serial stdio -append "root=/dev/sda2 rootfstype=ext4 rw" -hda ~/qemu_vms/2017-04-10-raspbian-jessie.img -redir tcp:5022::22 -no-reboot

(虽然安装好了,但是也太卡了。。。换旧iphone用于arm学习)

你可能感兴趣的:(在Linux搭建raspbian)