Chinaunix首页 | 论坛 | 博客
  • 博客访问: 633401
  • 博文数量: 140
  • 博客积分: 2635
  • 博客等级: 少校
  • 技术积分: 1353
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-04 15:46
文章分类
文章存档

2015年(2)

2014年(12)

2013年(10)

2012年(10)

2011年(85)

2010年(21)

分类: LINUX

2011-04-26 09:45:24

Many kernel modules are loaded automatically at boot time, as /sbin/lsmod shows. You can specify other modules to be loaded at boot time by creating a file in the /etc/sysconfig/modules/ directory. You can use any name you like for the file that you create, but you must give it a .modules extension, and you must make it executable by running the following command:
modules]# chmod 755  
No Need to Load Network and SCSI Modules
Networking and SCSI modules do not generally need to be manually loaded as they have their own particular loading mechanisms.
Here is a complete sample script named bluez-uinput.modules that loads the uinput module:
#!/bin/sh if [ ! -c /dev/input/uinput ] ; then exec /sbin/modprobe uinput >/dev/null 2>&1 fi
Example 30.1. /etc/sysconfig/modules/bluez-uinput.modules

The first line of any .modules file should be a shebang line that gives the location of the bash shell interpreter:
#!/bin/sh
Like many configuration files, all .modules files are bash scripts. The if-conditional on line 3 tests to make sure that the /dev/input/uinput files does not exist (the ! symbol negates the condition), and, if that is the case, then executes/sbin/modprobe with the name of the kernel module to load—uinput in this example. The remainder of the line simply redirects any output so that the modprobe command is quiet
阅读(1960) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~