summaryrefslogtreecommitdiff
path: root/setup/SunOS
diff options
context:
space:
mode:
Diffstat (limited to 'setup/SunOS')
-rw-r--r--setup/SunOS/.changelog1
-rw-r--r--setup/SunOS/S89oss37
-rw-r--r--setup/SunOS/__xtol-i86pc-i386.s24
-rw-r--r--setup/SunOS/build.sh291
-rw-r--r--setup/SunOS/confgen.c221
-rw-r--r--setup/SunOS/i.drvcfg12
-rw-r--r--setup/SunOS/mkpkg.sh83
-rwxr-xr-xsetup/SunOS/oss.xml57
-rw-r--r--setup/SunOS/oss/scripts/install.sh97
-rw-r--r--setup/SunOS/postinstall101
-rw-r--r--setup/SunOS/postremove66
-rw-r--r--setup/SunOS/preremove5
-rw-r--r--setup/SunOS/r.drvcfg20
-rwxr-xr-xsetup/SunOS/sbin/soundoff72
-rwxr-xr-xsetup/SunOS/sbin/soundon161
-rw-r--r--setup/SunOS/solsetup.sh182
-rwxr-xr-xsetup/SunOS/svc-oss.htm55
17 files changed, 1485 insertions, 0 deletions
diff --git a/setup/SunOS/.changelog b/setup/SunOS/.changelog
new file mode 100644
index 0000000..4cd902c
--- /dev/null
+++ b/setup/SunOS/.changelog
@@ -0,0 +1 @@
+010814 by Dev Mazumdar: Added forceload.conf in build.sh so that USB driver loads.
diff --git a/setup/SunOS/S89oss b/setup/SunOS/S89oss
new file mode 100644
index 0000000..eaff504
--- /dev/null
+++ b/setup/SunOS/S89oss
@@ -0,0 +1,37 @@
+#!/bin/sh
+if test -f /etc/oss.conf
+then
+ . /etc/oss.conf
+else
+ OSSLIBDIR=/usr/lib/oss
+fi
+
+##########
+#
+# The first argument tells what to do.
+##########
+
+state=$1
+
+if test -f /etc/oss.conf
+then
+. /etc/oss.conf
+else
+ OSSLIBDIR=$OSSLIBDIR
+fi
+
+case $state in
+
+'start')
+ soundoff
+ soundon
+ exit 0
+ ;;
+'stop')
+ /usr/sbin/savemixer > /dev/null 2>&1
+ exit 0
+ ;;
+esac
+
+exit 1
+
diff --git a/setup/SunOS/__xtol-i86pc-i386.s b/setup/SunOS/__xtol-i86pc-i386.s
new file mode 100644
index 0000000..eebc94a
--- /dev/null
+++ b/setup/SunOS/__xtol-i86pc-i386.s
@@ -0,0 +1,24 @@
+.file "__xtol-i86pc-i386.s"
+.text
+.globl __xtol
+ .type __xtol, @function
+__xtol:
+ subl $0x8,%esp
+ fnstcw 0x2(%esp)
+ movw 0x2(%esp),%ax
+ movw %ax,%cx
+ andw $0xc00,%cx
+ orw $0xc00,%ax
+ movw %ax,0x0(%esp)
+ fldcw 0x0(%esp)
+ fistpl 0x4(%esp)
+ fstcw 0x0(%esp)
+ movw 0x0(%esp),%ax
+ andw $0xf3ff,%ax
+ orw %cx,%ax
+ movw %ax,0x0(%esp)
+ fldcw 0x0(%esp)
+ movl 0x4(%esp),%eax
+ addl $0x8,%esp
+ ret
+ .size __xtol, .-__xtol
diff --git a/setup/SunOS/build.sh b/setup/SunOS/build.sh
new file mode 100644
index 0000000..881ffa3
--- /dev/null
+++ b/setup/SunOS/build.sh
@@ -0,0 +1,291 @@
+
+. ./.directories
+
+OSSLIBDIR=/usr/lib/oss
+
+if test "`which gawk|grep 'no gawk in '` " = " " 2>/dev/null
+then
+ TXT2MAN=$SRCDIR/setup/txt2man
+else
+ cc -o txt2man origdir/setup/txt2man.c
+ TXT2MAN=./txt2man
+fi
+
+if test "`uname -p`" = "sparc"
+then
+ KERNEL32=sparc
+ KERNEL64=sparcv9
+ MACH=sun4u
+else
+ case `uname -r` in
+ "5.8")
+ KERNEL32=i386
+ KERNEL64=NULL
+ ;;
+ "5.9")
+ KERNEL32=i386
+ KERNEL64=NULL
+ ;;
+ *)
+ KERNEL32=i386
+ KERNEL64=amd64
+ ;;
+ esac
+ MACH=i86pc
+fi
+
+if test "`uname -r`" = "5.9" || test "`uname -r`" = "5.8"
+then
+ AMSRC=amsrc1
+ OSFLAGS=-DSOL9
+else
+ AMSRC=amsrc2
+fi
+
+# Re-create the prototype directory
+rm -rf prototype
+
+mkdir prototype
+mkdir prototype/kernel
+mkdir prototype/kernel/drv
+mkdir prototype/kernel/drv/$KERNEL64
+mkdir prototype/kernel/misc
+mkdir prototype/kernel/misc/$KERNEL64
+
+mkdir prototype/etc
+mkdir prototype/etc/oss
+mkdir prototype/etc/init.d
+mkdir prototype/usr
+mkdir prototype/usr/bin
+mkdir prototype/usr/sbin
+mkdir prototype/usr/man
+mkdir prototype/usr/man/man1
+mkdir prototype/usr/man/man1m
+mkdir prototype/usr/man/man7d
+mkdir prototype/usr/include
+mkdir prototype/usr/include/sys
+mkdir prototype/usr/include/oss
+mkdir prototype/usr/lib
+mkdir prototype/usr/lib/oss
+
+cat > prototype/usr/lib/oss/README <<EOF
+This directory is not used any more. Configuration files for OSS are
+located under /etc/oss. The soundon.log file is located in
+/var/log/soundon.log.
+EOF
+
+cp $KERNEL32/.version prototype/etc/oss/version.dat
+
+# Copy the files to their right place
+
+cp $SRCDIR/include/soundcard.h prototype/usr/include/sys
+cp $SRCDIR/include/oss_userdev_exports.h prototype/usr/include/oss
+(cd $KERNEL32/target/bin; rm -f ossrecord; ln -s ossplay ossrecord)
+cp $KERNEL32/target/bin/* prototype/usr/bin
+cp $KERNEL32/target/sbin/* prototype/usr/sbin
+cp $KERNEL32/setup/SunOS/sbin/* prototype/usr/sbin
+cp origdir/setup/SunOS/S89oss prototype/etc/init.d/oss
+chmod 500 prototype/usr/sbin/*
+echo "autosave_mixer yes" > prototype/etc/oss/userdefs
+#echo "usbif,class1" > prototype/etc/oss/forceload.conf
+rm -f devlist.txt
+
+# Create the driver modules (for 64 bit)
+
+if test "`ls $KERNEL64/target/modules/*.o 2>/dev/null` " != " "
+then
+ # osscommon
+ if ld -64 -dy -r -Nmisc/usba -o prototype/kernel/misc/$KERNEL64/osscommon $KERNEL64/target/objects/*.o
+ then
+ $TXT2MAN -v "OSS Devices" -s 7 $KERNEL64/kernel/drv/osscore/osscore.man > prototype/usr/man/man7d/osscore.7d
+ else
+ exit 1
+ fi
+
+ rm -f fpsupport.o
+
+ # Man pages
+ for n in $SRCDIR/misc/man7/*.man
+ do
+ N=`basename $n .man`
+ $TXT2MAN -t "$CMD" -v "OSS Devices" -s 7 $n > prototype/usr/man/man7d/$N.7d
+ done
+
+ for n in $SRCDIR/misc/man1m/*.man
+ do
+ N=`basename $n .man`
+ $TXT2MAN -t "$CMD" -v "OSS System Administration Commands" -s 1 $n > prototype/usr/man/man1m/$N.1m
+ done
+
+ # Other modules for 64bit kernel
+ for n in $KERNEL64/target/modules/*.o
+ do
+ N=`basename $n .o`
+ if ld -64 -dy -r -Nmisc/osscommon -o prototype/kernel/drv/$KERNEL64/$N $n
+ then
+ OK=1
+ else
+ exit 1
+ fi
+
+ if test $KERNEL64 = "sparcv9"
+ then
+ grep "^$N[ ]" $KERNEL64/devices.list >> devlist.txt
+ fi
+ done
+
+ # USB Module
+ if test -f $KERNEL64/target/modules/oss_usb.o
+ then
+ if ld -64 -dy -r -Nmisc/osscommon -Nmisc/usba -o prototype/kernel/drv/$KERNEL64/oss_usb $KERNEL64/target/modules/oss_usb.o
+ then
+ OK=1
+ else
+ exit 1
+ fi
+ fi
+
+ # SADA compatibility module
+ if test -r $KERNEL64/target/modules/oss_sadasupport.o
+ then
+ if ld -64 -dy -r -Nmisc/osscommon -Nmisc/$AMSRC -Nmisc/audiosup -Nmisc/mixer -o prototype/kernel/drv/$KERNEL64/oss_sadasupport $KERNEL64/target/modules/oss_sadasupport.o
+ then
+ OK=1
+ else
+ exit 1
+ fi
+ else
+ OK=1
+ fi
+fi # 64 bit modules done
+
+# Handle 32 bit modules
+
+if test "`ls $KERNEL32/target/modules/*.o 2>/dev/null` " != " "
+then
+
+ # osscommon
+
+ if ld -dy -r -Nmisc/usba -o prototype/kernel/misc/osscommon $KERNEL32/target/objects/*.o
+ then
+ $TXT2MAN -v "OSS Devices" -s 7 $KERNEL32/kernel/drv/osscore/osscore.man > prototype/usr/man/man7d/osscore.7d
+ else
+ exit 1
+ fi
+
+ rm -f fpsupport.o __xtol.o
+
+ # Other modules for 32bit kernel
+ for n in $KERNEL32/target/modules/*.o
+ do
+ N=`basename $n .o`
+ if ld -dy -r -Nmisc/osscommon -o prototype/kernel/drv/$N $n
+ then
+ OK=1
+ else
+ exit 1
+ fi
+ grep "^$N[ ]" $KERNEL32/devices.list >> devlist.txt
+ done
+
+ # USB Modules
+ if test -f $KERNEL32/target/modules/oss_usb.o
+ then
+ if ld -dy -r -Nmisc/osscommon -Nmisc/usba -o prototype/kernel/drv/oss_usb $KERNEL32/target/modules/oss_usb.o
+ then
+ OK=1
+ else
+ exit 1
+ fi
+ fi
+
+ # SADA Compatibility
+ if test -r $KERNEL32/target/modules/oss_sadasupport.o
+ then
+ if ld -dy -r -Nmisc/osscommon -Nmisc/$AMSRC -Nmisc/audiosup -Nmisc/mixer -o prototype/kernel/drv/oss_sadasupport $KERNEL32/target/modules/oss_sadasupport.o
+ then
+ OK=1
+ else
+ exit 1
+ fi
+ else
+ OK=1
+ fi
+
+fi # 32 bit modules done
+
+if test "$KERNEL64 " = "sparcv9 "
+then
+ # Drop SB Live! from the list of supported devices for Sparc
+ rm -f tmplist
+ mv devlist.txt tmplist
+ grep -v "Sound Blaster Live" < tmplist|sort|uniq >devlist.txt
+ rm -f tmplist
+fi
+
+cp devlist.txt prototype/etc/oss/devices.list
+
+if test -d $KERNEL32/kernel/nonfree
+then
+ cp -f devlist.txt $KERNEL32/origdir/devlists/Solaris-`uname -p`
+fi
+
+# Generate the config files
+rm -f confgen
+cc -o confgen -DTXT2MAN=\"$TXT2MAN\" $OSFLAGS $KERNEL32/setup/SunOS/confgen.c
+
+./confgen prototype/kernel/drv \\/kernel\\/drv $KERNEL32/kernel/drv/* $KERNEL32/kernel/nonfree/drv/* $KERNEL32/kernel/framework/*
+rm -f confgen
+
+# Generate Man pages for user commands
+for i in $KERNEL32/target/bin/*
+do
+ CMD=`basename $i`
+ $TXT2MAN -t "$CMD" -v "OSS User Commands" -s 1 $KERNEL32/cmd/$CMD/$CMD.man > prototype/usr/man/man1/$CMD.1
+ echo done $CMD
+done
+
+# Generate Man pages for system commands
+for i in $KERNEL32/target/sbin/*
+do
+ CMD=`basename $i`
+ if test -f $KERNEL32/cmd/$CMD/$CMD.man
+ then
+ $TXT2MAN -t "$CMD" -v "OSS System Administration Commands" -s 1m $KERNEL32/cmd/$CMD/$CMD.man > prototype/usr/man/man1m/$CMD.1m
+ echo done $CMD
+ fi
+done
+
+# Generate pages for Maintenance Commands
+rm -f prototype/usr/man/man1m/ossdetect.1m
+$TXT2MAN -t "ossdetect" -v "OSS User Commands" -s 1m $KERNEL32/os_cmd/SunOS/ossdetect/ossdetect.man > prototype/usr/man/man1m/ossdetect.1m
+echo done ossdetect
+
+# Licensing stuff
+if test -f $KERNEL32/4front-private/osslic.c
+then
+ cc $OSFLAGS -o prototype/usr/sbin/osslic -I$KERNEL32/setup -I$KERNEL32/kernel/nonfree/include -I$KERNEL32/kernel/framework/include -I$KERNEL32/include -I$KERNEL32/kernel/OS/SunOS $KERNEL32/4front-private/osslic.c
+ strip prototype/usr/sbin/osslic
+
+ if test -f prototype/kernel/misc/osscommon
+ then
+ prototype/usr/sbin/osslic -q -u -3prototype/kernel/misc/osscommon
+ fi
+
+ if test -f prototype/kernel/misc/$KERNEL64/osscommon
+ then
+ prototype/usr/sbin/osslic -q -u -6prototype/kernel/misc/$KERNEL64/osscommon
+ fi
+fi
+
+if test -f $KERNEL32/4front-private/ossupdate.c
+then
+ # ossupdate
+ cc -I$KERNEL32 $KERNEL32/4front-private/ossupdate.c -s -o prototype/usr/sbin/ossupdate -lsocket -lnsl
+fi
+
+sh $SRCDIR/setup/build_common.sh $SRCDIR $OSSLIBDIR
+
+rm -f $OSSLIBDIR/oss/
+
+exit 0
diff --git a/setup/SunOS/confgen.c b/setup/SunOS/confgen.c
new file mode 100644
index 0000000..61ac776
--- /dev/null
+++ b/setup/SunOS/confgen.c
@@ -0,0 +1,221 @@
+/*
+ *
+ * This file is part of Open Sound System.
+ *
+ * Copyright (C) 4Front Technologies 1996-2008.
+ *
+ * This this source file is released under GPL v2 license (no other versions).
+ * See the COPYING file included in the main directory of this source
+ * distribution for the license terms and conditions.
+ *
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <libgen.h>
+#include <sys/stat.h>
+
+char *targetdir = "";
+char *confpath = "";
+
+static void
+copy_parms (FILE * f, FILE * conf)
+{
+ char line[1024], *s, *p;
+ char var[256] = "", comment[64 * 1024] = "";
+ int i;
+
+ while (fgets (line, sizeof (line) - 1, f) != NULL)
+ {
+ for (i = 0; i < strlen (line); i++)
+ if (line[i] == '\n')
+ line[i] = 0;
+
+ s = line;
+
+ while (*s == ' ' || *s == '\t')
+ s++;
+ if (strncmp (s, "int ", 4) == 0)
+ {
+ if (*var != 0)
+ {
+ fprintf (conf, "%s\n", comment);
+ if (*var != 0)
+ fprintf (conf, "%s\n", var);
+ *var = 0;
+ *comment = 0;
+ }
+ s += 4;
+
+ for (i = 0; i < strlen (line); i++)
+ if (line[i] == ';')
+ line[i] = 0;
+ strcpy (var, s);
+ continue;
+ }
+
+
+ s = line;
+
+ while (*s == ' ' || *s == '\t' || *s == '/' || *s == '*')
+ s++;
+
+ strcat (comment, "\n# ");
+ strcat (comment, s);
+ }
+
+ if (*var != 0)
+ {
+ fprintf (conf, "%s\n", comment);
+ fprintf (conf, "%s\n", var);
+ }
+}
+
+static void
+scan_dir (char *srcdir, char *module)
+{
+ char confname[256], tmp[256], line[1024], syscmd[255];
+ FILE *conf;
+ FILE *f;
+ int i;
+ struct stat st;
+
+ int is_pci = 1;
+ int check_platform = 0;
+ int platform_ok = 0;
+
+ if (stat (srcdir, &st) == -1)
+ {
+ // perror("stat");
+ // fprintf(stderr, "confgen: Cannot access %s\n", srcdir);
+ return;
+ }
+
+ if (!S_ISDIR (st.st_mode)) /* Not a directory? */
+ {
+ // fprintf(stderr, "confgen: %s is not a directory\n", srcdir);
+ return;
+ }
+
+ sprintf (tmp, "%s/.nomake", srcdir);
+ if (stat (tmp, &st) != -1) /* File exists */
+ return; /* Skip this one */
+
+ sprintf (tmp, "%s/.config", srcdir);
+ if ((f = fopen (tmp, "r")) != NULL)
+ {
+ while (fgets (line, sizeof (line) - 1, f) != NULL)
+ {
+ char *s;
+ for (i = 0; i < strlen (line); i++)
+ if (line[i] == '\n')
+ line[i] = 0;
+
+ s = line;
+ while (*s && *s != '=')
+ s++;
+ if (*s == '=')
+ *s++ = 0;
+
+ if (strcmp (line, "bus") == 0)
+ {
+ if (strcmp (s, "PCI") != 0)
+ is_pci = 0;
+ continue;
+ }
+
+ if (strcmp (line, "platform") == 0)
+ {
+ check_platform = 1;
+#ifdef sparc
+ if (strcmp (s, "sparc") == 0)
+ platform_ok = 1;
+#endif
+
+#ifdef i386
+ if (strcmp (s, "i86pc") == 0)
+ platform_ok = 1;
+#endif
+ continue;
+ }
+ }
+ fclose (f);
+ }
+#if 0
+ else
+ perror (tmp);
+#endif
+
+ if (check_platform && !platform_ok)
+ {
+ return;
+ }
+
+ /* generate the man pages */
+
+ sprintf (tmp, "%s/%s.man", srcdir, module);
+ if (stat (tmp, &st) != 0) /* Man File doesn't exist */
+ goto no_manual; /* Skip this one */
+
+ sprintf (syscmd, "sed 's/CONFIGFILEPATH/%s/' < %s/%s.man > /tmp/ossman.man",
+ confpath, srcdir, module);
+ //printf ("%s\n", syscmd);
+ unlink ("/tmp/ossman.man");
+ system (syscmd);
+
+ sprintf (syscmd,
+ TXT2MAN
+ " -t \"%s\" -v \"Devices\" -s 7d /tmp/ossman.man > prototype/usr/man/man7d/%s.7d",
+ module, module);
+ //printf ("%s\n", syscmd);
+ system (syscmd);
+
+no_manual:
+ sprintf (confname, "%s/%s.conf", targetdir, module);
+
+ if ((conf = fopen (confname, "w")) == NULL)
+ {
+ perror (confname);
+ exit (-1);
+ }
+
+ fprintf (conf, "# Open Sound System configuration file\n");
+
+ if (is_pci)
+ fprintf (conf,
+ "# Please consult the documentation before changing\n# interrupt-priorities\ninterrupt-priorities=9 ");
+ else
+ fprintf (conf, "name=\"%s\" parent=\"pseudo\" instance=0 ", module);
+
+ fprintf (conf, "ddi-no-autodetach=1 ddi-forceattach=1 \n");
+
+ sprintf (tmp, "%s/.params", srcdir);
+ if ((f = fopen (tmp, "r")) != NULL)
+ {
+ copy_parms (f, conf);
+ fclose (f);
+ }
+
+ fprintf (conf, ";\n");
+ fclose (conf);
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+
+ if (argc < 3)
+ exit (-1);
+
+ targetdir = argv[1];
+ confpath = argv[2];
+
+ for (i = 3; i < argc; i++)
+ {
+ scan_dir (argv[i], basename (argv[i]));
+ }
+
+ exit (0);
+}
diff --git a/setup/SunOS/i.drvcfg b/setup/SunOS/i.drvcfg
new file mode 100644
index 0000000..05dfcf0
--- /dev/null
+++ b/setup/SunOS/i.drvcfg
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 4Fronte Technologies
+#
+
+while read src dest
+do
+ if [ ! -f $dest ] ; then
+ mv $src $dest
+ fi
+done
+exit 0
diff --git a/setup/SunOS/mkpkg.sh b/setup/SunOS/mkpkg.sh
new file mode 100644
index 0000000..5c43694
--- /dev/null
+++ b/setup/SunOS/mkpkg.sh
@@ -0,0 +1,83 @@
+#!/usr/bin/bash
+case `uname -r` in
+ "5.6") OS=solaris6
+ REL=6
+ ;;
+ "5.7") OS=solaris7
+ REL=7
+ ;;
+ "5.8") OS=solaris8
+ REL=8
+ ;;
+ "5.9") OS=solaris9
+ REL=9
+ ;;
+ *) OS=solaris
+ REL=10
+ ;;
+esac
+
+ARCH=`uname -p`
+PKG=oss
+VERSION=`sh $ARCH/showversion.sh`
+BUILDID=`cat $ARCH/buildid.dat`
+PKGVERSION=$VERSION-$BUILDID
+PKGFILE=$PKG-$OS-$PKGVERSION-$ARCH.pkg
+# Setup the scripts
+echo "CLASSES=none drvcfg" > $ARCH/setup/SunOS/pkginfo
+echo "BASEDIR=/" >> $ARCH/setup/SunOS/pkginfo
+echo "TZ=PST" >> $ARCH/setup/SunOS/pkginfo
+echo "PKG=$PKG" >> $ARCH/setup/SunOS/pkginfo
+echo "PATH=/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin" >> $ARCH/setup/SunOS/pkginfo
+echo "NAME=Open Sound System" >> $ARCH/setup/SunOS/pkginfo
+echo "VERSION=$PKGVERSION" >> $ARCH/setup/SunOS/pkginfo
+echo "CATEGORY=driver" >> $ARCH/setup/SunOS/pkginfo
+echo "DESC=Open Sound System for Solaris $ARCH" >> $ARCH/setup/SunOS/pkginfo
+echo "ARCH=$ARCH" >> $ARCH/setup/SunOS/pkginfo
+echo "VENDOR=4Front Technologies" >> $ARCH/setup/SunOS/pkginfo
+echo "HOTLINE=+1 (310) 202 8530" >> $ARCH/setup/SunOS/pkginfo
+echo "EMAIL=support@opensound.com" >> $ARCH/setup/SunOS/pkginfo
+echo "VSTOCK=" >> $ARCH/setup/SunOS/pkginfo
+echo "PSTAMP=" >> $ARCH/setup/SunOS/pkginfo
+echo "PKGINST=oss" >> $ARCH/setup/SunOS/pkginfo
+echo "PKGSAV=/var/sadm/pkg/OSS/save" >> $ARCH/setup/SunOS/pkginfo
+echo "INSTDATE=" >> $ARCH/setup/SunOS/pkginfo
+
+echo "i pkginfo=$ARCH/setup/SunOS/pkginfo" > /tmp/$$
+if test -f $ARCH/.date
+then
+ # Open source version
+ echo "i copyright=$ARCH/COPYING" >> /tmp/$$
+else
+ # Retail version
+ echo "i copyright=$ARCH/EULA" >> /tmp/$$
+fi
+echo "i postinstall=$ARCH/setup/SunOS/postinstall" >> /tmp/$$
+echo "i preremove=$ARCH/setup/SunOS/preremove" >>/tmp/$$
+echo "i postremove=$ARCH/setup/SunOS/postremove" >>/tmp/$$
+echo "i i.drvcfg=$ARCH/setup/SunOS/i.drvcfg" >>/tmp/$$
+echo "i r.drvcfg=$ARCH/setup/SunOS/r.drvcfg" >>/tmp/$$
+
+# now get a list of all the files and directories
+(cd prototype; find . -type f -print |pkgproto >> /tmp/$$)
+(cd prototype; find . -type l -print |pkgproto >> /tmp/$$)
+
+# now change the file type of .conf files to editable and set class to drvcfg
+EXCEPTIONLIST='.conf|userdefs'
+
+/usr/xpg4/bin/grep -v -E -e $EXCEPTIONLIST /tmp/$$ > proto
+/usr/xpg4/bin/grep -E -e $EXCEPTIONLIST /tmp/$$ |sed -e 's/f none/e drvcfg/g' >> proto
+
+# Remove the temp file.
+echo "removing /tmp/$$"; rm -f /tmp/$$
+
+#now create the package.
+pkgmk -o -d /tmp -r prototype -a $ARCH -f proto
+touch $PKGFILE
+pkgtrans -s /tmp $PKGFILE $PKG
+echo package file is $PKGFILE
+
+if test -f $ARCH/4front-private/export_package.sh
+then
+ sh $ARCH/4front-private/export_package.sh $PKGFILE $ARCH `sh $ARCH/showversion.sh` /tmp $ARCH-$REL
+fi
diff --git a/setup/SunOS/oss.xml b/setup/SunOS/oss.xml
new file mode 100755
index 0000000..c8cafee
--- /dev/null
+++ b/setup/SunOS/oss.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type='manifest' name='opensoundsvc'>
+<service
+ name='system/opensound'
+ type='service'
+ version='1'>
+
+ <create_default_instance enabled='false' />
+ <single_instance/>
+
+ <!-- No idea what sysconfig is good for, but it's in all examples -->
+ <dependency
+ name='sysconfig'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri value='svc:/milestone/sysconfig' />
+ </dependency>
+
+ <!-- Require local filesystems to be present -->
+ <dependency
+ name='fslocal'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri value='svc:/system/filesystem/local:default' />
+ </dependency>
+
+ <exec_method
+ type='method'
+ name='start'
+ exec='/lib/svc/method/svc-oss start'
+ timeout_seconds='60'>
+ </exec_method>
+
+ <exec_method
+ type='method'
+ name='stop'
+ exec='/lib/svc/method/svc-oss stop'
+ timeout_seconds='60'>
+ </exec_method>
+
+ <!-- soundon and ossdevlinks exit, so it's a transient service -->
+ <property_group name='startd' type='framework'>
+ <propval name='duration' type='astring' value='transient' />
+ </property_group>
+
+ <stability value='Evolving' />
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>Open Sound System control service</loctext>
+ </common_name>
+ </template>
+</service>
+
+</service_bundle>
diff --git a/setup/SunOS/oss/scripts/install.sh b/setup/SunOS/oss/scripts/install.sh
new file mode 100644
index 0000000..91ebbe6
--- /dev/null
+++ b/setup/SunOS/oss/scripts/install.sh
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+echo "Setting up Open Sound System....please wait"
+
+if test -f /etc/oss.conf
+then
+ . /etc/oss.conf
+else
+ OSSLIBDIR=/usr/lib/oss
+fi
+
+rm -f /etc/rc3.d/S80ossinstall # Remove temporary installer
+
+# Remove previous sound drivers and make a backup of the removed
+# /etc/driver_aliases lines.
+rem_drv oss > /dev/null 2>&1 # OSS 3.99.x and earlier
+rem_drv ossaudios > /dev/null 2>&1 # Old name for sadasupport
+
+for n in audiocs audioens audiots audio1575 audiovia823x audiohd audio810 audioixp usb_ac usb_as
+do
+ # Copy the /etc/driver_aliases entries for the SADA drivers to a backup
+ # file so that the drivers could be restored later.
+ grep "^$n " /etc/driver_aliases >> /usr/lib/oss/etc/driver_aliases.removed
+
+ rem_drv $n > /dev/null 2>&1 # Remove the driver
+done
+
+# Make sure the driver aliases collection doesn't contain duplicate lines
+sort /usr/lib/oss/etc/driver_aliases.removed|uniq > /usr/lib/oss/etc/driver_aliases.bak
+mv /usr/lib/oss/etc/driver_aliases.bak /usr/lib/oss/etc/driver_aliases.removed
+rm -f /usr/lib/oss/etc/driver_aliases.bak
+
+# Remove previous OSS and SADA devices
+rm -f /dev/sound/*
+rm -f /dev/audio*
+rm -f /dev/dsp*
+rm -f /dev/mixer*
+rm -f /dev/midi*
+rm -f /dev/sndstat
+rm -f /dev/sequencer
+rm -f /dev/music
+
+sync
+
+rm -f /tmp/osspkg.tmp
+grep -v type=oss_ /etc/devlink.tab > /tmp/osspkg.tmp
+cat /tmp/osspkg.tmp > /etc/devlink.tab
+cat >> /etc/devlink.tab <<EOF
+type=oss_sysdev \M0
+type=oss_audio oss/\M1/\M2
+EOF
+
+if test ! -f $OSSLIBDIR/etc/userdefs
+then
+ echo "autosave_mixer yes" > $OSSLIBDIR/etc/userdefs
+fi
+
+if /usr/xpg4/bin/grep -q 'install_imux yes' $OSSLIBDIR/etc/userdefs
+then
+ # Install the imux driver
+ /usr/sbin/ossdetect -i
+else
+ /usr/sbin/ossdetect
+fi
+
+/usr/sbin/devlinks
+/usr/sbin/ossdevlinks
+
+# Symlink the config files to $OSSLIBDIR/conf
+#cd $OSSLIBDIR/conf
+#ARCH=`uname -m`
+#for n in `grep -l 'Open Sound System configuration file' /kernel/drv/*.conf`
+#do
+# ln -s $n .
+#done
+
+#echo ""
+#echo "Adding OSS startup scripts to /etc/rc3.d and /etc/init.d"
+#rm -f /etc/rc3.d/S89oss /etc/rc3.d/S99oss /etc/init.d/oss
+
+#cp $OSSLIBDIR/etc/S89oss /etc/init.d/oss
+#chmod 744 /etc/init.d/oss
+
+#ln -s ../init.d/oss /etc/rc3.d/S89oss
+#ln -s ../init.d/oss /etc/rc3.d/K89oss
+
+echo ""
+echo ""
+echo ""
+echo Open Sound System installation complete
+echo ""
+echo You can use the osstest command to test audio playback in your system.
+echo ""
+echo It may be necessary to reboot the system before all devices get properly
+echo detected by the system.
+
+exit 0
diff --git a/setup/SunOS/postinstall b/setup/SunOS/postinstall
new file mode 100644
index 0000000..94e02d4
--- /dev/null
+++ b/setup/SunOS/postinstall
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+echo "Setting up Open Sound System....please wait"
+
+rm -f ${PKG_INSTALL_ROOT}/etc/rc3.d/S80ossinstall # Remove temporary installer
+
+# Remove previous sound drivers and make a backup of the removed
+# /etc/driver_aliases lines.
+rem_drv oss > /dev/null 2>&1 # OSS 3.99.x and earlier
+rem_drv ossaudios > /dev/null 2>&1 # Old name for sadasupport
+
+for n in `ls /kernel/drv|grep audio|grep -v .conf` usb_ac usb_as
+do
+ echo Removing old driver $n
+ # Copy the /etc/driver_aliases entries for the SADA drivers to a backup
+ # file so that the drivers could be restored later.
+ grep "^$n " ${PKG_INSTALL_ROOT}/etc/driver_aliases >> ${PKG_INSTALL_ROOT}/etc/oss/driver_aliases.removed
+
+ rem_drv $n > /dev/null 2>&1 # Remove the driver
+done
+
+# Make sure the driver aliases collection doesn't contain duplicate lines
+sort ${PKG_INSTALL_ROOT}/etc/oss/driver_aliases.removed|uniq > ${PKG_INSTALL_ROOT}/etc/oss/driver_aliases.bak
+mv ${PKG_INSTALL_ROOT}/etc/oss/driver_aliases.bak ${PKG_INSTALL_ROOT}/etc/oss/driver_aliases.removed
+rm -f ${PKG_INSTALL_ROOT}/etc/oss/driver_aliases.bak
+
+# Remove previous OSS and SADA devices
+rm -f ${PKG_INSTALL_ROOT}/dev/sound/*
+rm -f ${PKG_INSTALL_ROOT}/dev/audio*
+rm -f ${PKG_INSTALL_ROOT}/dev/dsp*
+rm -f ${PKG_INSTALL_ROOT}/dev/mixer*
+rm -f ${PKG_INSTALL_ROOT}/dev/midi*
+rm -f ${PKG_INSTALL_ROOT}/dev/sndstat
+rm -f ${PKG_INSTALL_ROOT}/dev/sequencer
+rm -f ${PKG_INSTALL_ROOT}/dev/music
+
+(cd ${PKG_INSTALL_ROOT}/etc/rc3.d;ln -s ../init.d/oss S89oss)
+
+sync
+
+rm -f ${PKG_INSTALL_ROOT}/tmp/osspkg.tmp
+grep -v type=oss_ ${PKG_INSTALL_ROOT}/etc/devlink.tab > ${PKG_INSTALL_ROOT}/tmp/osspkg.tmp
+cat ${PKG_INSTALL_ROOT}/tmp/osspkg.tmp > ${PKG_INSTALL_ROOT}/etc/devlink.tab
+cat >> ${PKG_INSTALL_ROOT}/etc/devlink.tab <<EOF
+type=oss_sysdev \M0
+type=oss_audio oss/\M1/\M2
+EOF
+
+if test ! -f ${PKG_INSTALL_ROOT}/etc/oss/userdefs
+then
+ echo "autosave_mixer yes" > ${PKG_INSTALL_ROOT}/etc/oss/userdefs
+fi
+
+if ${PKG_INSTALL_ROOT}/usr/xpg4/bin/grep -q 'install_imux yes' $OSSLIBDIR/etc/oss/userdefs
+then
+ # Install the imux driver
+ ${PKG_INSTALL_ROOT}/usr/sbin/ossdetect -i
+else
+ ${PKG_INSTALL_ROOT}/usr/sbin/ossdetect
+fi
+
+${PKG_INSTALL_ROOT}/usr/sbin/devlinks
+${PKG_INSTALL_ROOT}/usr/sbin/ossdevlinks
+
+if test "`ossinfo -g|grep TRIAL` " != " "
+then
+ echo
+ echo
+ echo
+ echo "************************************************************"
+ echo "* NOTE! You are using trial version of Open Sound System *"
+ echo "************************************************************"
+ echo
+
+ sleep 10
+fi
+
+if test "`ossinfo -g|grep EXPIRED` " != " "
+then
+ echo
+ echo
+ echo
+ echo "****************************************************************"
+ echo "* NOTE! Your Open Sound System evaluation license has expired *"
+ echo "****************************************************************"
+ echo
+
+ sleep 15
+fi
+
+echo ""
+echo ""
+echo ""
+echo Open Sound System installation complete
+echo ""
+echo You can use the osstest command to test audio playback in your system.
+echo ""
+echo It may be necessary to reboot the system before all devices get properly
+echo detected by the system.
+
+exit 0
diff --git a/setup/SunOS/postremove b/setup/SunOS/postremove
new file mode 100644
index 0000000..0d4ed19
--- /dev/null
+++ b/setup/SunOS/postremove
@@ -0,0 +1,66 @@
+#! /bin/sh
+
+PATH="/usr/bin:/usr/sbin:${PATH}"
+export PATH
+
+ISA_TYPE_I386="i386"
+ISA_TYPE_SPARC="sparc"
+ISA_TYPE="$ARCH"
+
+if test -f ${PKG_INSTALL_ROOT}/tmp/installed_drivers
+then
+ for i in `cat ${PKG_INSTALL_ROOT}/tmp/installed_drivers | sed 's/ .*//'`
+ do
+ rem_drv $i
+ done
+fi
+rm -f ${PKG_INSTALL_ROOT}/tmp/installed_drivers
+
+#
+# Unload the osscommon misc/module
+#
+MODULEID=`/usr/sbin/modinfo|grep " osscommon "|sed "s/^ *//"|sed "s/ .*//"`
+if test " $MODULEID" != " "
+then
+ /usr/sbin/modunload -i $MODULEID
+fi
+
+# Remove the device files
+rm -f ${PKG_INSTALL_ROOT}/dev/dsp*
+rm -f ${PKG_INSTALL_ROOT}/dev/mixer*
+rm -f ${PKG_INSTALL_ROOT}/dev/midi*
+rm -rf ${PKG_INSTALL_ROOT}/dev/oss
+rm -f ${PKG_INSTALL_ROOT}/dev/sndstat
+rm -f ${PKG_INSTALL_ROOT}/dev/sequencer
+rm -f ${PKG_INSTALL_ROOT}/dev/music
+rm -f ${PKG_INSTALL_ROOT}/dev/sound/*
+rm -f ${PKG_INSTALL_ROOT}/dev/audio
+rm -f ${PKG_INSTALL_ROOT}/dev/audioctl
+rm -f ${PKG_INSTALL_ROOT}/etc/rc3.d/S89oss ${PKG_INSTALL_ROOT}/etc/rc3.d/K89oss ${PKG_INSTALL_ROOT}/etc/rc3.d/S99oss ${PKG_INSTALL_ROOT}/etc/init.d/oss
+
+# Remove OSS related entries from /etc/devlink.tab
+rm -f ${PKG_INSTALL_ROOT}/tmp/osspkg.tmp
+grep -v type=oss_ ${PKG_INSTALL_ROOT}/etc/devlink.tab > ${PKG_INSTALL_ROOT}/tmp/osspkg.tmp
+cat ${PKG_INSTALL_ROOT}/tmp/osspkg.tmp > ${PKG_INSTALL_ROOT}/etc/devlink.tab
+
+if [ "${ISA_TYPE}" = "${ISA_TYPE_I386}" ]; then
+ # Restore SADA drivers
+ for PKG in SUNWaudd SUNWvia823x SUNWaudiohd SUNWad810 SUNWadixp SUNWusb
+ do
+ echo $PKG
+ sh ${PKG_INSTALL_ROOT}/var/sadm/pkg/$PKG/save/pspool/$PKG/install/postinstall
+ done
+elif [ "${ISA_TYPE}" = "${ISA_TYPE_SPARC}" ]; then
+ # Restore SADA drivers
+ for PKG in SUNWaudd
+ do
+ echo $PKG
+ sh ${PKG_INSTALL_ROOT}/var/sadm/pkg/$PKG/save/pspool/$PKG/install/postinstall
+ done
+fi
+
+# finally remove /etc/oss directory.
+
+rm -rf /etc/oss
+
+exit 0
diff --git a/setup/SunOS/preremove b/setup/SunOS/preremove
new file mode 100644
index 0000000..d46a306
--- /dev/null
+++ b/setup/SunOS/preremove
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cp -f ${PKG_INSTALL_ROOT}/etc/oss/installed_drivers ${PKG_INSTALL_ROOT}/tmp/installed_drivers
+
+rm -f ${PKG_INSTALL_ROOT}/usr/sfw/lib/libflashsupport.so
diff --git a/setup/SunOS/r.drvcfg b/setup/SunOS/r.drvcfg
new file mode 100644
index 0000000..713ef60
--- /dev/null
+++ b/setup/SunOS/r.drvcfg
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 by 4Front Technologies
+# All rights reserved.
+#
+#
+
+while read src
+do
+ if [ -f $src ]
+ then
+ if /usr/sbin/pkgchk -p $src
+ then
+ rm -f $src
+ else
+ echo "not removing $src"
+ fi
+ fi
+done
+exit 0
diff --git a/setup/SunOS/sbin/soundoff b/setup/SunOS/sbin/soundoff
new file mode 100755
index 0000000..432b65c
--- /dev/null
+++ b/setup/SunOS/sbin/soundoff
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+LOG=/var/log/soundoff.log
+rm -f $LOG
+
+if test "`/usr/sbin/modinfo|grep OSS` " = " "
+then
+ exit 0
+fi
+
+PIDLIST="`fuser /dev/mixer* /dev/dsp* /dev/midi* /dev/oss/*/* 2>/dev/null`"
+
+if test ! "$PIDLIST " = " "
+then
+ echo
+ echo 'Error: OSS devices are in use by the following application(s)'
+ echo
+
+ for n in $PIDLIST
+ do
+ ps -p $n |grep -v PID
+ done
+
+ echo
+ echo Please terminate these applications and try soundoff again
+ echo
+ exit 1
+fi
+
+# Save mixer settings automatically
+/usr/sbin/savemixer
+
+echo Modules to be unloaded >> $LOG
+/usr/sbin/modinfo|grep OSS >> $LOG
+
+# Perform three iterations since certain drivers may depend on each other
+
+if test -f /etc/oss/installed_drivers
+then
+ for i in 1 2 3 4 5
+ do
+ for n in `cat /etc/oss/installed_drivers | sed 's/ .*//'`
+ do
+ N=`modinfo|grep " $n "|sed 's/^ //'|sed 's/ .*//'`
+ if test "$N " != " "
+ then
+ echo Unload $n/$N>> $LOG
+ /usr/sbin/modunload -i $N >> $LOG 2>&1
+ fi
+ done
+ done
+fi
+
+#remove the osscore module that isn't listed in installed_drivers
+N=`modinfo|grep " osscore "|sed 's/^ //'|sed 's/ .*//'`
+echo Unload osscore >> $LOG
+/usr/sbin/modunload -i $N >> $LOG 2>&1
+
+#remove the osscommon module that isn't listed in installed_drivers
+N=`modinfo|grep " osscommon "|sed 's/^ //'|sed 's/ .*//'`
+echo Unload osscommon >> $LOG
+/usr/sbin/modunload -i $N >> $LOG 2>&1
+
+if test "`/usr/sbin/modinfo|grep OSS` " = " "
+then
+ exit 0
+fi
+
+echo Modules left >> $LOG
+/usr/sbin/modinfo|grep OSS >> $LOG
+
+exit 0
diff --git a/setup/SunOS/sbin/soundon b/setup/SunOS/sbin/soundon
new file mode 100755
index 0000000..79b7ca2
--- /dev/null
+++ b/setup/SunOS/sbin/soundon
@@ -0,0 +1,161 @@
+#!/bin/sh
+
+case `/usr/bin/isainfo -k` in
+
+i386)
+ DRVPATH=/kernel/drv/
+ ;;
+
+amd64)
+ DRVPATH=/kernel/drv/amd64/
+ ;;
+
+sparcv9)
+ DRVPATH=/kernel/drv/sparcv9/
+ ;;
+
+*)
+ echo Unknown architecture in soundon `isainfo -k`
+esac
+
+if test "`modinfo|grep OSS` " != " "
+then
+ echo One or more OSS modules already loaded
+ modinfo|grep OSS
+ exit 1
+fi
+
+LOG=/var/log/soundon.log
+
+rm -f /dev/sndstat # Just in case Boomer is installed in the system
+
+echo "Open Sound System starting" `date` > $LOG
+echo "OSS version: " `cat /etc/oss/version.dat` >> $LOG 2>&1
+echo Solaris version: `uname -a` >> $LOG
+echo CPU: `isainfo -k` >> $LOG
+
+if test "`/usr/sbin/modinfo|grep OSS` " != " "
+then
+ echo Warning: Some of the OSS modules were already loaded >> $LOG
+ /usr/sbin/modinfo|grep OSS >> $LOG
+fi
+
+if test -f /etc/oss/license.asc
+then
+ /usr/sbin/ossdetect -l >> $LOG
+fi
+
+# Load osscore since it's not listed in installed_drivers file
+/usr/sbin/modload $DRVPATH/osscore >> $LOG 2>&1
+/usr/sbin/modinfo|grep " osscore " >> $LOG
+
+if test -f /etc/oss/installed_drivers
+then
+
+ echo "Loading driver modules" >> $LOG
+ for n in `cat /etc/oss/installed_drivers | sed 's/ .*//'`
+ do
+ /usr/sbin/modload $DRVPATH/$n >> $LOG 2>&1
+ /usr/sbin/modinfo|grep " $n " >> $LOG
+ /usr/sbin/devfsadm -i $n
+ done
+else
+ echo /etc/oss/installed_drivers not found. >> $LOG
+ echo /etc/oss/installed_drivers not found.
+ exit 1
+fi
+
+sleep 5
+echo "=========" >> $LOG
+find /devices -name *_mix* > /dev/null
+find /devices -name *_pcm* > /dev/null
+find /devices -name *_mid* > /dev/null
+/usr/sbin/devlinks
+
+# Restore the legacy device links.
+if test -f /etc/oss/legacy_devices
+then
+ sh /etc/oss/legacy_devices >> $LOG 2>&1
+fi
+
+echo "=========" >> $LOG
+/usr/sbin/ossdevlinks -v >> $LOG 2>&1
+ls -l /dev/*dsp* /dev/*_pcm* /dev/*mixer* /dev/*_mix* /dev/*midi* /dev/*_mid* >> $LOG 2>&1
+echo "=========" >> $LOG
+echo "OSS configuration" >> $LOG
+/usr/bin/ossinfo -v3 >> $LOG 2>&1
+echo "=========" >> $LOG
+cat /dev/sndstat >> $LOG
+
+if test -f /etc/oss/mixer.save || test -f /etc/oss/dspdevs.map || test -f /etc/oss/applist.conf
+then
+ /usr/sbin/savemixer -L
+fi
+
+echo "=========" >> $LOG
+dmesg >> $LOG
+
+if grep "This OSS version has expired" /dev/sndstat > /dev/null
+then
+rm -f /tmp/ossmsg
+cat > /tmp/ossmsg << EOM
+From: "Open Sound System" <root>
+To: <root>
+Subject: Your Open Sound System copy has expired
+
+The unregistered version of Open Sound System installed in your system
+has expired. To continue using Open Sound System you need to upgrade to the
+latest OSS version which is available from http://www.opensound.com/download.cgi
+
+Alternatively ou can purchase the official OSS version from
+http://www.opensound.com/order.html . The registered version does not
+have any time limits.
+
+Best regards,
+
+Open Sound System Sales
+sales@opensound.com
+
+EOM
+
+echo
+echo
+echo '********** IMPORTANT! *************'
+echo
+cat /tmp/ossmsg
+
+mail root < /tmp/ossmsg
+
+rm -f /tmp/ossmsg
+
+fi
+
+if test -x /etc/oss/soundon.user
+then
+ echo Running /etc/oss/soundon.user >> $LOG
+ /etc/oss/soundon.user >> $LOG 2>&1
+fi
+
+if test "`ossinfo -g|grep TRIAL` " != " "
+then
+ echo
+ echo "************************************************************"
+ echo "* NOTE! You are using trial version of Open Sound System *"
+ echo "************************************************************"
+ echo
+
+ sleep 1
+fi
+
+if test "`ossinfo -g|grep EXPIRED` " != " "
+then
+ echo
+ echo "****************************************************************"
+ echo "* NOTE! Your Open Sound System evaluation license has expired *"
+ echo "****************************************************************"
+ echo
+
+ sleep 15
+fi
+
+exit 0
diff --git a/setup/SunOS/solsetup.sh b/setup/SunOS/solsetup.sh
new file mode 100644
index 0000000..732c18a
--- /dev/null
+++ b/setup/SunOS/solsetup.sh
@@ -0,0 +1,182 @@
+#!/bin/sh
+
+if test "$CONFIGURE " != "YES "
+then
+ echo
+ echo Error: Wrong usage
+ echo
+ echo You must run `dirname $0`/configure instead of $0
+ exit 1
+fi
+
+if test "`ls .` " != " "
+then
+ echo Error: Current directory must be empty
+ exit 1
+fi
+
+if test "`uname -p`" = "sparc"
+then
+KERNEL32=sparc
+KERNEL64=sparcv9
+KERNEL32FLAGS=-U
+KERNEL64FLAGS=-K
+else
+if test "`uname -r`" = "5.9"
+then
+KERNEL32=i386
+KERNEL64=NULL
+KERNEL32FLAGS=
+KERNEL64FLAGS=
+else
+KERNEL32=i386
+KERNEL64=amd64
+KERNEL32FLAGS=
+KERNEL64FLAGS=-K
+fi
+fi
+
+ln -s $SRCDIR/setup/SunOS/build.sh build.sh
+ln -s $SRCDIR origdir
+ln -s $SRCDIR/misc/samples/ddksample .
+echo SRCDIR=$SRCDIR>.directories
+echo > .nocopy
+
+# Check if SADA headers are present in the system.
+
+if test -f /usr/include/sys/audiovar.h
+then
+ HAVE_SADA=1
+ export HAVE_SADA
+else
+ echo
+ echo Warning! oss_sadasupport cannot be compiled in systems that have
+ echo Boomer installed.
+ echo
+fi
+
+# Make the 32bit kernel drivers
+mkdir $KERNEL32
+echo "cd $KERNEL32;sh $SRCDIR/setup/setupdir.sh -A$KERNEL32 $KERNEL32FLAGS"
+(cd $KERNEL32;sh $SRCDIR/setup/setupdir.sh -A$KERNEL32 $KERNEL32FLAGS)
+
+# If KERNEL64 is specified then do both 32 and 64bit
+if test "$KERNEL64" != "NULL"
+then
+ mkdir $KERNEL64
+ echo "cd $KERNEL64;sh $SRCDIR/setup/setupdir.sh -A$KERNEL64 $KERNEL64FLAGS"
+ (cd $KERNEL64;sh $SRCDIR/setup/setupdir.sh -A$KERNEL64 $KERNEL64FLAGS)
+
+ # Make sure both 32 and 64 bit versions share the same timestamp.h file.
+ cp $KERNEL32/kernel/framework/include/timestamp.h $KERNEL64/kernel/framework/include/timestamp.h
+
+ cat > Makefile <<THE_END_IS_NEAR
+# Autogenerated file - do not edit
+
+all: $KERNEL32/kernel/framework/include/buildid.h subdirs build
+
+install: all
+ rm -f prototype/kernel/drv/*.conf
+ cp -R prototype/* /
+ sync
+ soundoff
+ sync
+ soundon
+ sync
+
+subdirs:
+ cd $KERNEL32;make
+ cd $KERNEL64;make
+
+build:
+ sh build.sh
+
+copy: all
+ rm -f prototype/kernel/drv/*.conf
+ cp -R prototype/* /
+
+package: all
+ sh $KERNEL32/setup/SunOS/mkpkg.sh
+
+clean:
+ cd $KERNEL32;make clean
+ cd $KERNEL64;make clean
+ rm -f *.pkg
+ rm -rf prototype
+
+config:
+ cd $KERNEL32;make config CONFIG_FLAGS=-A$KERNEL32
+ cd $KERNEL64;make config CONFIG_FLAGS="-A$KERNEL64 -K"
+
+THE_END_IS_NEAR
+
+else # Do just the 32bit kernel
+
+cat > Makefile <<THE_END_IS_NEAR
+# Autogenerated file - do not edit
+
+all: $KERNEL32/kernel/framework/include/buildid.h subdirs build
+
+install: all
+ rm -f prototype/kernel/drv/*.conf
+ cp -R prototype/* /
+ sync
+ soundoff
+ sync
+ soundon
+ sync
+
+subdirs:
+ cd $KERNEL32;make
+
+build:
+ sh build.sh
+
+copy: all
+ rm -f prototype/kernel/drv/*.conf
+ cp -R prototype/* /
+
+package: all
+ sh $KERNEL32/setup/SunOS/mkpkg.sh
+
+clean:
+ cd $KERNEL32;make clean
+ rm -f *.pkg
+ rm -rf prototype
+
+config:
+ cd $KERNEL32;make config CONFIG_FLAGS=-A$KERNEL32
+
+THE_END_IS_NEAR
+fi
+
+rm -f .nocopy
+
+#
+# Check if some mandatory Solaris packages have been installed
+#
+MISSING=""
+for n in SUNWgcc SUNWaudh SUNWusbu
+do
+ if pkginfo -q $n
+ then
+ OK=1
+ else
+ MISSING="$MISSING $n"
+ fi
+done
+
+if test "$MISSING " != " "
+then
+ echo
+ echo Some required Solaris packages may be missing. You can install them
+ echo by doing:
+ echo
+
+ for n in $MISSING
+ do
+ echo pkg install $n
+ done
+fi
+
+exit 0
diff --git a/setup/SunOS/svc-oss.htm b/setup/SunOS/svc-oss.htm
new file mode 100755
index 0000000..d45a124
--- /dev/null
+++ b/setup/SunOS/svc-oss.htm
@@ -0,0 +1,55 @@
+#!/sbin/sh
+#
+
+. /lib/svc/share/smf_include.sh
+
+# Generic runtime checks
+OSS_SERVICE=`echo $SMF_FMRI | sed 's/.*:\(.*\)/\1/'`
+
+if [ -z "$SMF_FMRI" ]; then
+ echo "Open Sound System service can only be started/stopped via the SMF framework"
+ exit $SMF_EXIT_ERR_NOSMF
+fi
+
+if [ -z "$OSS_SERVICE" ]; then
+ echo "Unable to parse service name from SMF FRMI $SMF_FRMI"
+ exit $SMF_EXIT_ERR_NOSMF
+fi
+
+#
+# Original script, refactored
+#
+
+if test -f /etc/oss.conf
+then
+ . /etc/oss.conf
+else
+ OSSLIBDIR=/usr/lib/oss
+fi
+
+oss_start() {
+ /usr/sbin/soundon > /dev/null 2>&1
+ # Somehow this is required overhere to prevent skipping
+ /usr/sbin/ossdevlinks
+}
+
+oss_stop() {
+ # Save mixer settings automatically if requested
+ if test -f $OSSLIBDIR/etc/userdefs && /usr/xpg4/bin/grep -q "autosave_mixer yes" $OSSLIBDIR/etc/userdefs
+ then
+ /usr/sbin/savemixer
+ fi
+}
+
+case $1 in
+'start')
+ oss_start
+ ;;
+'stop')
+ oss_stop
+ ;;
+*)
+ echo "Usage: $0 { start | stop }"
+ exit 1
+ ;;
+esac