January 2014 Archives

Sat Jan 18 06:49:39 MST 2014

SOLVED: novacom on gentoo

The problem

I tried using novacom (from the sunrise overlay) to install Cyanogenmod on a new HP Touchpad:

$ novacom boot mem:// < ACMEInstaller5E
unable to find device

/var/log/messages shows a constant stream of:

Jan 17 20:18:30 r novacomd(novacomd-119): novacom_usb_findandattach_thread:565: 
usb_handle 0x00000000, bus=001 dev=045
Jan 17 20:18:30 r novacomd(novacomd-119): novacom_usb_rx_thread:413 -- usbll(00000000) error: reading packet, result(-1), errno 9
Jan 17 20:18:30 r novacomd(novacomd-119): novacom_usb_rx_thread:434 -- usbll(00000000) reading packet, reads(2), duration(100ms), result(-1), last_errno 9
Jan 17 20:18:31 r novacomd(novacomd-119): novacom_usb_findandattach_thread:565: usb_handle 0x00000000, bus=001 dev=045
Jan 17 20:18:31 r novacomd(novacomd-119): novacom_usb_rx_thread:413 -- usbll(00000000) error: reading packet, result(-1), errno 9

The Cause

libusb incompatibility

The Solution

Build a local copy of libusb-0.1.12

Grab the following ebuild files from http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libusb/:

libusb-0.1.12-r7.ebuild
files/0.1.12-fbsd.patch
files/libusb-0.1-ansi.patch
files/libusb-0.1.12-no-infinite-bulk.patch

Save them locally into a scratch directory, preserving the directory structure. Then run:

$ ebuild libusb-0.1.12-r7.ebuild manifest
$ ebuild libusb-0.1.12-r7.ebuild compile
$ cp /var/tmp/portage/dev-libs/libusb-0.1.12-r7/work/libusb-0.1.12/.libs/libusb-0.1.so.4.4.4 /opt/palm-novacom/

Then edit /usr/sbin/novacomd (it's a shell script), adding an LD_PRELOAD line as follows:

- exec ./novacomd "$@"
+ LD_PRELOAD=libusb-0.1.so.4.4.4 exec ./novacomd "$@"

You can then /etc/init.d/novacom start and all will be well.

Acknowledgments

Thanks to James Broadhead for the novacom ebuild and for his 2012 followup note about libusb.


Posted by Ed | Permanent link | File under: Linux