From patchwork Mon Jan 29 04:19:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 867016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zVGWG0RZNz9s7n for ; Mon, 29 Jan 2018 15:19:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B256F84C4E; Mon, 29 Jan 2018 04:19:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0wm9-TRFA_1T; Mon, 29 Jan 2018 04:19:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id BC4B584C5F; Mon, 29 Jan 2018 04:19:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id C65E81C2CBE for ; Mon, 29 Jan 2018 04:19:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C2908822FE for ; Mon, 29 Jan 2018 04:19:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S7vXCedan2VI for ; Mon, 29 Jan 2018 04:19:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by hemlock.osuosl.org (Postfix) with ESMTPS id EFAC98228B for ; Mon, 29 Jan 2018 04:19:43 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 5099C16F008B; Mon, 29 Jan 2018 02:19:29 -0200 (-02) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id 3FB8616F0089; Mon, 29 Jan 2018 02:19:29 -0200 (-02) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id gvtSzPNJZAne; Mon, 29 Jan 2018 02:19:29 -0200 (-02) Received: from p7-1130br.casantos.org (unknown [187.113.206.240]) by mail.datacom.ind.br (Postfix) with ESMTPSA id DAE6316F0088; Mon, 29 Jan 2018 02:19:28 -0200 (-02) From: Carlos Santos To: buildroot@buildroot.org Date: Mon, 29 Jan 2018 02:19:31 -0200 Message-Id: <20180129041931.28192-1-casantos@datacom.ind.br> X-Mailer: git-send-email 2.14.3 Subject: [Buildroot] [PATCH] eudev: generate /etc/udev/hwdb.bin at system startup X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bernd Kuhls , Eric Le Bihan MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Programs that use libudev (e.g. lsusb, from usbutils) need the hwdb.bin file to work properly. If BR2_PACKAGE_EUDEV_ENABLE_HWDB is selected then the eudev installation populates /etc/udev/hwdb.d/ but does not genarete /etc/udev/hwdb.bin. It must be created running "udevadm hwdb --update" on the target device. Signed-off-by: Carlos Santos --- package/eudev/S10udev | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/package/eudev/S10udev b/package/eudev/S10udev index 8382bec2bb..5c25e51317 100755 --- a/package/eudev/S10udev +++ b/package/eudev/S10udev @@ -25,14 +25,22 @@ UDEV_CONFIG=/etc/udev/udev.conf test -r $UDEV_CONFIG || exit 6 . $UDEV_CONFIG +UDEV_HWDB_BIN=/etc/udev/hwdb.bin +UDEV_HWDB_D=/etc/udev/hwdb.d + case "$1" in start) printf "Populating ${udev_root:-/dev} using udev: " printf '\000\000\000\000' > /proc/sys/kernel/hotplug - $UDEV_BIN -d || (echo "FAIL" && exit 1) + $UDEV_BIN -d || { echo "FAIL" && exit 1; } udevadm trigger --type=subsystems --action=add udevadm trigger --type=devices --action=add - udevadm settle --timeout=30 || echo "udevadm settle failed" + udevadm settle --timeout=30 || { echo "udevadm settle failed" && exit 1; } + [ -d "$UDEV_HWDB_D" ] && { + echo "done" + printf "Compiling hardware database information $UDEV_HWDB_BIN: " + udevadm hwdb --update || { echo "FAIL" && exit 1; } + } echo "done" ;; stop)