From 0418b7b36f2864897010a1b1c17e7e001f196241 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 19 Apr 2010 14:12:54 +0200
Subject: [PATCH] DSPeasy C6RunApp: (un)loadmodules update

* convert 'insmod foo.ko' to 'modprobe foo'
  This is done to ensure you're using the system provided modules instead of a random version that happens to be in $PWD

* change '/sbin/rmmod' to 'rmmod'
  The loadmodules.sh script already depends on module-init-tools binaries to be present in $PATH, so no need to hardcode it in unloadmodules.sh
---
 C6RunApp/trunk/platforms/DM644x/loadmodules.sh     |    8 ++++----
 C6RunApp/trunk/platforms/DM646x/loadmodules.sh     |    4 ++--
 C6RunApp/trunk/platforms/DM646x/unloadmodules.sh   |    4 ++--
 .../trunk/platforms/OMAP-L137-GIT/loadmodules.sh   |    4 ++--
 .../trunk/platforms/OMAP-L137-GIT/unloadmodules.sh |    4 ++--
 C6RunApp/trunk/platforms/OMAP-L137/loadmodules.sh  |    4 ++--
 .../trunk/platforms/OMAP-L137/unloadmodules.sh     |    4 ++--
 C6RunApp/trunk/platforms/OMAP-L138/loadmodules.sh  |    4 ++--
 .../trunk/platforms/OMAP-L138/unloadmodules.sh     |    4 ++--
 C6RunApp/trunk/platforms/OMAP3530/loadmodules.sh   |    6 +++---
 C6RunApp/trunk/platforms/OMAP3530/unloadmodules.sh |    6 +++---
 .../trunk/platforms/beagleboard/loadmodules.sh     |    6 +++---
 .../trunk/platforms/beagleboard/unloadmodules.sh   |    6 +++---
 C6RunApp/trunk/platforms/hawkboard/loadmodules.sh  |    4 ++--
 .../trunk/platforms/hawkboard/unloadmodules.sh     |    4 ++--
 15 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/C6RunApp/trunk/platforms/DM644x/loadmodules.sh b/C6RunApp/trunk/platforms/DM644x/loadmodules.sh
index 3998060..785bd57 100644
--- a/C6RunApp/trunk/platforms/DM644x/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/DM644x/loadmodules.sh
@@ -32,17 +32,17 @@
 
 # insert cmemk, tell it to occupy physical 120MB-128MB, create 
 # 20 4K buffers, 10 128K buffers  and two 1MB buffers
-insmod cmemk.ko phys_start=0x87800000 phys_end=0x88000000 pools=20x4096,10x131072,2x1048576
+modprobe cmemk phys_start=0x87800000 phys_end=0x88000000 pools=20x4096,10x131072,2x1048576
 
 # insert dsplinkk
-insmod dsplinkk.ko
+modprobe dsplinkk
 rm -f /dev/dsplink
 mknod /dev/dsplink c `awk "/dsplink/ {print \\$1}" /proc/devices` 0
 
 # insert lpm
-insmod lpm_dm6446.ko
+modprobe lpm_dm6446
 rm -f /dev/lpm0
 mknod /dev/lpm0 c `awk "/lpm/ {print \\$1}" /proc/devices` 0
 
 # insert ocvc
-insmod ocvc_dm6446.ko
+modprobe ocvc_dm6446
diff --git a/C6RunApp/trunk/platforms/DM646x/loadmodules.sh b/C6RunApp/trunk/platforms/DM646x/loadmodules.sh
index 86a92f7..45aa60e 100644
--- a/C6RunApp/trunk/platforms/DM646x/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/DM646x/loadmodules.sh
@@ -32,11 +32,11 @@
 
 # insert cmemk, tell it to occupy physical 120MB-128MB, create 
 # 20 4K buffers, 10 128K buffers  and two 1MB buffers
-insmod cmemk.ko phys_start=0x87800000 phys_end=0x88000000 pools=20x4096,10x131072,2x1048576
+modprobe cmemk phys_start=0x87800000 phys_end=0x88000000 pools=20x4096,10x131072,2x1048576
 
 # insert DSP/BIOS Link driver
 #
-insmod dsplinkk.ko
+modprobe dsplinkk
 
 # make /dev/dsplink
 rm -f /dev/dsplink
diff --git a/C6RunApp/trunk/platforms/DM646x/unloadmodules.sh b/C6RunApp/trunk/platforms/DM646x/unloadmodules.sh
index f0b1466..51499e0 100644
--- a/C6RunApp/trunk/platforms/DM646x/unloadmodules.sh
+++ b/C6RunApp/trunk/platforms/DM646x/unloadmodules.sh
@@ -30,6 +30,6 @@
 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-/sbin/rmmod dsplinkk.ko 
+rmmod dsplinkk 
 rm -f /dev/dsplink
-/sbin/rmmod cmemk.ko 
+rmmod cmemk 
diff --git a/C6RunApp/trunk/platforms/OMAP-L137-GIT/loadmodules.sh b/C6RunApp/trunk/platforms/OMAP-L137-GIT/loadmodules.sh
index 31676a0..d5064d2 100644
--- a/C6RunApp/trunk/platforms/OMAP-L137-GIT/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP-L137-GIT/loadmodules.sh
@@ -40,10 +40,10 @@
 # 0xC2C00000    20 MB   DSP
 
 # insert CMEM 20 4K buffers, 10 128K buffers  and two 1MB buffers
-insmod cmemk.ko phys_start=0xC2000000 phys_end=0xC2C00000 pools=20x4096,10x131072,2x1048576
+modprobe cmemk phys_start=0xC2000000 phys_end=0xC2C00000 pools=20x4096,10x131072,2x1048576
 
 # insert DSP/BIOS Link driver
-insmod dsplinkk.ko
+modprobe dsplinkk
 
 # make /dev/dsplink
 rm -f /dev/dsplink
diff --git a/C6RunApp/trunk/platforms/OMAP-L137-GIT/unloadmodules.sh b/C6RunApp/trunk/platforms/OMAP-L137-GIT/unloadmodules.sh
index f0b1466..51499e0 100644
--- a/C6RunApp/trunk/platforms/OMAP-L137-GIT/unloadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP-L137-GIT/unloadmodules.sh
@@ -30,6 +30,6 @@
 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-/sbin/rmmod dsplinkk.ko 
+rmmod dsplinkk 
 rm -f /dev/dsplink
-/sbin/rmmod cmemk.ko 
+rmmod cmemk 
diff --git a/C6RunApp/trunk/platforms/OMAP-L137/loadmodules.sh b/C6RunApp/trunk/platforms/OMAP-L137/loadmodules.sh
index 31676a0..d5064d2 100644
--- a/C6RunApp/trunk/platforms/OMAP-L137/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP-L137/loadmodules.sh
@@ -40,10 +40,10 @@
 # 0xC2C00000    20 MB   DSP
 
 # insert CMEM 20 4K buffers, 10 128K buffers  and two 1MB buffers
-insmod cmemk.ko phys_start=0xC2000000 phys_end=0xC2C00000 pools=20x4096,10x131072,2x1048576
+modprobe cmemk phys_start=0xC2000000 phys_end=0xC2C00000 pools=20x4096,10x131072,2x1048576
 
 # insert DSP/BIOS Link driver
-insmod dsplinkk.ko
+modprobe dsplinkk
 
 # make /dev/dsplink
 rm -f /dev/dsplink
diff --git a/C6RunApp/trunk/platforms/OMAP-L137/unloadmodules.sh b/C6RunApp/trunk/platforms/OMAP-L137/unloadmodules.sh
index f0b1466..51499e0 100644
--- a/C6RunApp/trunk/platforms/OMAP-L137/unloadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP-L137/unloadmodules.sh
@@ -30,6 +30,6 @@
 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-/sbin/rmmod dsplinkk.ko 
+rmmod dsplinkk 
 rm -f /dev/dsplink
-/sbin/rmmod cmemk.ko 
+rmmod cmemk 
diff --git a/C6RunApp/trunk/platforms/OMAP-L138/loadmodules.sh b/C6RunApp/trunk/platforms/OMAP-L138/loadmodules.sh
index 5ea3a69..f089db0 100644
--- a/C6RunApp/trunk/platforms/OMAP-L138/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP-L138/loadmodules.sh
@@ -40,10 +40,10 @@
 # 0xC3000000    16 MB   DSP
 
 # insert CMEM 20 4K buffers, 10 128K buffers  and two 1MB buffers
-insmod cmemk.ko phys_start=0xC2000000 phys_end=0xC3000000 pools=20x4096,10x131072,2x1048576
+modprobe cmemk phys_start=0xC2000000 phys_end=0xC3000000 pools=20x4096,10x131072,2x1048576
 
 # insert DSP/BIOS Link driver
-insmod dsplinkk.ko
+modprobe dsplinkk
 
 # make /dev/dsplink
 rm -f /dev/dsplink
diff --git a/C6RunApp/trunk/platforms/OMAP-L138/unloadmodules.sh b/C6RunApp/trunk/platforms/OMAP-L138/unloadmodules.sh
index f0b1466..51499e0 100644
--- a/C6RunApp/trunk/platforms/OMAP-L138/unloadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP-L138/unloadmodules.sh
@@ -30,6 +30,6 @@
 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-/sbin/rmmod dsplinkk.ko 
+rmmod dsplinkk 
 rm -f /dev/dsplink
-/sbin/rmmod cmemk.ko 
+rmmod cmemk 
diff --git a/C6RunApp/trunk/platforms/OMAP3530/loadmodules.sh b/C6RunApp/trunk/platforms/OMAP3530/loadmodules.sh
index d8aa2dd..2498bdf 100644
--- a/C6RunApp/trunk/platforms/OMAP3530/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP3530/loadmodules.sh
@@ -41,17 +41,17 @@
 
 
 # Allocate 16MB for CMEM
-insmod cmemk.ko phys_start=0x86000000 phys_end=0x87000000 pools=5x1048576,8x131072,256x4096
+modprobe cmemk phys_start=0x86000000 phys_end=0x87000000 pools=5x1048576,8x131072,256x4096
 
 # insert DSP/BIOS Link driver
-insmod dsplinkk.ko
+modprobe dsplinkk
 
 # make /dev/dsplink
 rm -f /dev/dsplink
 mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
 
 # insert LPM driver
-insmod lpm_omap3530.ko
+modprobe lpm_omap3530
 
 # make /dev/lpm0
 rm -f /dev/lpm0
diff --git a/C6RunApp/trunk/platforms/OMAP3530/unloadmodules.sh b/C6RunApp/trunk/platforms/OMAP3530/unloadmodules.sh
index efc9782..4a7427a 100644
--- a/C6RunApp/trunk/platforms/OMAP3530/unloadmodules.sh
+++ b/C6RunApp/trunk/platforms/OMAP3530/unloadmodules.sh
@@ -30,10 +30,10 @@
 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-/sbin/rmmod lpm_omap3530
+rmmod lpm_omap3530
 rm -f /dev/lpm0
 
-/sbin/rmmod dsplinkk
+rmmod dsplinkk
 rm -f /dev/dsplink
 
-/sbin/rmmod cmemk
+rmmod cmemk
diff --git a/C6RunApp/trunk/platforms/beagleboard/loadmodules.sh b/C6RunApp/trunk/platforms/beagleboard/loadmodules.sh
index d66e0e9..ac4f88a 100644
--- a/C6RunApp/trunk/platforms/beagleboard/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/beagleboard/loadmodules.sh
@@ -41,17 +41,17 @@
 
 
 # Allocate 16MB for CMEM
-insmod cmemk.ko phys_start=0x8E000000 phys_end=0x8F000000 pools=5x1048576,8x131072,256x4096
+modprobe cmemk phys_start=0x8E000000 phys_end=0x8F000000 pools=5x1048576,8x131072,256x4096
 
 # insert DSP/BIOS Link driver
-insmod dsplinkk.ko
+modprobe dsplinkk
 
 # make /dev/dsplink
 rm -f /dev/dsplink
 mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
 
 # insert LPM driver
-insmod lpm_omap3530.ko
+modprobe lpm_omap3530
 
 # make /dev/lpm0
 rm -f /dev/lpm0
diff --git a/C6RunApp/trunk/platforms/beagleboard/unloadmodules.sh b/C6RunApp/trunk/platforms/beagleboard/unloadmodules.sh
index efc9782..4a7427a 100644
--- a/C6RunApp/trunk/platforms/beagleboard/unloadmodules.sh
+++ b/C6RunApp/trunk/platforms/beagleboard/unloadmodules.sh
@@ -30,10 +30,10 @@
 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-/sbin/rmmod lpm_omap3530
+rmmod lpm_omap3530
 rm -f /dev/lpm0
 
-/sbin/rmmod dsplinkk
+rmmod dsplinkk
 rm -f /dev/dsplink
 
-/sbin/rmmod cmemk
+rmmod cmemk
diff --git a/C6RunApp/trunk/platforms/hawkboard/loadmodules.sh b/C6RunApp/trunk/platforms/hawkboard/loadmodules.sh
index ac30ee8..7d5b1e5 100644
--- a/C6RunApp/trunk/platforms/hawkboard/loadmodules.sh
+++ b/C6RunApp/trunk/platforms/hawkboard/loadmodules.sh
@@ -40,10 +40,10 @@
 # 0xC7000000    16 MB   DSP
 
 # insert CMEM 20 4K buffers, 10 128K buffers  and two 1MB buffers
-insmod cmemk.ko phys_start=0xC6000000 phys_end=0xC7000000 pools=20x4096,10x131072,2x1048576
+modprobe cmemk phys_start=0xC6000000 phys_end=0xC7000000 pools=20x4096,10x131072,2x1048576
 
 # insert DSP/BIOS Link driver
-insmod dsplinkk.ko
+modprobe dsplinkk
 
 # make /dev/dsplink
 rm -f /dev/dsplink
diff --git a/C6RunApp/trunk/platforms/hawkboard/unloadmodules.sh b/C6RunApp/trunk/platforms/hawkboard/unloadmodules.sh
index f0b1466..51499e0 100644
--- a/C6RunApp/trunk/platforms/hawkboard/unloadmodules.sh
+++ b/C6RunApp/trunk/platforms/hawkboard/unloadmodules.sh
@@ -30,6 +30,6 @@
 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-/sbin/rmmod dsplinkk.ko 
+rmmod dsplinkk 
 rm -f /dev/dsplink
-/sbin/rmmod cmemk.ko 
+rmmod cmemk 
-- 
1.6.6.1

