Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
7b593139
提交
7b593139
authored
12月 11, 2010
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skypopen: added a proof of concept standalone OSS audio driver (for Skype-oss clients)
上级
577d7b55
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
0 行增加
和
142 行删除
+0
-142
scull.init
src/mod/endpoints/mod_skypopen/oss/scull.init
+0
-142
没有找到文件。
src/mod/endpoints/mod_skypopen/oss/scull.init
deleted
100644 → 0
浏览文件 @
577d7b55
#!/bin/bash
# Sample init script for the a driver module <rubini@linux.it>
DEVICE
=
"scull"
SECTION
=
"misc"
# The list of filenames and minor numbers: $PREFIX is prefixed to all names
PREFIX
=
"scull"
FILES
=
" 0 0 1 1 2 2 3 3 priv 16
pipe0 32 pipe1 33 pipe2 34 pipe3 35
single 48 uid 64 wuid 80"
INSMOD
=
/sbin/insmod
;
# use /sbin/modprobe if you prefer
function
device_specific_post_load
()
{
true
;
# fill at will
}
function
device_specific_pre_unload
()
{
true
;
# fill at will
}
# Everything below this line should work unchanged for any char device.
# Obviously, however, no options on the command line: either in
# /etc/${DEVICE}.conf or /etc/modules.conf (if modprobe is used)
# Optional configuration file: format is
# owner <ownername>
# group <groupname>
# mode <modename>
# options <insmod options>
CFG
=
/etc/
${
DEVICE
}
.conf
# kernel version, used to look for modules
KERNEL
=
`
uname
-r
`
#FIXME: it looks like there is no misc section. Where should it be?
MODDIR
=
"/lib/modules/
${
KERNEL
}
/kernel/drivers/
${
SECTION
}
"
if
[
!
-d
$MODDIR
]
;
then
MODDIR
=
"/lib/modules/
${
KERNEL
}
/
${
SECTION
}
"
;
fi
# Root or die
if
[
"
$(
id
-u
)
"
!=
"0"
]
then
echo
"You must be root to load or unload kernel modules"
exit
1
fi
# Read configuration file
if
[
-r
$CFG
]
;
then
OWNER
=
`
awk
"
\\
$1
==
\"
owner
\"
{print
\\
$2
}"
$CFG
`
GROUP
=
`
awk
"
\\
$1
==
\"
group
\"
{print
\\
$2
}"
$CFG
`
MODE
=
`
awk
"
\\
$1
==
\"
mode
\"
{print
\\
$2
}"
$CFG
`
# The options string may include extra blanks or only blanks
OPTIONS
=
`
sed
-n
'/^options / s/options //p'
$CFG
`
fi
# Create device files
function
create_files
()
{
cd
/dev
local
devlist
=
""
local
file
while
true
;
do
if
[
$#
-lt
2
]
;
then
break
;
fi
file
=
"
${
DEVICE
}
$1
"
mknod
$file
c
$MAJOR
$2
devlist
=
"
$devlist
$file
"
shift
2
done
if
[
-n
"
$OWNER
"
]
;
then
chown
$OWNER
$devlist
;
fi
if
[
-n
"
$GROUP
"
]
;
then
chgrp
$GROUP
$devlist
;
fi
if
[
-n
"
$MODE
"
]
;
then
chmod
$MODE
$devlist
;
fi
}
# Remove device files
function
remove_files
()
{
cd
/dev
local
devlist
=
""
local
file
while
true
;
do
if
[
$#
-lt
2
]
;
then
break
;
fi
file
=
"
${
DEVICE
}
$1
"
devlist
=
"
$devlist
$file
"
shift
2
done
rm
-f
$devlist
}
# Load and create files
function
load_device
()
{
if
[
-f
$MODDIR
/
$DEVICE
.o
]
;
then
devpath
=
$MODDIR
/
$DEVICE
.o
else if
[
-f
./
$DEVICE
.o
]
;
then
devpath
=
./
$DEVICE
.o
else
devpath
=
$DEVICE
;
# let insmod/modprobe guess
fi
;
fi
if
[
"
$devpath
"
!=
"
$DEVICE
"
]
;
then
echo
-n
" (loading file
$devpath
)"
fi
if
$INSMOD
$devpath
$OPTIONS
;
then
MAJOR
=
`
awk
"
\\
$2
==
\"
$DEVICE
\"
{print
\\
$1
}"
/proc/devices
`
remove_files
$FILES
create_files
$FILES
device_specific_post_load
else
echo
" FAILED!"
fi
}
# Unload and remove files
function
unload_device
()
{
device_specific_pre_unload
/sbin/rmmod
$DEVICE
remove_files
$FILES
}
case
"
$1
"
in
start
)
echo
-n
"Loading
$DEVICE
"
load_device
echo
"."
;;
stop
)
echo
-n
"Unloading
$DEVICE
"
unload_device
echo
"."
;;
force-reload|restart
)
echo
-n
"Reloading
$DEVICE
"
unload_device
load_device
echo
"."
;;
*
)
echo
"Usage:
$0
{start|stop|restart|force-reload}"
exit
1
esac
exit
0
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论