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
- 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
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
(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.
Created attachment 137363 [details, diff] irda-utils-0.9.18.diff more elegant patch
Created attachment 137365 [details] Irda-utils-0.9.18.ebuild insert udev rules from SUSE
Created attachment 137367 [details] 52-irda.rules
Any updates on this one? Will a irda-utils-0.9.18-r1 version be released along with smcinit conf and init files?
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. ;-)
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.
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!
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! >
hmmm. not found them inside the tarball. I have to check it again. :-/
ahhh, this init/conf-stuff is from app-laptop/smcinit. Ok, I will try to include it.
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...
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... >
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... > > >
I'm working on improved init-scripts. I also got an old Toshoba-Notebook with smc-chip. Please gimme a few days for testing.
Ubuntu has a quite advanced IrDA-setup. Quite cool. I try to adapt it for Gentoo.
ok, almost finished. Just a few final tests. I will commit it later this day.
ok, *-r2 in CVS. Please check! Hint: smcinit & friends are configured in /etc/modprobe.d/irda.
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. >
Created attachment 146981 [details] /etc/conf.d/irda
Created attachment 146982 [details] /etc/modprobe.d/irda
Created attachment 146983 [details] /etc/modules.d/smsc_ircc2
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. > > >
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").
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
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!).
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!). >
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... ;-)
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.
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. >
wait an hour and try again. the changes are in /etc/init.d/irda
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 >
yes, just file another bug for lirc.