dhruvvyas90 / qemu-rpi-kernel

Qemu kernel for emulating Rpi on QEMU
2.06k stars 363 forks source link

Not able to compile kernels #142

Closed tosuns closed 2 years ago

tosuns commented 2 years ago

I'm trying to compile a kernel for qemu which provides features like /dev/loop and iptable which I need. I tried to follow the guide to create a custom kernel but it does not work I always get error message similar to

699: Error: selected processor does not support `cpsid i' in ARM mode
/tmp/ccwRRz8C.s:742: Error: selected processor does not support `cpsid i' in ARM mode

and afterwards to compilation stops with

make[2]: Target '__build' not remade because of errors.
make[1]: *** [scripts/Makefile.build:497: net/sunrpc] Error 2
make[1]: Target '__build' not remade because of errors.
make: *** [Makefile:1822: net] Error 2
make: Target 'bzImage' not remade because of errors.
cp: cannot stat 'arch/arm/boot/zImage': No such file or directory

In installed all mentioned packages.

I couldn't event get it to work with the provided files. I copied the content of the files with kernerl suffix to the respective files config_file, linux-arm.patch and build-kernel-qemu.conf and started build-kernel-qemu with root, but didn't have any luck. At some point I get the selected processor does not support `xxxx' in ARM mode error. As far as I can tell this should work.

What do I miss? What do I have to do to get it to work ? Will commit a kernel version with iptables and /dev/loop support? I know the qemu-buster kernel has /dev/loop support but I also need iptables for my project.

dhruvvyas90 commented 2 years ago

@tosuns : Why not use default kernel and use native emulation instead of compiling your own versatilepb kernel ?

tosuns commented 2 years ago

Sorry, but can you provide me more details ? I never compiled a linux kernel. What do you mean with default kernel and what do you mean "use" native emulation to compile my own versatilepb kernel ? Can you write down the steps ?

dhruvvyas90 commented 2 years ago

This wiki article explains how to do that step by step. https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki/Native-emulation-of-Rpi2-or-3-using-Qemu's-Raspi2-or-Raspi3-machine

You can take RPi default kernel (from .img file or RPi) and use it with Qemu. Hope that helps.

dhruvvyas90 commented 2 years ago

Steps provided to use native emulation instead.