rmmod_realmagichwl_kernelland.sh

来自「神龙解压卡Linux下的完整开发包,绝对是超值超值超值」· Shell 代码 · 共 80 行

SH
80
字号
#!/bin/sh## Sanity check#if ! grep -q ^realmagichwl_kernelland /proc/modules; then     echo None of realmagichwl_kernelland\*.o modules is loaded.    exit -1fi## Is there an application using the device?#if fuser -s /dev/realmagichwl*; then     echo Cannot proceed: applications have devices open:    fuser -v /dev/realmagichwl*    exit -1fi## Is the fb device loaded, and in use?#if grep -q ^realmagichwl_kernelland_fb /proc/modules; then    UC=`grep ^realmagichwl_kernelland_fb /proc/modules |awk '{print $3}'`    if [ $UC = 0 ]; then 	rmmod realmagichwl_kernelland_fb 	if [ $? != 0 ]; then echo Cannot rmmod realmagichwl_kernelland_fb; exit -1; fi	echo rmmod realmagichwl_kernelland_fb: done.    else	echo Cannot proceed: realmagichwl_kernelland_fb.o use count is $UC.	exit -1    fifi## Is the osdbuf device loaded, and in use?#if grep -q ^realmagichwl_kernelland_osdbuf /proc/modules; then    UC=`grep ^realmagichwl_kernelland_osdbuf /proc/modules |awk '{print $3}'`    if [ $UC != 0 ]; then 	echo I have to switch off some osdbuf:	i=0	while [ $i -lt 32 ]; do if ./osdbuf_fb_control $i -o0 &>/dev/null; then echo switched off osdbuf on board \#$i.; fi; i=$[$i+1]; done    fi    rmmod realmagichwl_kernelland_osdbuf    if [ $? != 0 ]; then echo Cannot rmmod realmagichwl_kernelland_osdbuf; exit -1; fi    echo rmmod realmagichwl_kernelland_osdbuf: done.fi## Is the yuvbuf device loaded, and in use?#if grep -q ^realmagichwl_kernelland_yuvbuf /proc/modules; then    UC=`grep ^realmagichwl_kernelland_yuvbuf /proc/modules |awk '{print $3}'`    if [ $UC != 0 ]; then 	echo I have to switch off some yuvbuf:	i=0	while [ $i -lt 32 ]; do if ./yuvbuf_control $i -y0 &>/dev/null; then echo switched off yuvbuf on board \#$i.; fi; i=$[$i+1]; done    fi    rmmod realmagichwl_kernelland_yuvbuf    if [ $? != 0 ]; then echo Cannot rmmod realmagichwl_kernelland_yuvbuf; exit -1; fi    echo rmmod realmagichwl_kernelland_yuvbuf: done.fi## Is the sound device loaded, and in use?#if grep -q ^realmagichwl_kernelland_snd /proc/modules; then    UC=`grep ^realmagichwl_kernelland_snd /proc/modules |awk '{print $3}'`    if [ $UC != 0 ]; then 	echo "cannot rmmod realmagichwl_kernelland_snd, device is in use."	exit -1;    fi    rmmod realmagichwl_kernelland_snd    if [ $? != 0 ]; then echo Cannot rmmod realmagichwl_kernelland_snd; exit -1; fi    echo rmmod realmagichwl_kernelland_snd: done.fi## Ok, handle the base module now#rmmod realmagichwl_kernellandif [ $? != 0 ]; then echo Cannot rmmod realmagichwl_kernelland; exit -1; fiecho rmmod realmagichwl_kernelland: done.#echo completed.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?