file_name.modules
file in the /etc/sysconfig/modules/
directory, where file_name is any descriptive name of your choice. Your file_name.modules
files are treated by the system startup scripts as shell scripts, and as such should begin with an interpreter directive (also called a “bang line”) as their first line:
#!/bin/sh
file_name.modules
file should be executable. You can make it executable by running:
modules]# chmod +x file_name.modules
Example 21.5. /etc/sysconfig/modules/bluez-uinput.modules
bluez-uinput.modules
script loads the uinput
module:
#!/bin/sh if [ ! -c /dev/input/uinput ] ; then exec /sbin/modprobe uinput >/dev/null 2>&1 fi
if
-conditional statement on the third line ensures that the /dev/input/uinput
file does not already exist (the !
symbol negates the condition), and, if that is the case, loads the uinput
module by calling exec /sbin/modprobe uinput
. Note that the uinput
module creates the /dev/input/uinput
file, so testing to see if that file exists serves as verification of whether the uinput
module is loaded into the kernel.
>/dev/null 2>&1
clause at the end of that line redirects any output to /dev/null
so that the modprobe
command remains quiet.