~ubuntu-branches/ubuntu/vivid/oss4/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/os_cmd.patch

  • Committer: Package Import Robot
  • Author(s): Sebastien NOEL
  • Date: 2012-11-19 11:47:24 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20121119114724-svu8mq7x3pk64nez
Tags: 4.2-build2007-1
* New upstream release.
* Acknowledge NMU, thanks Michael Gilbert.
* Add debian/patches/110_ld-as-needed.patch: Rearrange order of linker
  arguments to fix building with "ld --as-needed" (closes: #630737).
* Add missing dependency on dpkg-dev to oss4-dkms and oss4-source
  (closes: #687086).
* Fix typo in the changelog (closes: #628876, #675933)
* Add debian/patches/002_fix-linux-oss_native_word.patch (closes: #693657).
  Thanks to Ben Hutchings.
* Add debian/patches/003_linux-error-logging-fixes.patch (closes: #693657).
  Thanks to Ben Hutchings.
* check for /lib/modules/${kernelver}/build in addition of
  /lib/modules/${kernelver}/source (closes: #587191).
* oss4-dkms.dkms.in: fix 'CLEAN' rules (closes: #653374).

Show diffs side-by-side

added added

removed removed

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