Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 200295 - net-wireless/irda-utils-0.9.18 - multiple issues
Summary: net-wireless/irda-utils-0.9.18 - multiple issues
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 200808
  Show dependency tree
 
Reported: 2007-11-25 16:31 UTC by Cyberjun
Modified: 2008-03-24 10:31 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
irda-utils-0.9.18.ebuild.diff (irda-utils-0.9.18.ebuild.diff,1.72 KB, patch)
2007-11-25 17:35 UTC, Jakub Moc (RETIRED)
Details | Diff
irda-utils-0.9.18.diff (irda.diff,1.43 KB, patch)
2007-11-30 05:19 UTC, INODE64 Sistemas
Details | Diff
Irda-utils-0.9.18.ebuild (irda.diff,1.59 KB, text/plain)
2007-11-30 05:24 UTC, INODE64 Sistemas
Details
52-irda.rules (52-irda.rules,268 bytes, text/plain)
2007-11-30 05:25 UTC, INODE64 Sistemas
Details
irda.sh (udev-script for attaching usb-irda dongles) (irda.sh,573 bytes, text/plain)
2008-03-06 20:19 UTC, Stefan Briesenick (RETIRED)
Details
/etc/conf.d/irda (irda,1.05 KB, text/plain)
2008-03-23 05:22 UTC, Cyberjun
Details
/etc/modprobe.d/irda (irda,1.90 KB, text/plain)
2008-03-23 05:24 UTC, Cyberjun
Details
/etc/modules.d/smsc_ircc2 (smsc_ircc2,218 bytes, text/plain)
2008-03-23 05:25 UTC, Cyberjun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cyberjun 2007-11-25 16:31:20 UTC
The latest ~x86 version of the irda-utils package fails to compile smcinit binary. Still the emerge process completes successfully. Since app-laptop/smcinit has been marked for removal (bug # 194859), this is worrisome. 

Reproducible: Always

Steps to Reproduce:
1. emerge =irda-utils-0.9.18
2. smcinit fails to compile
3.

Actual Results:  
The smcinit fails to compile withh error:
........<snip>.........
 [CC]  irdadump
 [CC]  smcinit.c
 [CC]  smcinit
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `pci_load_name_list':
(.text+0x533): undefined reference to `gzopen'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `pci_load_name_list':
(.text+0x5cd): undefined reference to `gzgets'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `.L154':
(.text+0x6d3): undefined reference to `gzclose'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `.L154':
(.text+0x6f8): undefined reference to `gzeof'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `.L154':
(.text+0x788): undefined reference to `gzclose'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `.L154':
(.text+0xb9c): undefined reference to `gzopen'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `.L155':
(.text+0xd33): undefined reference to `gzerror'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpci.a(names.o): In function `.L155':
(.text+0xd53): undefined reference to `gzclose'
collect2: ld returned 1 exit status
make[1]: *** [smcinit] Error 1
make: [all] Error 2 (ignored)
>>> Source compiled.


Expected Results:  
The smcinit binary should be compiled and installed successfully

emerge --info
Portage 2.1.3.19 (default-linux/x86/2006.1/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-suspend2-r2 i686)
=================================================================
System uname: 2.6.22-suspend2-r2 i686 Intel(R) Pentium(R) M processor 1700MHz
Timestamp of tree: Sun, 25 Nov 2007 06:00:03 +0000
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium-m -pipe"
DISTDIR="/var/portage/distfiles"
FEATURES="collision-protect distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/var/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--progress"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/var/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 acl acpi alsa asf avi berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups curl dbus directfb dri dts dvd dvdr dvdread emboss encode esd exif fam fbcon firefox flac ftp gdbm gif gnome gpm gstreamer gtk gtk2 hal iconv idn ieee1394 isdnlog java jpeg lcms ldap lirc mad midi mikmod mmx mmxext mng mp3 mpeg mudflap ncurses nls nptl nptlonly nsplugin nvidia ogg oggvorbis opengl openmp pam pcmcia pcre perl png ppds pppd python quicktime readline real reflection samba sdl session spell spl sse sse2 ssl tcpd theora tiff truetype truetype-fonts type1-fonts usb vcd video4linux vorbis win32codecs wmf x86 xine xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-11-25 16:40:15 UTC
- missing sys-apps/pciutils dependency
- fails when sys-apps/pciutils is compiled w/ USE=zlib
- this completely ignored CFLAGS
- crosscompile fails as well, as it calls gcc/ld directly

Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-11-25 17:35:10 UTC
Created attachment 136993 [details, diff]
irda-utils-0.9.18.ebuild.diff

Please test this. Fixes the above mentioned issues, removes redundant sed dependency (part of system) plus the following QA notice:

 * QA Notice: Package has poor programming practices which may compile
 *            fine but exhibit random runtime failures.
 * irpsion5.c:467: warning: dereferencing type-punned pointer will break strict-aliasing rules
Comment 3 Cyberjun 2007-11-26 11:42:14 UTC
(In reply to comment #2)
The new ebuild works fine on my arch (x86). It doesn't however install the conf and init files for smcinit (as app-laptop/smcinit currently does).
Before removing app-laptop/smcinit I hope the config files will also be moved into the irda-utils package. 

Thanks for the prompt response.
Comment 4 INODE64 Sistemas 2007-11-30 05:19:00 UTC
Created attachment 137363 [details, diff]
irda-utils-0.9.18.diff

more elegant patch
Comment 5 INODE64 Sistemas 2007-11-30 05:24:58 UTC
Created attachment 137365 [details]
Irda-utils-0.9.18.ebuild

insert udev rules from SUSE
Comment 6 INODE64 Sistemas 2007-11-30 05:25:21 UTC
Created attachment 137367 [details]
52-irda.rules
Comment 7 Cyberjun 2008-03-04 13:21:49 UTC
Any updates on this one? Will a irda-utils-0.9.18-r1 version be released along with smcinit conf and init files?

Comment 8 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-06 20:15:06 UTC
irda-rules are NOT good for USB-style IRDA, because the init-script is not really thought out for this. ;-)

I made a better appoach for myself long time ago. I will try to bring in my ideas...

first of all my udev-rule:

KERNEL=="irda[0-9]*", RUN+="/lib/udev/irda.sh"

but this is based on an older udev-relase, so maybe it should adapted to your new rule.

I will attach "irda.sh" asap. stay tuned. That's the most important part. ;-)
Comment 9 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-06 20:19:39 UTC
Created attachment 145434 [details]
irda.sh (udev-script for attaching usb-irda dongles)

this script attaches the new irda-interface. the corresponding "irattach" will be killed when dongle is unplugged. It only takes care of usb-dongles. All other types are ignored.
Comment 10 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-06 21:20:08 UTC
ok, added all patches to CVS. hope it works for all of you. At least, it works for me. ;-)

Wasn't my package, but I needed it also. And this bug was 4 months old. So I've taken the chance... But please, mobile heard, clean it up. There're some old and obsolete versions which should be removed. Thanks!

Comment 11 Cyberjun 2008-03-10 03:51:05 UTC
The build compiles fine for me as well. Why are the /etc/conf.d/smcinit and /etc/init.d/smcinit files not included in the package? I need separate startup script for smcinit, since I have to initialize the chip for gnokii (without irda).

(In reply to comment #10)
> ok, added all patches to CVS. hope it works for all of you. At least, it works
> for me. ;-)
> 
> Wasn't my package, but I needed it also. And this bug was 4 months old. So I've
> taken the chance... But please, mobile heard, clean it up. There're some old
> and obsolete versions which should be removed. Thanks!
> 

Comment 12 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-17 21:12:00 UTC
hmmm. not found them inside the tarball. I have to check it again. :-/
Comment 13 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-18 00:14:25 UTC
ahhh, this init/conf-stuff is from app-laptop/smcinit.
Ok, I will try to include it.
Comment 14 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-18 00:24:02 UTC
well, it doesn't make sense to have 2 init-scripts for non-usb-irda. we should merge them into one.

@Cyberjun: can you explain how you setup your dongle?

I don't have this kind of hardware...
Comment 15 Cyberjun 2008-03-18 02:13:35 UTC
hi,
         Thanks for having a look at this bug.
I have a Toshiba Satellite M30 laptop. I have to run smcinit with certain arguments to initialize my chip. Without it no irda communication would work. 

I also use lirc on my machine. It needs access to the irda chip but without smsc-ircc2 module being loaded (smsc-ircc2 is loaded by irda).

Hence at a given time either lirc would work or irda. Not both. However to work with any of them I have to execute smcinit (atleast once after a reboot).

So separate smcinit conf.d and init.d scripts are needed in my case. If you club them with irda, I will be forced to write new scripts for lirc.

I hope my explanation is clear :) 

(In reply to comment #14)
> well, it doesn't make sense to have 2 init-scripts for non-usb-irda. we should
> merge them into one.
> 
> @Cyberjun: can you explain how you setup your dongle?
> 
> I don't have this kind of hardware...
> 

Comment 16 Cyberjun 2008-03-18 02:20:26 UTC
Well. I think you can merge them. I just had a look at my startup scripts. I have already included a call to smcint in /etc/init.d/lircd. So I think if you merge /etc/init.d/smcinit with irda's scripts, it would be ok. Since not all people need smcinit, you can put a configuration setting in the conf.d/irda file for smcinit. 

So the startup script for irda would look in conf.d/irda and if it finds settings for smcinit, it would execute smcinit with the specified arguments and then the regular irda stuff.

cheers!

(In reply to comment #15)
> hi,
>          Thanks for having a look at this bug.
> I have a Toshiba Satellite M30 laptop. I have to run smcinit with certain
> arguments to initialize my chip. Without it no irda communication would work. 
> 
> I also use lirc on my machine. It needs access to the irda chip but without
> smsc-ircc2 module being loaded (smsc-ircc2 is loaded by irda).
> 
> Hence at a given time either lirc would work or irda. Not both. However to work
> with any of them I have to execute smcinit (atleast once after a reboot).
> 
> So separate smcinit conf.d and init.d scripts are needed in my case. If you
> club them with irda, I will be forced to write new scripts for lirc.
> 
> I hope my explanation is clear :) 
> 
> (In reply to comment #14)
> > well, it doesn't make sense to have 2 init-scripts for non-usb-irda. we should
> > merge them into one.
> > 
> > @Cyberjun: can you explain how you setup your dongle?
> > 
> > I don't have this kind of hardware...
> > 
> 

Comment 17 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-21 13:34:58 UTC
I'm working on improved init-scripts. I also got an old Toshoba-Notebook with smc-chip. Please gimme a few days for testing.
Comment 18 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-21 15:16:18 UTC
Ubuntu has a quite advanced IrDA-setup. Quite cool. I try to adapt it for Gentoo.
Comment 19 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-22 11:42:49 UTC
ok, almost finished. Just a few final tests. I will commit it later this day.
Comment 20 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-22 18:37:07 UTC
ok, *-r2 in CVS. Please check!

Hint: smcinit & friends are configured in /etc/modprobe.d/irda.
Comment 21 Cyberjun 2008-03-23 03:45:38 UTC
I can see settings for smsc-ircc2 module both in /etc/modules.d/smsc-ircc2 and /etc/modprobe.d/irda. Which of the settings will be really used?

(In reply to comment #20)
> ok, *-r2 in CVS. Please check!
> 
> Hint: smcinit & friends are configured in /etc/modprobe.d/irda.
> 

Comment 22 Cyberjun 2008-03-23 05:22:40 UTC
Created attachment 146981 [details]
/etc/conf.d/irda
Comment 23 Cyberjun 2008-03-23 05:24:35 UTC
Created attachment 146982 [details]
/etc/modprobe.d/irda
Comment 24 Cyberjun 2008-03-23 05:25:09 UTC
Created attachment 146983 [details]
/etc/modules.d/smsc_ircc2
Comment 25 Cyberjun 2008-03-23 05:28:07 UTC
When I run /etc/init.d/irda start, it doesn't load smsc-ircc2 kernel module. I have attached my /etc/conf.d/irda, /etc/modprobe.d/irda and /etc/modules.d/smsc_ircc2 files.

Please advise

(In reply to comment #21)
> I can see settings for smsc-ircc2 module both in /etc/modules.d/smsc-ircc2 and
> /etc/modprobe.d/irda. Which of the settings will be really used?
> 
> (In reply to comment #20)
> > ok, *-r2 in CVS. Please check!
> > 
> > Hint: smcinit & friends are configured in /etc/modprobe.d/irda.
> > 
> 

Comment 26 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-23 14:16:26 UTC
you have to edit /etc/modprobe.d/irda:

# SMC driver
alias irda0 smsc-ircc2
#options smsc-ircc2 ircc_dma=1 ircc_irq=10 ircc_fir=0x0130 ircc_sir=0x02f8

# Some laptops (Toshiba Satellites and others with SMCS LPC47N227) require
# running smcinit to initialize the irda device prior to use. If your device
# is one of them, uncomment the required SMC-IRCC initializer.
#install smsc-ircc2 /usr/sbin/smcinit && /sbin/modprobe -i smsc-ircc2
#install smsc-ircc2 /usr/sbin/tosh1800-smcinit && /sbin/modprobe -i smsc-ircc2
#install smsc-ircc2 /usr/sbin/tosh2450-smcinit && /sbin/modprobe -i smsc-ircc2

you have to uncomment the "alias irda0 smsc-ircc2" part. irattach modprobe "irda0" (if DEVICE="irda0").
Comment 27 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-23 14:19:11 UTC
and btw: copy over your values from /etc/modules.d/smsc_ircc2 to /etc/modprobe.d/irda and remove /etc/modules.d/smsc_ircc2 afterwards.

finally: run update-modules
Comment 28 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-23 14:23:13 UTC
oh, well, there's also the LOAD_MODULES= entry in /etc/conf.d/irda, where you can add further modules (i.e. "smsc_ircc2", but the "alias irda0 smsc_ircc2" method is preferred!).
Comment 29 Cyberjun 2008-03-23 14:34:46 UTC
Superb! It works. However, when I stop the irda service, the modules don't get unloaded. Under normal circumstances it is not a problem. However, for using lirc, I need to rmmod smsc_ircc2|ircomm-tty|ircomm|irda.

Since lirc needs lirc-sir module to work on the same irda chip and smsc-ircc2 is already controlling the chip, modprobe lirc-sir fails.

I think we should add/remove modules when the irda script starts. I have modified /etc/init.d/lircd script to add/remove modules (lirc-sir and lirc-dev). 

Is there any other solution?


(In reply to comment #28)
> oh, well, there's also the LOAD_MODULES= entry in /etc/conf.d/irda, where you
> can add further modules (i.e. "smsc_ircc2", but the "alias irda0 smsc_ircc2"
> method is preferred!).
> 

Comment 30 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-23 15:12:37 UTC
hmmm. The only thing practical in a multi-irda-device environment (i.e. with additional IrDA-USB devices) is to remove the configured $DEVICE if it is irda*.

something like this in stop():

case "${DEVICE]" in
    irda[0-9]*) modprobe -sqr ${DEVICE}
    /dev/ttyS*) modprobe -sqr irtty-sir
esac

I think, this is a good idea. I will add this... ;-)
Comment 31 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-23 16:03:57 UTC
ok, added driver removal in stop(). I don't remove the other general irda-modules though. But this shouldn't be a problem. Only the specific SIR/FIR driver is locking your device. As soon it is detached from the IrDA stack, your device is free for other uses. Please check!

btw: no new revision. Just sync and emerge again.
Comment 32 Cyberjun 2008-03-23 16:52:46 UTC
Well I sync'd and emerged irda-utils. However I cannot see any changes in the stop() function.

(In reply to comment #31)
> ok, added driver removal in stop(). I don't remove the other general
> irda-modules though. But this shouldn't be a problem. Only the specific SIR/FIR
> driver is locking your device. As soon it is detached from the IrDA stack, your
> device is free for other uses. Please check!
> 
> btw: no new revision. Just sync and emerge again.
> 

Comment 33 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-23 17:01:45 UTC
wait an hour and try again.

the changes are in /etc/init.d/irda
Comment 34 Cyberjun 2008-03-24 01:58:03 UTC
Wow! Finally everything seems to be in place. I checked running lircd and irda alternately twice. Each works after stopping the other.

Thanks!

Do you think I should log a bug with lircd so that similar logic of removing the modules is applied there as well? At the moment I have it working by customizing the /etc/init.d/lircd file.

(In reply to comment #33)
> wait an hour and try again.
> 
> the changes are in /etc/init.d/irda
> 

Comment 35 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-24 10:31:45 UTC
yes, just file another bug for lirc.