LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to automatically reload a driver or module during boot up (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-automatically-reload-a-driver-or-module-during-boot-up-476440/)

jeb083079 08-22-2006 11:26 PM

How to automatically reload a driver or module during boot up
 
HOW DO I ADD AN INIT SCRIPT TO RUN AUTOMATICALLY DURING BOOT UP


Here is the present modules when I start the computer:

bash-2.05b# lsmod
Module Size Used by Not tainted
soundcore 6532 0 (autoclean)
autofs 13348 0 (autoclean) (unused)
via-rhine 15628 1
mii 2156 0 [via-rhine]
iptable_filter 2412 0 (autoclean) (unused)
ip_tables 14936 1 [iptable_filter]
mousedev 5524 1
keybdev 2976 0 (unused)
hid 22244 0 (unused)
input 5888 0 [mousedev keybdev hid]
usb-uhci 26188 0 (unused)
usbcore 77024 1 [hid usb-uhci]
ext3 70368 2
jbd 52212 2 [ext3]

Then I change to the directory of the init script which I wanted to run automatically during bootup:

bash-2.05b# cd /usr/src/fx3_sdk/
bash-2.05b# ./fx2000.init start
Loading fx2000 (loading file ./fx2000.o)...OK
remove: fx2000_0 fx2000_1 fx2000_2 fx2000_3 fx2000_4 fx2000_5 fx2000_6 fx2000_7 fx2000_8 fx2000_9
major= 254
.

And here is the modules after running the script, notice the fx2000 module:

bash-2.05b# lsmod
Module Size Used by Not tainted
fx2000 4360 0 (unused)
soundcore 6532 0 (autoclean)
autofs 13348 0 (autoclean) (unused)
via-rhine 15628 1
mii 2156 0 [via-rhine]
iptable_filter 2412 0 (autoclean) (unused)
ip_tables 14936 1 [iptable_filter]
mousedev 5524 1
keybdev 2976 0 (unused)
hid 22244 0 (unused)
input 5888 0 [mousedev keybdev hid]
usb-uhci 26188 0 (unused)
usbcore 77024 1 [fx2000 hid usb-uhci]
ext3 70368 2
jbd 52212 2 [ext3]

But when I try to add using chkconfig, this is the error:

bash-2.05b# chkconfig --add fx2000.init
service fx2000.init does not support chkconfig
bash-2.05b#

acid_kewpie 08-23-2006 04:04 AM

chkconfig works by rading metadata tags at the top of the script to provide default start numbers and such. you can add this data in by copying the logic from another file, but you don't really need it. just copy the script to /etc/init.d/ and then create a symlink to it from /etc/rc3.d/ calling it somethign like "S50myscript". the S50 part means it will start the script at position 50, so you may need to tune this to put it into the most suitblae positino relative to the other scripts.


All times are GMT -5. The time now is 07:19 AM.