From dfff9ed93f3b87b5c775bcb6de1daaa4bc0575fb Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 27 Nov 1997 06:07:01 +0000 Subject: [PATCH] mods for broken sunos vdcmd stuff --- sunos4/ppp.INSTALL | 4 ++-- sunos4/ppp_vdcmd.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sunos4/ppp.INSTALL b/sunos4/ppp.INSTALL index 631370b..0018bf8 100755 --- a/sunos4/ppp.INSTALL +++ b/sunos4/ppp.INSTALL @@ -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 diff --git a/sunos4/ppp_vdcmd.c b/sunos4/ppp_vdcmd.c index 1e3853a..68095c9 100644 --- a/sunos4/ppp_vdcmd.c +++ b/sunos4/ppp_vdcmd.c @@ -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: -- 2.39.2