From patchwork Wed Apr 13 10:40:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 609952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 3qlL1v3QRXz9snl for ; Wed, 13 Apr 2016 20:41:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=boundarydevices-com.20150623.gappssmtp.com header.i=@boundarydevices-com.20150623.gappssmtp.com header.b=c2jcfQjl; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2452292500; Wed, 13 Apr 2016 10:41:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z5UDtbdJxs2j; Wed, 13 Apr 2016 10:41:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 04942924F8; Wed, 13 Apr 2016 10:41:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 487211C10B7 for ; Wed, 13 Apr 2016 10:41:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 43C15924F8 for ; Wed, 13 Apr 2016 10:41:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rPFUDPFrmUWj for ; Wed, 13 Apr 2016 10:41:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id BF9DD924F7 for ; Wed, 13 Apr 2016 10:40:59 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id u206so69598882wme.1 for ; Wed, 13 Apr 2016 03:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=nTKlgoMcfR0y2LwOq44nP36ZW2a0VmsHXcDu2XTufFQ=; b=c2jcfQjlFhfm8sMeKhTXzOXNheP9qNHS/WAfYLdLvOzqFiz4Lw9eP2HpN+0dzus3cB 5cQh6t2yeZRT7f2F89pzup0YlYEXh0SP9waQeA9ZQjBh8HRkOZwCSKHVsmcJjebE9Sr6 7t36Luu+KFeweyZM/qviUHTDrEejwiK8UVxx5W2TQUww2OBQHWn3DtNrpl6mwcaqqYqx rwxnocX5k1kGXrH2vj0zMNRz+aKlegdJ6ucfnxBlFtSYm4WXm7DTs+i99hOIGMTDNqkN vWir5KtIrNqv4A1ypsNlxRgc09UhHnraAs3hu51mBo2dvJ6SYFpqQp9hkMSdESSAjR4p IhyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nTKlgoMcfR0y2LwOq44nP36ZW2a0VmsHXcDu2XTufFQ=; b=fLuZ4iHTpCR/jIsdFNeNkO0N+kyhqbb8P1R+C5KKYg8uV62zPXzkUT/K48enychL/C aPSUh49BwovbsygGzJ70IKA58ceaQNgRTDso85KLNwQ9Tmw6ccrQRmOxWQte9S0uxhW6 LICuX1MZ4JIrJT8d+eJnYUyUGrVdUOH/6tRWBvx5uWIIZFHb3I5TIkLc//ak4BUZ0/Ck MUz7soKcVcF7XRS+Od2GUhXWVp3VLaTbY3L3fxh3QVo+MaZAQp9tpdbMoDjrxN08Bot/ WcjKEoYEc2vYHIRcxKnXiX4vPzizfD9TZnbhYLjUivBkbmBPKXrPxx3SjjRaD7yoIOc5 0T/Q== X-Gm-Message-State: AOPr4FW8hNDkecR9fJGPdJugFgkVsDoStiJlXqS3JuwGdGmfMiaxjqLx8B5WpjV0ZNA21Q== X-Received: by 10.28.228.68 with SMTP id b65mr9528554wmh.47.1460544058307; Wed, 13 Apr 2016 03:40:58 -0700 (PDT) Received: from t450s.lan (89-92-156-188.hfc.dyn.abo.bbox.fr. [89.92.156.188]) by smtp.googlemail.com with ESMTPSA id f186sm20368455wmf.24.2016.04.13.03.40.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Apr 2016 03:40:57 -0700 (PDT) From: Gary Bisson To: buildroot@busybox.net Date: Wed, 13 Apr 2016 12:40:52 +0200 Message-Id: <1460544052-31608-1-git-send-email-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.7.0 Subject: [Buildroot] [PATCH v2] imx-uuc: add new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This package provides the Universal Adapter user-space utility that is used to receive commands from the Manufacturing Tool using the Freescale UTP Protocol. It requires a Freescale/NXP kernels whose configuration contains the CONFIG_FSL_UTP option. The /fat file is provided as a bootargs to the g_mass_storage driver from U-Boot, see: http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/include/ configs/mx6sabre_common.h?h=imx_v2015.04_3.14.52_1.1.0_ga#n116 Init scripts are provided so that the tool starts automatically at bootup. Tested on Nitrogen6_MAX + MFGTools. Signed-off-by: Gary Bisson --- Hi all, Changes v1 -> v2: - add toolchain threads dependency - add host-dosfstools selection - add init scripts to start it as a daemon - use manual install commands to control mkfs path and remove /linuxrc - change Config.in comment I have a few comments/questions on this new version: - the install process still requires to use dd, hope using the system one is ok. - I chose the init script number randomly (S80), hope it's ok. Regards, Gary --- package/freescale-imx/Config.in | 1 + package/freescale-imx/imx-uuc/Config.in | 19 +++++++++++++ package/freescale-imx/imx-uuc/S80imx-uuc | 28 +++++++++++++++++++ package/freescale-imx/imx-uuc/imx-uuc.hash | 1 + package/freescale-imx/imx-uuc/imx-uuc.mk | 40 +++++++++++++++++++++++++++ package/freescale-imx/imx-uuc/imx-uuc.service | 11 ++++++++ 6 files changed, 100 insertions(+) create mode 100644 package/freescale-imx/imx-uuc/Config.in create mode 100644 package/freescale-imx/imx-uuc/S80imx-uuc create mode 100644 package/freescale-imx/imx-uuc/imx-uuc.hash create mode 100644 package/freescale-imx/imx-uuc/imx-uuc.mk create mode 100644 package/freescale-imx/imx-uuc/imx-uuc.service diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in index 4a086ae..8c03190 100644 --- a/package/freescale-imx/Config.in +++ b/package/freescale-imx/Config.in @@ -51,6 +51,7 @@ config BR2_PACKAGE_FREESCALE_IMX_HAS_VPU source "package/freescale-imx/imx-kobs/Config.in" source "package/freescale-imx/imx-lib/Config.in" +source "package/freescale-imx/imx-uuc/Config.in" source "package/freescale-imx/imx-vpu/Config.in" source "package/freescale-imx/firmware-imx/Config.in" if (BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX51 || BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX53) diff --git a/package/freescale-imx/imx-uuc/Config.in b/package/freescale-imx/imx-uuc/Config.in new file mode 100644 index 0000000..75e4c87 --- /dev/null +++ b/package/freescale-imx/imx-uuc/Config.in @@ -0,0 +1,19 @@ +config BR2_PACKAGE_IMX_UUC + bool "imx-uuc" + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_arm # Only relevant for i.MX + select BR2_PACKAGE_HOST_DOSFSTOOLS + help + This package provides the Universal Adapter user-space utility + that is used to receive commands from the Manufacturing Tool + using the Freescale UTP Protocol. + + It requires a Freescale/NXP kernel whose configuration contains + the CONFIG_FSL_UTP option. + + This package is provided by Freescale/NXP as-is and doesn't have + an upstream. + +comment "imx-uuc needs a toolchain w/ threads" + depends on BR2_ARM + depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/freescale-imx/imx-uuc/S80imx-uuc b/package/freescale-imx/imx-uuc/S80imx-uuc new file mode 100644 index 0000000..8d6d8c1 --- /dev/null +++ b/package/freescale-imx/imx-uuc/S80imx-uuc @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME=uuc +DAEMON=/usr/bin/$NAME + +case "$1" in + start) + printf "Starting $NAME: " + start-stop-daemon -S -q -b -p /var/run/${NAME}.pid -x $DAEMON + echo "OK" + ;; + stop) + printf "Stopping $NAME: " + start-stop-daemon -K -q -p /var/run/${NAME}.pid + echo "OK" + ;; + restart|reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? + diff --git a/package/freescale-imx/imx-uuc/imx-uuc.hash b/package/freescale-imx/imx-uuc/imx-uuc.hash new file mode 100644 index 0000000..aab9ea8 --- /dev/null +++ b/package/freescale-imx/imx-uuc/imx-uuc.hash @@ -0,0 +1 @@ +sha256 95d7f7b075f58fedc07602fbc0e5bf5212d28deea3d09cdbcbd80992dcd18482 imx-uuc-0.5.1.tar.gz diff --git a/package/freescale-imx/imx-uuc/imx-uuc.mk b/package/freescale-imx/imx-uuc/imx-uuc.mk new file mode 100644 index 0000000..58e749e --- /dev/null +++ b/package/freescale-imx/imx-uuc/imx-uuc.mk @@ -0,0 +1,40 @@ +################################################################################ +# +# imx-uuc +# +################################################################################ + +IMX_UUC_VERSION = 0.5.1 +IMX_UUC_SITE = $(FREESCALE_IMX_SITE) +IMX_UUC_LICENSE = GPLv2+ +IMX_UUC_LICENSE_FILES = COPYING + +# mkfs.vfat is needed to create a FAT partition used by g_mass_storage +# so Windows do not offer to format the device when connected to the PC. +IMX_UUC_DEPENDENCIES = host-dosfstools + +define IMX_UUC_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CC=$(TARGET_CC) +endef + +define IMX_UUC_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(@D)/uuc $(TARGET_DIR)/usr/bin/uuc + $(INSTALL) -D -m 755 $(@D)/sdimage $(TARGET_DIR)/usr/bin/sdimage + dd if=/dev/zero of=$(TARGET_DIR)/fat bs=1M count=1 + $(HOST_DIR)/usr/sbin/mkfs.vfat $(TARGET_DIR)/fat +endef + +define IMX_UUC_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/freescale-imx/imx-uuc/S80imx-uuc \ + $(TARGET_DIR)/etc/init.d/S80imx-uuc +endef + +define IMX_UUC_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 0644 package/freescale-imx/imx-uuc/imx-uuc.service \ + $(TARGET_DIR)/usr/lib/systemd/system/imx-uuc.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ + ln -fs ../../../../usr/lib/systemd/system/imx-uuc.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/imx-uuc.service +endef + +$(eval $(generic-package)) diff --git a/package/freescale-imx/imx-uuc/imx-uuc.service b/package/freescale-imx/imx-uuc/imx-uuc.service new file mode 100644 index 0000000..fae7fc6 --- /dev/null +++ b/package/freescale-imx/imx-uuc/imx-uuc.service @@ -0,0 +1,11 @@ +[Unit] +Description=i.MX Universal UTP Communication Service +After=systemd-modules-load.service + +[Service] +Type=simple +ExecStart=/usr/bin/uuc + +[Install] +WantedBy=multi-user.target +