[Pkg-oss4-maintainers] Bug#696751: Problems with building oss4 package

Klaus Ethgen Klaus at Ethgen.ch
Sun Apr 27 12:45:55 UTC 2014


I do not use dkms as I always want the kernel and the modules prebuild.
However, I got to the same problems than the original reporter.

I will attach a patch to apply to oss that will fix most bugs (the last
has to be done manually, see below).

There are several bugs with oss4 and kernel. It seems that the kernal
boys like to change APIs as others changes there socks.

First there is the original problem here. You can solve that if you link
the limits.h header manually in the right place:
   ln -s uapi/linux/limits.h /usr/src/linux-headers-3.13-1-common/include/limits.h

This was easy, wasn't it? ;-) Well I do not know about the objection
behind the incompatible moving of header files but however.

The next are several incompatible changes in API of the kernel.
Naturally oss4 as every external module is always behind the kernel as
they do not communicate the changes before. (At least I did not find
proper documentations apart from reading git diffs.) All this problems
will be fixed by the attached patch that fixes all problems up to
3.13.any. I did collect the solutions from some pages and did some
myself as the changes are not that big.

Regards
   Klaus
-- 
Klaus Ethgen                              http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16   Klaus Ethgen <Klaus at Ethgen.de>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C
-------------- next part --------------
diff -Nur modules/oss4.orig/core/oss_core.c modules/oss4/core/oss_core.c
--- modules/oss4.orig/core/oss_core.c	2013-12-03 16:33:28.000000000 +0100
+++ modules/oss4/core/oss_core.c	2014-04-27 13:20:36.838973404 +0100
@@ -276,13 +276,21 @@
   return strlen (tmp);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 static struct file_operations oss_proc_operations = {
   .read = oss_read_devfiles,
 };
+#else
+static struct file_operations fops = {
+  .owner = THIS_MODULE,
+  .read = oss_read_devfiles,
+};
+#endif
 
 static void
 init_proc_fs (void)
 {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
   if ((oss_proc_root =
        create_proc_entry ("opensound", 0700 | S_IFDIR, NULL)) == NULL)
     {
@@ -298,6 +306,21 @@
     }
 
   oss_proc_devfiles->proc_fops = &oss_proc_operations;
+#else
+  if ((oss_proc_root =
+       proc_mkdir ("opensound", NULL)) == NULL)
+    {
+      oss_cmn_err (CE_CONT, "Cannot create /proc/opensound\n");
+      return;
+    }
+
+  if ((oss_proc_devfiles =
+       proc_create ("devfiles", 0600, oss_proc_root, &fops)) == NULL)
+    {
+      oss_cmn_err (CE_CONT, "Cannot create /proc/opensound/devfiles\n");
+      return;
+    }
+#endif
 }
 
 static void
@@ -436,11 +459,15 @@
 int
 oss_get_uid (void)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
+   return __kuid_val(current->cred->uid);
+#else
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
   return current->cred->uid;
 #else
   return current->uid;
 #endif
+#endif
 }
 
 typedef struct tmout_desc
@@ -934,7 +961,9 @@
   fop->llseek = oss_no_llseek;
   fop->read = tmp_read;
   fop->write = tmp_write;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
   fop->readdir = NULL;		/* tmp_readdir; */
+#endif
   fop->poll = tmp_poll;
 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)
   fop->ioctl = tmp_ioctl;
diff -Nur modules/oss4.orig/drivers/pci_wrapper.inc modules/oss4/drivers/pci_wrapper.inc
--- modules/oss4.orig/drivers/pci_wrapper.inc	2013-12-03 16:33:28.000000000 +0100
+++ modules/oss4/drivers/pci_wrapper.inc	2014-04-27 13:08:11.235276155 +0100
@@ -17,7 +17,11 @@
 static dev_map_t dev_map[MAX_INSTANCE];
 static int n_devmap = 0;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
 static int __devinit
+#else
+static int
+#endif
 osspci_probe (struct pci_dev *pcidev, const struct pci_device_id *pciid)
 {
   oss_device_t *osdev;
@@ -65,7 +69,11 @@
   return 0;
 }
 
-static void __devexit
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
+static int __devexit
+#else
+static int
+#endif
 osspci_remove (struct pci_dev *pcidev)
 {
   int i;
@@ -80,10 +88,11 @@
 	pci_disable_device (dev_map[i].pcidev);
 	osdev_delete (osdev);
 
-	return;
+	return 0;
       }
 
   printk (KERN_ALERT DRIVER_NICK ": Can't find the PCI device to detach\n");
+  return -EIO;
 }
 
 void
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-oss4-maintainers/attachments/20140427/08b6b902/attachment.sig>


More information about the Pkg-oss4-maintainers mailing list