WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Where to build/install ADC module  (Read 28396 times)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #90 on: March 13, 2021, 04:20:35 PM »
Hi MTCAT
... However, for the extension that's being loaded, either the 486 or 686 package, as specified in onboot.lst, where are the files associated with that package being placed ?
Extensions are compressed read-only file systems (squashfs). They get mounted under  /tmp/tcloop  but the extension
itself lives in the  tce  directory of your disk drive. Once installed, you can look in  /tmp/tcloop/24dsi-2.6.33.3-tinycore-686
and you will find it contains  usr/local/lib/lib24dsi_api.so  which is linked into the main file system as  /usr/local/lib/lib24dsi_api.so.
Note the leading slash in that second path. If you execute this:
Code: [Select]
ls -l /usr/local/lib/lib24dsi_api.soit's going to indicate that it is a link that points back to  /tmp/tcloop/24dsi-2.6.33.3-tinycore-686/usr/local/lib/lib24dsi_api.so.
The rest of the files in the extension get linked into their respective locations in the main file system.

Quote
... Just wondering, to automatically load the 24dsi driver, I'm thinking I could add the following to bootlocal.sh ?

For the 686 driver (for the DX3),

sudo /home/tc/24dsi.linux.4.11.91.32.0/24dsi/driver/start ...
That's just the startup script for loading the driver and creating device nodes in  /dev.
You still need to place the driver in the correct location and run  depmod  to update the driver database for the OS.
You still need to place the library in the correct location and run  ldconfig  to update the library cache for the OS.
You still need to place the utility programs where the OS can find them so you don't have to keep typing a path.
With the extension you create the correct locations for the various libs, drivers, programs, etc.
tce-load handles running  depmod  and  ldconfig.
If you are booting, it runs them after it's loaded everything in  onboot.lst to save time.

The alternative is copying the files to  /us/local/bin, /usr/local/lib/, etc.  and running  depmod  and  ldconfig  yourself.
/usr/  is located in RAM. As a result, those files will occupy their size in RAM. As an extension, they only get linked in
and occupy around 30 to 60 bytes of RAM.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #91 on: March 13, 2021, 07:43:40 PM »
Hi Rich,

Thanks for the explanation of how the extensions get loaded, having tce-load take care of all the "nitty-gritty" sounds great.

So, in terms of the path to the startup script, to be put in bootlocal.sh (I think ?), sounds like it would be

sudo usr/local/bin/start24dsi

Would that be right ?

Thanks,

David

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #92 on: March 13, 2021, 07:52:53 PM »
Hi MTCAT
Close. It should be:
Code: [Select]
/usr/local/bin/start24dsiThe  sudo  doesn't hurt anything, but it's not required because  bootlocal.sh  runs as root.
The leading slash is required because that tells the OS to start searching from the  root  of the directory structure.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #93 on: March 13, 2021, 08:52:32 PM »
Hi Rich,

Awesome, thanks a lot, I'll try that out soon, I'm still writing up a journal of all the things you walked me through, it's turning into quite the handbook, will be an excellent reference for me though.

I want to try out the 486 driver on the DX too, will be interesting to see if that works or not !

Will let you know how that goes, possibly tomorrow or Monday for sure !

Thanks,

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #94 on: March 14, 2021, 03:40:57 PM »
Hi Rich,

I added the line below to my bootlocal.sh but unfortunately it didn't seem to do anything useful.

/usr/local/bin/start24dsi

I looked in dmesg for any hints and didn't see anything in there related to the new line in bootlocal.sh, but, when I type out the command myself, I get the following output;

Driver loading: 24dsi........
---->ERROR<----: module file does not exist: /usr/local/bin/24dsi.ko

I'm not sure why,

1) There's no evidence of the command in bootlocal.sh even being attempted.
2) I don't know why I didn't put the 24dsi.ko in /usr/local/bin as well ? When we made the package, we put 24dsi.ko in /home/tc/package/usr/local/lib/modules/2.6.33.3-tinycore/kernel/drivers/24dsi.

Should I leave (2) "as-is" and just add 24dsi.ko to /usr/local/bin as well ?

Thanks,

David

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #95 on: March 14, 2021, 05:21:47 PM »
Hi MTCAT
I'll take a look at the  start  script later tonight. No,  24dsi.ko  does not belong in  /usr/local/bin.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #96 on: March 14, 2021, 08:13:52 PM »
Hi MTCAT
Open your  start24dsi  script. Replace the  insmod  command with  modprobe.  Repack your extension and copy it
to your  tce/optional  directory. Reboot and see if it works now.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #97 on: March 14, 2021, 10:06:54 PM »
Hi Rich,

Unfortunately that didn't help, even after replacing "insmod" with "modprobe" in start24dsi, I still don't see a "24dsi" when typing "lsmod" after booting up, and there's no evidence of the driver even trying to be loaded in dmesg either.

Shouldn't we see the same error that I get below, when I try to do it manually, in dmesg as well ?

Driver loading: 24dsi........
---->ERROR<----: module file does not exist: /usr/local/bin/24dsi.ko

Thanks,

David

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #98 on: March 14, 2021, 10:21:47 PM »
Hi MTCAT
... Shouldn't we see the same error that I get below, when I try to do it manually, in dmesg as well ?

Driver loading: 24dsi........
---->ERROR<----: module file does not exist: /usr/local/bin/24dsi.ko
No. The reason you got that error is because  insmod  requires you to provide a full path and complete file name.
Because  depmod  gets run when when the extensions is loaded,  modprobe  knows where to find the driver. It's also
smart enough to accept  modprobe 24dsi.ko  or even just  modprobe 24dsi.

What happens if you run:
Code: [Select]
sudo start24dsi
And what does this return:
Code: [Select]
which start24dsi

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #99 on: March 15, 2021, 08:31:29 PM »
Hi Rich,

Oh, okay, thanks for the explanation re: "insmod".

When I typed,

sudo start24dsi

I still got the same error message,

Driver loading: 24dsi........
---->ERROR<----: module file does not exist: /usr/local/bin/24dsi.ko

When I typed,

which start24dsi

I was returned the following path,

/usr/local/bin/start24dsi

Thanks,

David

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #100 on: March 15, 2021, 08:35:06 PM »
Hi MTCAT
If you run this:
Code: [Select]
grep insmod /usr/local/bin/start24dsiDoes the result include  insmod ?

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #101 on: March 15, 2021, 09:59:45 PM »
Hi Rich,

Yes it does, I get,

insmod ${module_file}

Sigh, in my thrashing away last night I forgot I commented out the modprobe statement (after it didn't work either) and then changed it back to insmod in start24dsi, I then "re-squashed" the package, and put it back in place in /mnt/sdb1/tce/optional, to return to "defaults" so to speak, sorry about that....

Should I change it back to modprobe, "re-squash" the package, put it back in place, re-boot and re-try your "sudo start24dsi" and "which start24dsi", and the "grep insmod /usr/local/bin/start24dsi" commands ?

Sorry for the mixup.

David

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #102 on: March 15, 2021, 10:05:50 PM »
Hi MTCAT
... Should I change it back to modprobe, "re-squash" the package, put it back in place, re-boot and re-try your "sudo start24dsi" ...
Yes.

modprobe  is the correct command:
Code: [Select]
modprobe ${module_file}

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Where to build/install ADC module
« Reply #103 on: March 15, 2021, 10:35:11 PM »
Hi Rich,

I uncommented the modprobe ${module_file} line, and commented the insmod ${module_file} line, in package/usr/local/bin/start24dsi and then rebuilt the package, copied into place and re-booted.

For both "sudo start24dsi" and "which start24dsi" I get the same result as previous.

For the "grep insmod /usr/local/bin/start24dsi" I now get

#insmod ${module_file}

So, insmod has been commented out.

For the "grep modprobe /usr/local/bin/start24dsi" I get

modprobe ${module_file}

Am I correct in guessing that you're thinking that this is some kind of path issue ?, but that modprobe should run okay even without the path ?

Not sure if this helps or not, but I can run ./start in /home/tc/24dsi.linux.4.11.92.32.0/24dsi/driver and that works (with insmod), I've never tried that script in that location with modprobe though.
 
Thanks,

David

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11641
Re: Where to build/install ADC module
« Reply #104 on: March 15, 2021, 10:40:14 PM »
Hi MTCAT
... Not sure if this helps or not, but I can run ./start in /home/tc/24dsi.linux.4.11.92.32.0/24dsi/driver and that works (with insmod), I've never tried that script in that location with modprobe though.
No no no.

Run:
Code: [Select]
sudo depmodthen try:
Code: [Select]
sudo start24dsi