I am new to OpenWrt and I have a package building problems.
It is either some weird cross compiling problem or something I do not understand.
I have tried to follow the build instructions as carefully as I can.
I do not know are the package build instructions still valid though ?
I have used feed update, feed install, or even feed install a single kmod package.
But no direct packages are in:
pacakge/ folder
ls
base-files boot devel feeds firmware kernel libs Makefile network system utils
So none of the
make package/example/download and etc. examples work.
OK, in make menuconfig I can select the kmod packages as "M" what I want.
I can build, selecting correct target.
They appear in the bin folder.
I can install those in my router.
The vermagic is the same as in the original:
vermagic: 5.4.87 SMP mod_unload MIPS32_R2 32BIT
But still, every time I use my own built package, without even changing anything from the source I get:
CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 8d95ac10, ra == 8d95ac10
4,343,62191038,-;Oops[#1]:
Used snapshot:
OpenWrt SNAPSHOT, r15498-fa02225ee6
Target is asus ac85p
I have updated all build essentials and everything I can come up to, starting to get out of idea.
Also upgraded my debian from stretch to buster.
I would just want to make a single little change in one kernel object.
I can crosscompile hello world to mips usign SDK:
root@OpenWrt:~# /tmp/helloworld.mips
Hello, world!
And "file" gives same information to an original kernel object:
~/temp/temp$ file lib/modules/5.4.87/rndis_host.ko
lib/modules/5.4.87/rndis_host.ko: ELF 32-bit LSB relocatable, MIPS, MIPS32 rel2 version 1 (SYSV), not stripped
And my re-compiled:
~/temp/temp$ file temp/lib/modules/5.4.87/rndis_host.ko
temp/lib/modules/5.4.87/rndis_host.ko: ELF 32-bit LSB relocatable, MIPS, MIPS32 rel2 version 1 (SYSV), not stripped
Still, my compiled one gives the kernell oops.
1,341,74968683,-;CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 8da5ac10, ra == 8da5ac10
4,342,74989916,-;Oops[#1]:
Obviously, I am doing something wrong, or my build environment is not ok.
It should not be this hard
Well maybe I reply to myself, I have atleast thought I tried to git reset to same head.
openwrt$ git reset --hard fa02225ee6
HEAD is now at fa02225ee6 hostapd: fix key_mgmt typo
But still the control in the kmods are different:
Original:
Depends: kernel (=5.4.87-1-99f4c51d40413e39dd69df99c379e890), .....
My compiled:
Depends: kernel (=5.4.87-1-c3a8eb927802bd4eea3a3bf5d1497130), .....
So, the kernel is not the same after all, perhaps this explains it.
Yes, it seems that even though the git head would be correct the makefile would need to exaclty the same for the kernel to match. I guess the kernel memory map could be totally different.
I can now have also own compiled kernel modules working but it needed to have the kernel, or in my case I flashed the factory image completely to match.
But by default none of the wireless drivers were included so had to compile everything once again...and this is an endless loop
Yeah, the kernel version vermagic hash is not the simple version (like you wrote above), but a hash of all kernel modules compiled and all kernel options available. So, in practice you need the kernel kmods from the same build run as the kernel itself.