I want to emulate ARM architecture on qemu. I followed instructions in this tutorial. First I compiled linux-5.5.17 kernel. The only difference between me and this tutorial was the CROSS_COMPILE variable. Mine was arm-linux-gnueabi-. Everything went as the same as this tutorial before building the filesystem.
I used buildroot-2020.02.1 to build rootfs. I ran command make qemu_vexpress_defconfig
. Then I executed make menuconfig
to set the root password, choose the ext4 root filesystem and set the compression method to "xz". I compiled this rootfs successfully. And I configure NFS following the tutorial above. But when I ran the command
qemu-system-arm -M vexpress-a15 \
-net tap -net nic -m 512 -kernel /home/myuser/linux-5.5.17/arch/arm/boot/zImage \
-dtb /home/myuser/linux-5.5.17/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dtb \
-append "console=tty1 root=/dev/nfs rw nfsroot=192.168.0.1:/home/myuser/armsystem/outfs ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:qemu:eth0"
Finally I got this result. I don't know whether there are some errors when building rootfs or configuring the network. I searched for some other tutorial to mount NFS rootfs, but it doesn't work for me.I wonder how I can successfully mount a rootfs to emulate ARM architecture on qemu.
Try adding ,vers=3,tcp
to your nfsroot line, like this: nfsroot=192.168.0.1:/home/myuser/armsystem/outfs,vers=3,tcp
.
Also the following step is incorrect in the tutorial: cp -r -d [buildroot]/output/target/* ~/armsystem/outfs
. There's a file THIS_IS_NOT_YOUR_ROOT_FILESYSTEM in the output/target
directory with an explanation why and what is the right thing to do.