From 464e01bf8cca2d746a35ab3503d1b385d144156c Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Wed, 12 Oct 2011 16:35:16 -0700 Subject: [PATCH] Upgraded the libusb, usbutils Portage packages Upgraded dev-libs/libusb to version 1.0.8 on arm, x86 Upgraded sys-apps/usbutils to version 001 on arm, x86 usbutils was the last user of libusb-0.1.x, now everything should use libusb-1.x API and we can remove the former. BUG=chromium-os:21264 chromium-os:21265 TEST=./run_remote_tests.sh --board=x86-alex hardware_USB20 ./lab_test.py --board=x86-alex --platforms=netbook_ALEX,netbook_ALEX_CDMA_GOBI3K suite_Smoke manually inspect lsusb output Change-Id: I2ff9be2add7b43cdbcf535b1a6441efdd9a5c4b0 Reviewed-on: http://gerrit.chromium.org/gerrit/10020 Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin Reviewed-by: Matt Tennant Reviewed-by: Jason Glasgow --- .../dev-libs/libusb/libusb-1.0.8.ebuild | 45 +++++++++++++++ .../sys-apps/usbutils/files/usbmodules.sh | 55 +++++++++++++++++++ .../sys-apps/usbutils/files/usbutils.cron | 2 + .../sys-apps/usbutils/usbutils-001.ebuild | 37 +++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.8.ebuild create mode 100755 sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbmodules.sh create mode 100755 sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbutils.cron create mode 100644 sdk_container/src/third_party/portage-stable/sys-apps/usbutils/usbutils-001.ebuild diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.8.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.8.ebuild new file mode 100644 index 0000000000..51b4508d60 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.8.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libusb/libusb-1.0.8.ebuild,v 1.11 2011/09/28 13:03:27 ssuominen Exp $ + +EAPI="2" + +DESCRIPTION="Userspace access to USB devices" +HOMEPAGE="http://libusb.org/" +SRC_URI="mirror://sourceforge/libusb/${P}.tar.bz2" +LICENSE="LGPL-2.1" +SLOT="1" +KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 -x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="debug doc static-libs" + +DEPEND="doc? ( app-doc/doxygen )" +RDEPEND="" + +src_configure() { + econf \ + $(use_enable static-libs static) \ + $(use_enable debug debug-log) +} + +src_compile() { + default + + if use doc ; then + cd doc + emake docs || die "making docs failed" + fi +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + dodoc AUTHORS ChangeLog NEWS PORTING README THANKS TODO + + if use doc ; then + insinto /usr/share/doc/${PF}/examples + doins examples/*.c + + dohtml doc/html/* + fi + + rm -f "${D}"/usr/lib*/libusb*.la +} diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbmodules.sh b/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbmodules.sh new file mode 100755 index 0000000000..dfd89b7f30 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbmodules.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +usage() { + cat <<-EOF + List relevant kernel modules for USB devices currently plugged in. The + module list is taken from the modules installed in /lib/modules//. + + Usage: usbmodules [options] [kernel version] + + Options: + -m, --map Specify usbmap (default: /lib/modules//modules.usbmap) + -h, --help This help screen + EOF + if [ -n "$*" ] ; then + echo + echo "Error: $*" 1>&2 + exit 1 + else + exit 0 + fi +} + +map="" + +while [ -n "$1" ] ; do + case $1 in + -m|--map) map=$2; shift;; + -h|--help) usage;; + --) break;; + -*) usage "unknown option '$1'";; + *) break;; + esac + shift +done + +ver=${1:-$(uname -r)} +map=${map:-/lib/modules/${ver}/modules.usbmap} + +for dev in $(lsusb | awk '{print $6}') ; do + [ "${dev}" = "0000:0000" ] && continue + + IFS=: + set -- ${dev} + vendor=$1 + product=$2 + unset IFS + + awk \ + -v vendor="0x${vendor}" \ + -v product="0x${product}" \ + 'vendor == $3 && product == $4 {print $1}' \ + ${map} +done + +exit 0 diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbutils.cron b/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbutils.cron new file mode 100755 index 0000000000..1018546d18 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/files/usbutils.cron @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/sbin/update-usbids -q diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/usbutils-001.ebuild b/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/usbutils-001.ebuild new file mode 100644 index 0000000000..77a8096bc9 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/usbutils/usbutils-001.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/usbutils/usbutils-001.ebuild,v 1.10 2011/08/24 17:35:46 radhermit Exp $ + +EAPI="2" + +DESCRIPTION="USB enumeration utilities" +HOMEPAGE="http://linux-usb.sourceforge.net/" +SRC_URI="mirror://kernel/linux/utils/usb/usbutils/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd" +IUSE="network-cron zlib" + +RDEPEND="virtual/libusb:1 + zlib? ( sys-libs/zlib )" +DEPEND="${RDEPEND} + dev-util/pkgconfig" + +src_configure() { + econf \ + --datarootdir=/usr/share \ + --datadir=/usr/share/misc \ + $(use_enable zlib) +} + +src_install() { + emake DESTDIR="${D}" install || die + mv "${D}"/usr/sbin/update-usbids{.sh,} || die + newbin "${FILESDIR}"/usbmodules.sh usbmodules || die + dodoc AUTHORS ChangeLog NEWS README + + use network-cron || return 0 + exeinto /etc/cron.monthly + newexe "${FILESDIR}"/usbutils.cron update-usbids || die +}