root/morphix/trunk/scripts-main/miniload

Revision 2, 1.1 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

Line 
1 #!/bin/sh
2 #
3 # Script to dynamically load a minimodule
4 #
5 # Alex de Landgraaf, 2003
6 #
7 # $Id: miniload 410 2004-04-12 00:06:03Z paul_c $
8 #
9
10 if [ -z $1 ];
11 then
12         echo "miniload - a script to dynamically load a minimodule"
13         echo ""
14         echo "It has only one argument: the minimodule to load"
15         echo "Note that this is the filename of the minimodule,"
16         echo "not the name used at build-time"
17         exit
18 fi
19
20 MiniModule="$1"
21
22 if [ ! -e $MiniModule ];
23 then
24         echo "Couldn't find the minimodule $MiniModule"
25         echo "Make sure it exists"
26 fi
27
28 for lkm in 1 2 3 4
29 do
30         if [ -z `lsmod | grep "cloop-mini$lkm"` ]; then
31                 insmod cloop-mini$lkm file=$MiniModule
32                 mount -o ro -t iso9660 /dev/cloop-mini$lkm /mnt/mini/mod$lkm
33
34                 MainTag=$(head -n 1 /morphix/main_module)
35                 MiniTag=$(head -n 1 /mnt/mini/mod$lkm/morphix/main_module)
36                 if [ "$MainTag" != "$MiniTag" ] && [[ $MiniTag != ALL* ]]
37                         then
38                         echo "MiniModule $file doesn't have the same tag as MainModule"
39                         echo "Mini: $MiniTag"
40                         echo "Main: $MainTag"
41                         exit
42                 fi
43
44                 sh /mnt/mini/mod$lkm/morphix/loadmod.sh /mnt/mini/mod$lkm
45                 echo "Minimodule loaded"
46                 break
47         else
48                 continue
49         fi
50 done
Note: See TracBrowser for help on using the browser.