summaryrefslogtreecommitdiff
path: root/debian/patches/os_cmd.patch
blob: ea06852b1d2aa1bb4d67ea6a73c6e80ff26e68a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
Index: oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.c
===================================================================
--- oss4-4.2-build2004.orig/os_cmd/Linux/ossdetect/ossdetect.c
+++ oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.c
@@ -23,6 +23,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/dir.h>
+#include <grp.h>
 
 #define PCI_PASS	0
 #define USB_PASS	1
@@ -31,6 +32,7 @@
 
 #define OSSLIBDIRLEN 512
 static char *osslibdir = NULL;
+static char *groupname = "root";
 
 static int usb_ok = 0;
 
@@ -90,7 +92,7 @@
       if (l > 0 && tmp[l - 1] == '\n')
 	tmp[l - 1] = '\0';
 
-      if (strncmp (tmp, "OSSLIBDIR=", 10) == 0)
+      if (strncmp (tmp, "OSSETCDIR=", 10) == 0)
 	{
 	  l = snprintf (name, sizeof (name), "%s", &tmp[10]);
 	  if ((l >= OSSLIBDIRLEN) || (l < 0))
@@ -109,12 +111,12 @@
 	}
     }
 
-  fprintf (stderr, "OSSLIBDIR not set in /etc/oss.conf, using default "
-		   "/usr/lib/oss\n");
+  fprintf (stderr, "OSSETCDIR not set in /etc/oss.conf, using default "
+		   "/etc/oss4\n");
 oexit:
   fclose (f);
 oexit2:
-  snprintf (name, sizeof (name), "/usr/lib/oss");
+  snprintf (name, sizeof (name), "/etc/oss4");
   return name;
 }
 
@@ -503,6 +505,13 @@
   mode_t perm;
   int minor, major;
 
+  struct group *grpstruct;
+  if((grpstruct = getgrnam(groupname)) == NULL)
+    {
+      fprintf (stderr, "getgrnam() error\n");
+      exit (-1);
+    }
+
   if ((f = fopen ("/proc/opensound/devfiles", "r")) == NULL)
     {
       perror ("/proc/opensound/devfiles");
@@ -554,6 +563,8 @@
 	printf ("mknod %s c %d %d -m %o\n", dev, major, minor, node_m);
       if (mknod (dev, node_m, makedev (major, minor)) == -1)
 	perror (dev);
+
+      chown(dev, 0, grpstruct->gr_gid);
     }
 
   umask (perm);
@@ -586,7 +597,7 @@
   struct stat st;
   FILE *f;
 
-  while ((i = getopt(argc, argv, "L:a:dilm:uv")) != EOF)
+  while ((i = getopt(argc, argv, "L:a:dg:ilm:uv")) != EOF)
     switch (i)
       {
 	case 'v':
@@ -613,6 +624,10 @@
 	  do_license = 1;
 	  break;
 
+	case 'g':
+	  groupname = optarg;
+	  break;
+
 	case 'L':
 	  osslibdir = optarg;
 	  break;
@@ -648,7 +663,7 @@
       exit (0);
     }
 
-  load_devlist ("etc/devices.list", 0);
+  load_devlist ("devices.list", 0);
 
   if (stat ("/etc/oss_3rdparty", &st) != -1)
     load_devlist ("/etc/oss_3rdparty", 1);
@@ -674,7 +689,7 @@
     }
 
   snprintf (instfname, sizeof (instfname), "%s/%s", osslibdir,
-	    "etc/installed_drivers");
+	    "installed_drivers");
  
   if ((f = fopen (instfname, "w")) == NULL)
     {
Index: oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.man
===================================================================
--- oss4-4.2-build2004.orig/os_cmd/Linux/ossdetect/ossdetect.man
+++ oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.man
@@ -6,9 +6,10 @@
 
 DESCRIPTION
 The ossdetect application performs automatic detection of soundcards.
-The application looks at the /usr/lib/oss/etc/device.list and performs
+The application looks at the $OSSETCDIR/device.list and performs
 automatic detection. It will create a file with the list of the configured
-drivers in /usr/lib/oss/etc/installed_drivers.
+drivers in $OSSETCDIR/installed_drivers.
+OSSETCDIR is decided by reading /etc/oss.conf, and defaults to /etc/oss4.
 
 The Input Multiplexer driver (IMUX) is not configured by default and
 can be added to the OSS configuration using the -i option.
@@ -17,6 +18,7 @@
 -d		Create device file links.
 -i	 	Adds the oss_imux driver.
 -m<mode>	Create nodes with permissions set to octal <mode>.
+-g<group>	Create nodes with group ownership set to <group>.
 -u		Adds the oss_userdev driver.
 -v		Verbose output.
 -L<path>	Use <path> as root directory for OSS files.
@@ -26,6 +28,7 @@
 ossdevlinks(1), ossinfo(1)
 
 FILES
+/etc/oss.conf
 /usr/sbin/ossdetect
 
 AUTHOR