Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: hiro on November 25, 2017, 05:52:14 PM

Title: 8.x compile amd64 modules
Post by: hiro on November 25, 2017, 05:52:14 PM
i wanted to compile my own ath9k (DFS is missing in the provided wireless module), tried my usual procedure, cross-compiling the provided tarball with the provided .config and only slightly adjusting via make menuconfig.

but when i modprobe the new modules i get a kernel NULL pointer dereference.

for older tc versiosn this worked fine...

i used toolchain64.tcz, no idea where i have it from, can't find it in tce any more...
Title: Re: 8.x compile amd64 modules
Post by: Rich on November 25, 2017, 06:22:59 PM
Hi hiro
i used toolchain64.tcz, no idea where i have it from, can't find it in tce any more...

You probably got it from TC4 or TC5.
Title: Re: 8.x compile amd64 modules
Post by: coreplayer2 on November 25, 2017, 07:00:07 PM
For all kernel modules I use

linux-kernel-sources-env.tcz
compiletc.tcz

However, linux-kernel-sources-env.tcz was updated back in mid October and we're still waiting for it to upload to the repo..  Maybe tomorrow?
Title: Re: 8.x compile amd64 modules
Post by: coreplayer2 on November 25, 2017, 07:26:05 PM
I've attached the latest linux-kernel-sources-env scrip with a few busybox fixes in case it helps


Title: Re: 8.x compile amd64 modules
Post by: curaga on November 26, 2017, 03:20:55 AM
toolchain64 was used a few versions ago, but more recent versions had the 64-bit kernel compiled on corepure64. You can check the used gcc version in the first dmesg lines.
Title: Re: 8.x compile amd64 modules
Post by: hiro on November 26, 2017, 03:34:51 AM
should i take from this that compiling with a different gcc version might create modules that are not compatible?
i'm currently not on corepure, so i wonder if it's completely impossible for me to create modules and whether it might be easier to just make the whole kernel myself?

otherwise, might there be another reason that the provided .config or the kernel sources from http://tinycorelinux.net/8.x/x86/release/src/kernel/ are not fitting the running kernel/modules?
Title: Re: 8.x compile amd64 modules
Post by: curaga on November 26, 2017, 09:57:08 AM
Yes, the gcc version must match exactly. You can use qemu to run a corepure64 VM; a couple gigs of disk space and >512mb ram for it should do.

Some options also change the base kernel image when enabled as modules; these will create incompatible modules with the old base kernel. There's no quick way to detect one, but they're rare.

Building the entire kernel is always an option, yeah.
Title: Re: 8.x compile amd64 modules
Post by: hiro on December 08, 2017, 09:06:19 AM
tried the qemu option, but i think virtio_blk is not in base
now going to try and copy the whole kernel instead.
Title: Re: 8.x compile amd64 modules
Post by: curaga on December 08, 2017, 10:10:19 AM
It is, vda disks show up for me. And Qemu's emulated ide drives work too.