Bug#305731: zaptel command ztcfg freezes on PowerPC causing boot failure

Tzafrir Cohen tzafrir.cohen@xorcom.com
Fri, 22 Apr 2005 07:46:09 +0300


On Fri, Apr 22, 2005 at 07:34:58AM +1200, Matthew Grant wrote:
> Package: zaptel
> Version: 2:1.0.7-1.mag.1
> Severity: critical
> Tags: patch
> Justification: breaks the whole system
> 
> ztcfg command freezes on zaptel module loads, halting boot process when
> hotplug does its boot time stuff.
> 
> Same old Makefile/compiler flags problem as before - you forgot to put the 
> double quotes around the arguments to grep!!!
> 
> Basically as same for fix for asterisk on PPC going potty when someone hangs
> up on the voicenmail!

Huh? Where is this makefile relevant at runtime?

What is technically the change?

Also: see below.

> 
> Matthew Grant
> 
> -- System Information:
> Debian Release: 3.1
>   APT prefers testing
>   APT policy: (990, 'testing'), (500, 'unstable')
> Architecture: powerpc (ppc)
> Kernel: Linux 2.6.11-pmac-2.6
> Locale: LANG=en_NZ, LC_CTYPE=en_NZ (charmap=ISO-8859-1)
> 
> Versions of packages zaptel depends on:
> ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
> ii  libnewt0.51                 0.51.6-20    Not Erik's Windowing Toolkit - tex
> 
> -- no debconf information

> --- zaptel-1.0.7/debian/patches/Makefile.dpatch	2005-04-22 07:26:26.000000000 +1200
> +++ zaptel-1.0.7-mine/debian/patches/Makefile.dpatch	2005-04-22 07:25:02.000000000 +1200
> @@ -27,7 +27,7 @@
>   CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
>  -CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
>  -CFLAGS+=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi)
> -+CFLAGS+=$(shell if echo $(UNAME_M) | grep -q ppc\|powerpc\|arm\|s390; then echo "-fsigned-char"; fi)
> ++CFLAGS+=$(shell if echo $(UNAME_M) | grep -q "ppc\|powerpc\|arm\|s390"; then echo "-fsigned-char"; fi)
>  +CFLAGS+=$(shell if echo $(UNAME_M) | grep -q x86_64; then echo "-m64"; fi)
>   LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
>  -KFLAGS+=-I/usr/src/linux-2.4/include -O6

make syntax note (regardless of the other comment):

shell is not needed here:

chkarch = $(findstring $1,$(UNAME_M))
ifeq (,$(call chkarch ppc)$(call chkarch powerpc)$(call chkarch arm)$(call chkarch s390))
  CFLAGS+=-fsigned-char
endif

Note, This will not further call $(shell) every time CFLAGS is expanded
with possible funny side effects, possibly as described in the original
mail.

Note, however, that due to the fact that UNAME_M is defined with '=' and
not with ':=', $(shell) will be called 4 times in the above ifeq to
expand that value (instead of make saving it).

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen@xorcom.com  http://www.xorcom.com