Author Topic: How To Autoload Modules?  (Read 1859 times)

the_oak

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
    • http://
How To Autoload Modules?
« on: November 02, 2005, 11:49:01 am »
If I want to get a module to automatically load each time I boot the zaurus, what file do I add "modprobe serial_cs" to?
SL-6000L running Sharp 1.12 rom, (SOLD)
Fujitsu U820 with Windows 7
White Intel MacBook

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
How To Autoload Modules?
« Reply #1 on: November 02, 2005, 12:42:51 pm »
Decide which run-level you want and add a script to /etc/rc?.d/


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

the_oak

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
    • http://
How To Autoload Modules?
« Reply #2 on: November 02, 2005, 03:08:32 pm »
lardman, Thanks!!

I wrote a script (seems wrong to call a two-liner a script) as follows:
Code: [Select]
#!/bin/bash
insmod serial_cs

I saved it at /etc/rc.d/rc5.d naming the file S49serial_cs
I believe the scripts in this directory are only executed if they begin with an "S" and some number. I presume that the number determines the order in which the scripts are executed, so I gave it a number higher than the rest. (After all it has been previously loaded after the zaurus boots completely.) Also don't forget to make the owner and group of the file root and make it executable, with these commands:

chown root /etc/rc.d/rc5.d/S49serial_cs
chgrp root /etc/rc.d/rc5.d/S49serial_cs
chmod 755 /etc/rc.d/rc5.d/S49serial_cs

Or easier yet, use TreeExplorer File>Properties>Security to change all that stuff.
« Last Edit: November 02, 2005, 04:28:02 pm by the_oak »
SL-6000L running Sharp 1.12 rom, (SOLD)
Fujitsu U820 with Windows 7
White Intel MacBook

Hrw

  • Hero Member
  • *****
  • Posts: 1366
    • View Profile
How To Autoload Modules?
« Reply #3 on: November 03, 2005, 04:59:06 am »
Adding module name into /etc/modules should work in any normal Linux distro.
OpenZaurus 3.5.4x Release Manager
OpenEmbedded, Ångström, Poky developer
My website

Misc embedded hardware.

the_oak

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
    • http://
How To Autoload Modules?
« Reply #4 on: November 03, 2005, 08:23:45 am »
Quote
Adding module name into /etc/modules should work in any normal Linux distro.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=102027\"][{POST_SNAPBACK}][/a][/div]

That is what I had been looking for, and would certainly be less convoluted, but the default Sharp rom did not have a /etc/modules directory. I tried creating one, and that did not work. Possibly something that I did wrong? Or maybe some other script has to be edited to point to /etc/modules?

Thanks anyway!
« Last Edit: November 03, 2005, 08:24:40 am by the_oak »
SL-6000L running Sharp 1.12 rom, (SOLD)
Fujitsu U820 with Windows 7
White Intel MacBook