Bug#651780: fixed in sl-modem 2.9.11~20110321-5

2011-12-16 Thread Ahmed El-Mahmoudy
On Wed, Dec 14, 2011 at 03:10:09PM +, Ben Hutchings wrote:
 On Wed, 2011-12-14 at 14:34 +0200, أحمد المحمودي (Ahmed
 El-Mahmoudy) wrote:
  On Wed, Dec 14, 2011 at 04:31:24AM +, Ben Hutchings wrote:
   Sorry, no it isn't.  You have to test for CONFIG_X86_32 inside of
   Kbuild, and you can't use uname for this anywhere.
  
  Can you further explain this please ?
 
 1. You run 'make' in the drivers directory.
 2. This invokes the kernel build system (Kbuild).
 3. Kbuild includes the Makefile from the drivers directory again.
 
 Steps 1 and 3 can be distinguished by whether KERNELRELEASE is defined.
 At step 3, CONFIG_X86_32 is defined or not, as appropriate.  At step 1,
 you can't tell.  Testing uname is no good because that tells you about
 the host kernel and not the target kernel.
 
 Well, you could include $(KERNEL_DIR)/.config at step 1.

Ok, the reason I did the patch this way is that CONFIG_X86_32 was only 
defined on kernel = 2.6.14, so I needed a way to detect the target 
kernel for kernel  2.6.14, that is in order to create a patch suitable 
for upstream.

   Really, the Makefile needs a thorough cleanup.
  
  Actually, I don't want to remove the 2.4.x kernel support.
 
 Whyever not?

  Well, I'm not sure if upstream will accept a patch that removes 2.4.x 
  kernel support, and if upstream doesn't accept it, I'm not willing to 
  maintain such a patch.

 Well the USB driver ought to work on any architecture, right?

  Maybe. But as far as I know, the sl-modem-daemon package (which is 
  what will make use of the driver) would only work on x86 archs because 
  of the binary blob:

  modem/dsplibs.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), 
not stripped


-- 
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8  B176 BC19 6A94 EDDD A1B7


signature.asc
Description: Digital signature


Bug#651780: fixed in sl-modem 2.9.11~20110321-5

2011-12-16 Thread Ben Hutchings
On Sat, 2011-12-17 at 06:52 +0200, أحمد المحمودي (Ahmed
El-Mahmoudy) wrote:
 On Wed, Dec 14, 2011 at 03:10:09PM +, Ben Hutchings wrote:
  On Wed, 2011-12-14 at 14:34 +0200, أحمد المحمودي (Ahmed
  El-Mahmoudy) wrote:
   On Wed, Dec 14, 2011 at 04:31:24AM +, Ben Hutchings wrote:
Sorry, no it isn't.  You have to test for CONFIG_X86_32 inside of
Kbuild, and you can't use uname for this anywhere.
   
   Can you further explain this please ?
  
  1. You run 'make' in the drivers directory.
  2. This invokes the kernel build system (Kbuild).
  3. Kbuild includes the Makefile from the drivers directory again.
  
  Steps 1 and 3 can be distinguished by whether KERNELRELEASE is defined.
  At step 3, CONFIG_X86_32 is defined or not, as appropriate.  At step 1,
  you can't tell.  Testing uname is no good because that tells you about
  the host kernel and not the target kernel.
  
  Well, you could include $(KERNEL_DIR)/.config at step 1.
 
 Ok, the reason I did the patch this way is that CONFIG_X86_32 was only 
 defined on kernel = 2.6.14, so I needed a way to detect the target 
 kernel for kernel  2.6.14, that is in order to create a patch suitable 
 for upstream.

Hmm, I thought it was older than that.  (At work, I look after a module
that gets backported as far as 2.6.9 - but no further.)

Really, the Makefile needs a thorough cleanup.
   
   Actually, I don't want to remove the 2.4.x kernel support.
  
  Whyever not?
 
   Well, I'm not sure if upstream will accept a patch that removes 2.4.x 
   kernel support, and if upstream doesn't accept it, I'm not willing to 
   maintain such a patch.

Oh well, you wouldn't be the first maintainer with a crazy upstream.

  Well the USB driver ought to work on any architecture, right?
 
   Maybe. But as far as I know, the sl-modem-daemon package (which is 
   what will make use of the driver) would only work on x86 archs because 
   of the binary blob:
 
   modem/dsplibs.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), 
 not stripped

Sorry, I didn't see that dependency.  It should have been obvious there
was still a blob somewhere.  But an x86_64 module and i386 daemon should
work, right?  (In fact, in theory, it should be possible to use a native
module and run the daemon in qemu-i386 on any other architecture.  But
that's a *really* marginal case.)

Ben.

-- 
Ben Hutchings
Computers are not intelligent.  They only think they are.


signature.asc
Description: This is a digitally signed message part


Bug#651780: fixed in sl-modem 2.9.11~20110321-5

2011-12-14 Thread Ahmed El-Mahmoudy
On Wed, Dec 14, 2011 at 04:31:24AM +, Ben Hutchings wrote:
 Sorry, no it isn't.  You have to test for CONFIG_X86_32 inside of
 Kbuild, and you can't use uname for this anywhere.

Can you further explain this please ?

 Really, the Makefile needs a thorough cleanup.

Actually, I don't want to remove the 2.4.x kernel support.

 Also, building for a 64-bit kernel will still fail since DKMS is
 configured to expect all 3 modules to be built. 

Actually sl-modem-source is only for i386 arch, but your dkms.conf patch 
is wonderful, I didn't know that it was possible, I have cherry-picked 
this patch already, and hence made sl-modem-source available for amd64 
arch too.

-- 
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8  B176 BC19 6A94 EDDD A1B7


signature.asc
Description: Digital signature


Bug#651780: fixed in sl-modem 2.9.11~20110321-5

2011-12-14 Thread Ben Hutchings
On Wed, 2011-12-14 at 14:34 +0200, أحمد المحمودي (Ahmed
El-Mahmoudy) wrote:
 On Wed, Dec 14, 2011 at 04:31:24AM +, Ben Hutchings wrote:
  Sorry, no it isn't.  You have to test for CONFIG_X86_32 inside of
  Kbuild, and you can't use uname for this anywhere.
 
 Can you further explain this please ?

1. You run 'make' in the drivers directory.
2. This invokes the kernel build system (Kbuild).
3. Kbuild includes the Makefile from the drivers directory again.

Steps 1 and 3 can be distinguished by whether KERNELRELEASE is defined.
At step 3, CONFIG_X86_32 is defined or not, as appropriate.  At step 1,
you can't tell.  Testing uname is no good because that tells you about
the host kernel and not the target kernel.

Well, you could include $(KERNEL_DIR)/.config at step 1.

  Really, the Makefile needs a thorough cleanup.
 
 Actually, I don't want to remove the 2.4.x kernel support.

Whyever not?

  Also, building for a 64-bit kernel will still fail since DKMS is
  configured to expect all 3 modules to be built. 
 
 Actually sl-modem-source is only for i386 arch, but your dkms.conf patch 
 is wonderful, I didn't know that it was possible, I have cherry-picked 
 this patch already, and hence made sl-modem-source available for amd64 
 arch too.

Well the USB driver ought to work on any architecture, right?

Ben.

-- 
Ben Hutchings
Computers are not intelligent.  They only think they are.


signature.asc
Description: This is a digitally signed message part


Bug#651780: fixed in sl-modem 2.9.11~20110321-5

2011-12-13 Thread Ben Hutchings
On Tue, 2011-12-13 at 18:32 +, أحمد المحمودي (Ahmed
El-Mahmoudy) wrote:
 Source: sl-modem
 Source-Version: 2.9.11~20110321-5
 
 We believe that the bug you reported is fixed in the latest version of
 sl-modem, which is due to be installed in the Debian FTP archive:

Sorry, no it isn't.  You have to test for CONFIG_X86_32 inside of
Kbuild, and you can't use uname for this anywhere.  Really, the Makefile
needs a thorough cleanup.

Also, building for a 64-bit kernel will still fail since DKMS is
configured to expect all 3 modules to be built. 

I've attached a debdiff that seems to fix all of this.  Feel free to
reword and cherry-pick from the patches.

Ben.

-- 
Ben Hutchings
Computers are not intelligent.  They only think they are.
diff -Nru sl-modem-2.9.11~20110321/debian/changelog sl-modem-2.9.11~20110321/debian/changelog
--- sl-modem-2.9.11~20110321/debian/changelog	2011-12-13 18:22:29.0 +
+++ sl-modem-2.9.11~20110321/debian/changelog	2011-12-14 04:26:26.0 +
@@ -1,3 +1,16 @@
+sl-modem (2.9.11~20110321-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Clean up driver makefile (remove_linux-2.4.diff, simplify_kernel_ver.diff;
+replacing 01_Makefile.diff, support_linux3.diff)
+  * Remove obsolete kernel version check for USB support
+(remove_usb_kernel_ver_check.diff)
+  * Change arch64.diff to fix the architecture detection logic properly
+(Closes: #651780)
+  * Configure DKMS to install slamr.ko only on x86 32-bit kernels
+
+ -- Ben Hutchings b...@decadent.org.uk  Wed, 14 Dec 2011 03:35:34 +
+
 sl-modem (2.9.11~20110321-5) unstable; urgency=low
 
   * Added Brazilian Portuguese debconf templates translation (Closes: #648844)
diff -Nru sl-modem-2.9.11~20110321/debian/patches/01_Makefile.diff sl-modem-2.9.11~20110321/debian/patches/01_Makefile.diff
--- sl-modem-2.9.11~20110321/debian/patches/01_Makefile.diff	2011-12-13 18:22:29.0 +
+++ sl-modem-2.9.11~20110321/debian/patches/01_Makefile.diff	1970-01-01 01:00:00.0 +0100
@@ -1,57 +0,0 @@
-Cleanup to not loose the user-specified version string and blindly try include 
-modversions.h
-By: Eduard Bloch bl...@debian.org
-Index: sl-modem-2.9.11~20090222/Makefile
-===
 sl-modem-2.9.11~20090222.orig/Makefile	2008-03-29 14:04:16.0 +0200
-+++ sl-modem-2.9.11~20090222/Makefile	2009-02-26 08:37:16.0 +0200
-@@ -13,11 +13,15 @@
- #
- ###
- 
--KERNEL_DIR:=/lib/modules/$(shell uname -r)/build
-+KERNEL_DIR?=/lib/modules/$(shell uname -r)/build
- 
- # tools
- INSTALL:=install
--
-+# Definitions
-+MODULES_DIR  = /lib/modules/$(KVERS)/misc
-+MODEM_DEV   := ttySL0
-+MODEM_LINK  := modem
-+MODULES_CONF:= /etc/modules.conf
- all: modem
- 
- modem:
-Index: sl-modem-2.9.11~20090222/drivers/Makefile
-===
 sl-modem-2.9.11~20090222.orig/drivers/Makefile	2009-02-23 00:20:58.0 +0200
-+++ sl-modem-2.9.11~20090222/drivers/Makefile	2009-02-26 08:37:16.0 +0200
-@@ -45,8 +45,14 @@
- ifndef KERNELRELEASE
- ifndef KERNEL_VER
- 
-+
-+KVERS?=$(shell ./kernel-ver)
-+
-+
-+
- all install uninstall: kernel-ver
--	$(MAKE) $@ KERNEL_VER=$(shell ./kernel-ver)
-+	$(MAKE) $@ KERNEL_VER=$(KVERS)
-+#	$(MAKE) $@ KERNEL_VER=$(shell ./kernel-ver)
- 
- install: install-devices
- uninstall: remove-devices
-@@ -80,9 +86,9 @@
- 
- slusb-objs:= old_st7554.o
- obj:=.
--module-dir:=${DESTDIR}/lib/modules/$(KERNEL_VER)/misc
-+module-dir ?= ${DESTDIR}/lib/modules/$(KERNEL_VER)/misc
- 
--CFLAGS:= -Wall -pipe -O3 -fomit-frame-pointer -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -DMODVERSIONS --include $(KERNEL_DIR)/include/linux/modversions.h -I$(KERNEL_DIR)/include $(FOUND_CLASS_SIMPLE)
-+CFLAGS:= -Wall -pipe -O3 -fomit-frame-pointer -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB `test -f $(KERNEL_DIR)/include/linux/modversions.h  echo -DMODVERSIONS --include $(KERNEL_DIR)/include/linux/modversions.h -I$(KERNEL_DIR)/include` $(FOUND_CLASS_SIMPLE)
- 
- all: $(obj-m)
- 
diff -Nru sl-modem-2.9.11~20110321/debian/patches/arch64.diff sl-modem-2.9.11~20110321/debian/patches/arch64.diff
--- sl-modem-2.9.11~20110321/debian/patches/arch64.diff	2011-12-13 18:22:29.0 +
+++ sl-modem-2.9.11~20110321/debian/patches/arch64.diff	2011-12-14 03:50:30.0 +
@@ -1,18 +1,47 @@
-Description: Better arch detection logic
-Author: أحمد المحمودي (Ahmed El-Mahmoudy) aelmahmo...@sabily.org
+Description: Better arch detection logic.
+ Within Kbuild, test CONFIG_X86_32.  Outside, don't assume we can tell.
+ Use the modules_install rule to avoid needing to know.
+Author: Ben Hutchings b...@decadent.org.uk
 Bug-Debian: http://bugs.debian.org/651780
-Forwarded: yes
+
 --- a/drivers/Makefile
 +++ b/drivers/Makefile
-@@ -28,7 +28,11 @@
+@@ -25,9 +25,7 @@
  
  EXTRA_CFLAGS = -I$(obj) -I$(obj)/../modem $(FOUND_CLASS_SIMPLE)