From bf27ea1722664c76261b5f3c11f6310fe6c8bef4 Mon Sep 17 00:00:00 2001 From: Gerd Knorr Date: Sun, 22 Feb 2004 01:59:35 +0000 Subject: - import video4linux drivers. --- v4l/scripts/modules.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 v4l/scripts/modules.sh (limited to 'v4l/scripts/modules.sh') diff --git a/v4l/scripts/modules.sh b/v4l/scripts/modules.sh new file mode 100644 index 000000000..8bbc62253 --- /dev/null +++ b/v4l/scripts/modules.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +function xrmmod() { + local module regex + module="$1" + regex=`echo $module | sed -e 's/[-_]/[-_]/g'` + grep -qe "$regex" /proc/modules || return 0 + echo "unload $module" + if test "$UID" = "0"; then + /sbin/rmmod $module + else + sudo /sbin/rmmod $module + fi +} + +function xinsmod() { + local module regex file args + module="$1" + shift + args="$*" + regex=`echo $module | sed -e 's/[-_]/[-_]/g'` + grep -qe "$regex" /proc/modules && return + file="" + test -f "$module.o" && file="$module.o" + test -f "$module.ko" && file="$module.ko" + if test "$file" != ""; then + echo "load $file $args" + if test "$UID" = "0"; then + /sbin/insmod $file $args + else + sudo /sbin/insmod $file $args + fi + else + echo "load $module $args" + if test "$UID" = "0"; then + /sbin/modprobe $module $args + else + sudo /sbin/modprobe $module $args + fi + fi +} + +function v4l2basic() { + for module in i2c-core i2c-algo-bit \ + videodev v4l2-common v4l1-compat \ + video-buf \ + soundcore + do + xinsmod $module + done +} -- cgit v1.2.3