WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: modules version magic!  (Read 5503 times)

Offline dicorer

  • Jr. Member
  • **
  • Posts: 61
modules version magic!
« on: April 17, 2015, 02:24:33 PM »
I have that very normal SD card, seems I'm unable to compile its modules (?), so I searched an alternate driver into ubuntu repo.
Which is btw the main purpose of dCore after all, isn't it? :)
And I actually found it.
It's inside that mega-dep linux-image-extra-3.16.0-23-generic, so I extracted only the .ko file I need, and copied it into dCore kernel drivers tree, run depmod -a, then modprobe.
Oops... version magic mismatch... tried modprobe -f, error again, it conflicts with modules.bin whatever, insmod same issue.

Now, I really would like to use my precious SD card with dCore, any hope I can make that happen? ;)

Offline dicorer

  • Jr. Member
  • **
  • Posts: 61
Re: modules version magic!
« Reply #1 on: April 18, 2015, 06:50:40 AM »
Good weekend, I didnt get answers to my questions still, strange because usually you were very quick before.
So today in the early morning before my children wake up, I decided a desperate hack attempt.
With a hex editor, I modified the vermagic string inside the .ko, to match the dCore one.
The hack did the job, modprobe accepted the magic, but it complained about the usual unresolved external functions... smtg about trace and debug, which inevitably told me ubuntu has trace and debug options kernel enabled, dCore not.
As last resort I had a look at the shipped utopic ubuntu kernel.
It is indeed not much bigger, 6MB against the 3MB of dCore.
So taking into account, that here, we are talking about importing huge MB of debs files, not TinyCore extensions,  this 3MB overall is more than acceptable.
I then did the final test: run ubuntu kernel with initrd of dCore.

In my opinion the test was kinda successful, because I did not get kernel panic!  ;D
I guess the dCore init scripts stopped the boot process somewhere before sce load, ending up simply with a root console, functional.

Really, why we can't just switch to standard shipped ubuntu kernel?

Offline Onyarian

  • Sr. Member
  • ****
  • Posts: 337
Re: modules version magic!
« Reply #2 on: April 18, 2015, 08:09:12 AM »
Hi dicorer,

I can't understand your problem. You want to work with a "very normal SD card". Why not?
Why want you to compile its modules?
They work out of the box. I work usually with SD cards and pendrives. My PC have a multiple cards reader and I don't have any problem to put in a SD card, mount it and work.

I am working now with the ub-dCore-trusty, but I am sure that is the same with the utopic version.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: modules version magic!
« Reply #3 on: April 18, 2015, 08:41:32 AM »
dicorer,
As you have seen the standard Debian/Ubuntu kernel will not work with dCore.   And as mentioned, SD cards work out of the box. 


Offline dicorer

  • Jr. Member
  • **
  • Posts: 61
Re: modules version magic!
« Reply #4 on: April 18, 2015, 09:13:18 AM »
rtsx_pci and rtsx_pci_ms are not shipped in dCore utopic, can tell you the exact model if you need ;)
sure, I can always dl that damn tinycore-patched, expand half giga source files, select those 2 pci miserable options in kconfig and recompile the kernel.
But that's only a last resource solution, why should I do it?
If I wanted a pure TinyCore box, I would not spend hours of my free time in digging out debs... I would just use TinyCore repos, always hoping to find there what I need and decent last version...

Instead, I like much more *YOUR* idea - use, re-use, those debian debs!
Yes, they are yes full of garbage, but I showed you that its perfectly possible to clean them out, with a very simple and effective methodology, and build tiny everything you want out of them.

You say "standard Debian/Ubuntu kernel will not work with dCore"... mmmh.
Of course now dCore scripts don't work, because (I guess) they are made to work only with TinyCore special patched kernels.
But what if we modify them to work with ubuntu kernels?
I would bet, if we would refactor only the dCore init scripts, and a bit the sce-*, to work with the default ubuntu kernels, the whole structure you built would work right-away, with debs only.
No needs for "additional" gz/scripts from TinyCore world.

Anyway, could you please elaborate more in details why you think debian kernels would not work with refactored dCore scripts? :)

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: modules version magic!
« Reply #5 on: April 18, 2015, 09:15:21 AM »
It has nothing to do with the dCore scripts, it is the dCore and Core boot method which are essentially the same. 

Offline dicorer

  • Jr. Member
  • **
  • Posts: 61
Re: modules version magic!
« Reply #6 on: April 18, 2015, 09:33:41 AM »
Please, could you be more technically specific?

I can understand you are not interested in that mod.
But actually I am, and I'm going to try refactor your scripts, before I will recompile that damn kernel!  ;D
So I need some details you might know about this special "boot method" you talk about, or whatever issue you know about ubuntu kernels... so that I can plan my project strategy ;)
Thanks

Offline dicorer

  • Jr. Member
  • **
  • Posts: 61
Re: modules version magic!
« Reply #7 on: April 18, 2015, 06:08:14 PM »
Sorry, who said it doesn't work?
I just copied /lib/modules/3.16.0-23-generic/ from lubuntu and pasted as-is into dCore.
Reboot.
Even my SD card is happy now.
The whole init scripts structure is already 100% perfect: dCore-lubuntu is born!  ;D

As I said, I'm going to slightly modify sce-import and sce-load, get rid of sce-update&friends and TinyCore repo, and so on...
Standby... ;)

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: modules version magic!
« Reply #8 on: April 18, 2015, 09:08:31 PM »
Sometimes using a different build of modules with the same kernel version will work, sometimes not.

Kernel and modules are built on standard Core and not dCore, so usually module packages can be shared across Core and all dCore.

Offline dicorer

  • Jr. Member
  • **
  • Posts: 61
Re: modules version magic!
« Reply #9 on: April 19, 2015, 04:05:45 AM »
I must congratulate with whoever made these init scripts.

I'm dealing every day with poor code quality at my job, even very-poor I would say, from programmers who call themselves "senior".
Some people should clean toilets, not write code....
 
But when I see dCore init scripts I'm amazed!
Whoever did that is a genius!  ;D