File: 08devfsd.sh

package info (click to toggle)
module-init-tools 3.4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,208 kB
  • ctags: 900
  • sloc: sh: 7,980; ansic: 5,036; makefile: 204
file content (25 lines) | stat: -rwxr-xr-x 1,145 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /bin/sh

# Old devfsds invoke "modprobe -k -C /etc/modules.conf /dev/<name>".
# We have a horrible workaround.

MODTEST_OVERRIDE1=/lib/modules/$MODTEST_UNAME/modules.dep
MODTEST_OVERRIDE_WITH1=/dev/null
export MODTEST_OVERRIDE1 MODTEST_OVERRIDE_WITH1

MODTEST_OVERRIDE2=/etc/modprobe.conf
MODTEST_OVERRIDE_WITH2=/dev/null
export MODTEST_OVERRIDE2 MODTEST_OVERRIDE_WITH2

MODTEST_OVERRIDE3=/etc/modules.conf
MODTEST_OVERRIDE_WITH3=FILE-WHICH-DOESNT-EXIST
export MODTEST_OVERRIDE3 MODTEST_OVERRIDE_WITH3

# Ignores explicit -C when it's -C modules.conf, and a /dev/*.
[ "`./modprobe -C /etc/modules.conf /dev/foo 2>&1`" = "" ]

# These won't trigger it.
[ "`./modprobe -C /etc/modules.conf2 /dev/foo 2>&1`" = "FATAL: Failed to open config file /etc/modules.conf2: No such file or directory" ]
[ "`./modprobe -C /etc/modules.conf x/dev/foo 2>&1`" = "FATAL: Failed to open config file /etc/modules.conf: No such file or directory" ]
[ "`./modprobe -C /etc/modules.conf /devsomething 2>&1`" = "FATAL: Failed to open config file /etc/modules.conf: No such file or directory" ]
[ "`./modprobe /dev/foo 2>&1`" = "FATAL: Module /dev/foo not found." ]