]> git.ozlabs.org Git - ppp.git/commitdiff
mods for broken sunos vdcmd stuff
authorPaul Mackerras <paulus@samba.org>
Thu, 27 Nov 1997 06:07:01 +0000 (06:07 +0000)
committerPaul Mackerras <paulus@samba.org>
Thu, 27 Nov 1997 06:07:01 +0000 (06:07 +0000)
sunos4/ppp.INSTALL
sunos4/ppp_vdcmd.c

index 631370b1efca982adde386f73e07b1b8a85f3333..0018bf8d0f2810713c073e2037ff1a3e358e6dc3 100755 (executable)
@@ -64,7 +64,7 @@ case "$0" in
        echo "Usage: $0 module-id module-type b-major c-major"
        exit 1
     fi
-    if [ "$2" -ne "12345607" ]; then
+    if [ "$2" -ne "12345607" -a "$2" -ne "12345600" ]; then
        echo "$0: $2: bad module type"
        exit 1
     fi
@@ -84,7 +84,7 @@ case "$0" in
        id=`modstat | grep -w $mod | awk '{print $1}'`
        if [ x$id = x ]; then
            echo "$mod is not loaded."
-           stat = 1
+           stat=1
        else
            modunload -id $id
        fi
index 1e3853a564d6b8c9b35752e8b8d1d86470b9b238..68095c92ec7cf9de6a4a8729954dc9ee58c6cb95 100644 (file)
@@ -28,6 +28,7 @@ ppp_vdcmd(fun, vdp, vdi, vds)
     addr_t vdi;
     struct vdstat *vds;
 {
+    static int majnum = -1;
     int n, maj;
 
     switch (fun) {
@@ -46,6 +47,7 @@ ppp_vdcmd(fun, vdp, vdi, vds)
        cdevsw[maj] = ppp_cdevsw;
        vd.Drv_cdevsw = &ppp_cdevsw;
        vdp->vdd_vdtab = (struct vdlinkage *) &vd;
+       majnum = maj;
        break;
 
     case VDUNLOAD:
@@ -56,6 +58,20 @@ ppp_vdcmd(fun, vdp, vdi, vds)
        break;
 
     case VDSTAT:
+       /*
+        * We have to fool the modstat command into thinking
+        * that this module is actually a driver! This is
+        * so that installation commands that use the -exec
+        * option of modload to run a shell script find out
+        * the block and/or char major numbers of the driver
+        * loaded (so that the shell script can go off to
+        * /dev and *MAKE* the bloody device nodes- remember
+        * they might change from one load to another if
+        * you don't hardwire the number!).
+        */
+       vds->vds_magic = VDMAGIC_DRV;
+       vds->vds_modinfo[0] = (char) 0;
+       vds->vds_modinfo[1] = (char) majnum;
        break;
 
     default: