From 4180320e1a9b2ccc3305cf7839c40814fc94e8ce Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Fri, 7 Apr 2017 12:52:04 +0200 Subject: [PATCH 01/95] ccimx6: update kernel to v4.1 Signed-off-by: Diaz de Grenu, Jose --- meta-digi-arm/recipes-kernel/linux/linux-dey_4.1.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey_4.1.bb b/meta-digi-arm/recipes-kernel/linux/linux-dey_4.1.bb index 96399f669..8f891fed8 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey_4.1.bb +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey_4.1.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2016 Digi International +# Copyright (C) 2016, 2017 Digi International require recipes-kernel/linux/linux-dey.inc require recipes-kernel/linux/linux-dtb.inc @@ -6,4 +6,4 @@ require recipes-kernel/linux/linux-dtb.inc SRCBRANCH = "v4.1.15/master" SRCREV = "${AUTOREV}" -COMPATIBLE_MACHINE = "(ccimx6ul)" +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul)" From 6f7e1ad54824b966860dff157349e864a7a769c3 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Wed, 19 Apr 2017 11:07:42 +0200 Subject: [PATCH 02/95] meta-digi-dey: bump distro version to 2.2-r2 Signed-off-by: Diaz de Grenu, Jose --- meta-digi-dey/conf/distro/dey.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/conf/distro/dey.conf b/meta-digi-dey/conf/distro/dey.conf index f0750c6b3..2c5c10fe4 100644 --- a/meta-digi-dey/conf/distro/dey.conf +++ b/meta-digi-dey/conf/distro/dey.conf @@ -1,6 +1,6 @@ DISTRO = "dey" DISTRO_NAME = "Digi Embedded Yocto" -DISTRO_VERSION = "2.2-r1" +DISTRO_VERSION = "2.2-r2" DISTRO_CODENAME = "morty" SDK_VENDOR = "-deysdk" SDK_VERSION := "${@'${DISTRO_VERSION}'}" From 1974e5a73e3facb0d9d8f1f3150434fe565f58f1 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Tue, 18 Apr 2017 11:53:53 +0200 Subject: [PATCH 03/95] ccimx6sbc: linux-dey: add defconfig for v4.1 Imported from the kernel branch. https://jira.digi.com/browse/DEL-3973 Signed-off-by: Diaz de Grenu, Jose --- .../linux/linux-dey-4.1/ccimx6sbc/defconfig | 318 ++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig new file mode 100644 index 000000000..c64729045 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig @@ -0,0 +1,318 @@ +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_KERNEL_LZO=y +CONFIG_SYSVIPC=y +CONFIG_FHANDLE=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=18 +CONFIG_CGROUPS=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_EMBEDDED=y +CONFIG_PERF_EVENTS=y +# CONFIG_SLUB_DEBUG is not set +# CONFIG_COMPAT_BRK is not set +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_ARCH_MXC=y +CONFIG_SOC_IMX51=y +CONFIG_SOC_IMX53=y +CONFIG_SOC_IMX6Q=y +CONFIG_SOC_IMX6SL=y +CONFIG_SOC_IMX6SX=y +CONFIG_SOC_IMX6UL=y +CONFIG_SOC_IMX7D=y +CONFIG_SOC_VF610=y +CONFIG_PCI=y +CONFIG_PCI_MSI=y +CONFIG_PCI_IMX6=y +CONFIG_SMP=y +CONFIG_VMSPLIT_2G=y +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_AEABI=y +CONFIG_HIGHMEM=y +CONFIG_CMA=y +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_ARM_IMX6Q_CPUFREQ=y +CONFIG_ARM_IMX7D_CPUFREQ=y +CONFIG_CPU_IDLE=y +CONFIG_VFP=y +CONFIG_NEON=y +CONFIG_PM_DEBUG=y +CONFIG_PM_TEST_SUSPEND=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_SYN_COOKIES=y +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +CONFIG_IPV6=y +CONFIG_NETFILTER=y +CONFIG_BRIDGE=y +CONFIG_NET_SCHED=y +CONFIG_CAN=y +CONFIG_CAN_FLEXCAN=y +CONFIG_BT=y +CONFIG_BT_RFCOMM=y +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=y +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=y +CONFIG_BT_HCIUART=y +CONFIG_BT_HCIUART_ATH3K=y +CONFIG_BT_HCIUART_3WIRE=y +CONFIG_CFG80211=y +CONFIG_CFG80211_CERTIFICATION_ONUS=y +CONFIG_CFG80211_WEXT=y +CONFIG_RFKILL=y +CONFIG_RFKILL_INPUT=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +# CONFIG_STANDALONE is not set +# CONFIG_FW_LOADER_USER_HELPER is not set +CONFIG_DMA_CMA=y +CONFIG_CMA_SIZE_PERCENTAGE=40 +CONFIG_CMA_SIZE_SEL_PERCENTAGE=y +CONFIG_IMX_WEIM=y +CONFIG_CONNECTOR=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_EEPROM_AT24=y +CONFIG_EEPROM_AT25=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_SCAN_ASYNC=y +# CONFIG_SCSI_LOWLEVEL is not set +CONFIG_ATA=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_AHCI_IMX=y +CONFIG_PATA_IMX=y +CONFIG_MD=y +CONFIG_BLK_DEV_DM=y +CONFIG_DM_CRYPT=y +CONFIG_NETDEVICES=y +# CONFIG_NET_CADENCE is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_SMSC_PHY=y +CONFIG_MICREL_PHY=y +CONFIG_PPP=y +CONFIG_PPP_BSDCOMP=y +CONFIG_PPP_DEFLATE=y +CONFIG_PPP_ASYNC=y +CONFIG_USB_USBNET=y +CONFIG_USB_NET_CDC_EEM=y +CONFIG_USB_NET_CDC_MBIM=y +CONFIG_USB_NET_QMI_WWAN=y +CONFIG_USB_SIERRA_NET=y +CONFIG_ATH_CARDS=y +CONFIG_ATH6KL=m +CONFIG_ATH6KL_SDIO=m +CONFIG_ATH6KL_DEBUG=y +CONFIG_ATH6KL_REGDOMAIN=y +CONFIG_INPUT_EVDEV=y +CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_IMX=y +# CONFIG_INPUT_MOUSE is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_FUSION_7_10=y +CONFIG_TOUCHSCREEN_MC13783=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MMA8450=y +CONFIG_INPUT_DA9063_ONKEY=y +CONFIG_INPUT_ISL29023=y +# CONFIG_LEGACY_PTYS is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_IMX=y +CONFIG_SERIAL_IMX_CONSOLE=y +CONFIG_SERIAL_FSL_LPUART=y +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y +CONFIG_FSL_OTP=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_HELPER_AUTO is not set +CONFIG_I2C_IMX=y +CONFIG_SPI=y +CONFIG_SPI_IMX=y +CONFIG_SPI_SPIDEV=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_DA9063=y +CONFIG_POWER_SUPPLY=y +CONFIG_SENSORS_DA9063=y +CONFIG_SENSORS_MAG3110=y +CONFIG_THERMAL=y +CONFIG_CPU_THERMAL=y +CONFIG_IMX_THERMAL=y +CONFIG_DEVICE_THERMAL=y +CONFIG_WATCHDOG=y +CONFIG_IMX2_WDT=y +CONFIG_MFD_DA9052_I2C=y +CONFIG_MFD_DA9063=y +CONFIG_MFD_MC13XXX_SPI=y +CONFIG_MFD_MC13XXX_I2C=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_ANATOP=y +CONFIG_REGULATOR_DA9052=y +CONFIG_REGULATOR_DA9063=y +CONFIG_REGULATOR_MC13783=y +CONFIG_REGULATOR_MC13892=y +CONFIG_REGULATOR_PFUZE100=y +CONFIG_MEDIA_SUPPORT=y +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_USB_SUPPORT=y +CONFIG_USB_VIDEO_CLASS=y +# CONFIG_USB_GSPCA is not set +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_VIDEO_MXC_OUTPUT=y +CONFIG_VIDEO_MXC_CAPTURE=y +CONFIG_MXC_CAMERA_OV5642=y +CONFIG_MXC_CAMERA_OV5640_MIPI=y +CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=y +CONFIG_VIDEO_MXC_IPU_OUTPUT=y +CONFIG_VIDEO_MXC_PXP_V4L2=y +CONFIG_SOC_CAMERA=y +CONFIG_VIDEO_MX3=y +CONFIG_SOC_CAMERA_OV2640=y +# CONFIG_VGA_ARB is not set +CONFIG_DRM=y +CONFIG_DRM_VIVANTE=y +CONFIG_FB=y +CONFIG_FB_MXS=y +CONFIG_FB_MXC_SYNC_PANEL=y +CONFIG_FB_MXC_MIPI_DSI=y +CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y +CONFIG_FB_MXC_LDB=y +CONFIG_FB_MXC_HDMI=y +CONFIG_FB_MXC_AD9389=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_L4F00242T03=y +CONFIG_LCD_PLATFORM=y +CONFIG_BACKLIGHT_PWM=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +CONFIG_LOGO=y +CONFIG_FB_LOGO_CENTERED=y +CONFIG_FB_LOGO_FORCE_SINGLE=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +# CONFIG_LOGO_LINUX_CLUT224 is not set +CONFIG_SOUND=y +CONFIG_SND=y +# CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_VERBOSE_PROCFS is not set +# CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set +# CONFIG_SND_ARM is not set +# CONFIG_SND_SPI is not set +# CONFIG_SND_USB is not set +CONFIG_SND_SOC=y +CONFIG_SND_IMX_SOC=y +CONFIG_SND_SOC_IMX_SGTL5000=y +CONFIG_SND_SOC_IMX_HDMI=y +CONFIG_HID_MULTITOUCH=y +CONFIG_USB=y +CONFIG_USB_OTG=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_ACM=y +CONFIG_USB_STORAGE=y +CONFIG_USB_CHIPIDEA=y +CONFIG_USB_CHIPIDEA_UDC=y +CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_SERIAL=y +CONFIG_USB_SERIAL_QUALCOMM=y +CONFIG_USB_SERIAL_SIERRAWIRELESS=y +CONFIG_USB_SERIAL_OPTION=y +CONFIG_USB_MXS_PHY=y +CONFIG_USB_GADGET=y +CONFIG_USB_ETH=m +CONFIG_USB_MASS_STORAGE=m +CONFIG_USB_G_SERIAL=m +CONFIG_USB_CDC_COMPOSITE=m +CONFIG_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_ESDHC_IMX=y +CONFIG_MXC_IPU=y +CONFIG_MXC_MIPI_CSI2=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_DA9063=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_DRV_DA9063=y +CONFIG_RTC_DRV_MC13XXX=y +CONFIG_RTC_DRV_MXC=y +CONFIG_RTC_DRV_SNVS=y +CONFIG_DMADEVICES=y +CONFIG_MXC_PXP_V2=y +CONFIG_IMX_SDMA=y +CONFIG_MXS_DMA=y +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_PWM=y +CONFIG_PWM_IMX=y +CONFIG_EXT4_FS=y +CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +# CONFIG_MISC_FILESYSTEMS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_ROOT_NFS=y +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_15=y +CONFIG_NLS_UTF8=y +CONFIG_DYNAMIC_DEBUG=y +CONFIG_DEBUG_FS=y +# CONFIG_SCHED_DEBUG is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_FTRACE is not set +# CONFIG_ARM_UNWIND is not set +CONFIG_SECURITYFS=y +# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_XTS=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_LZO=y +# CONFIG_CRYPTO_ANSI_CPRNG is not set +CONFIG_CRYPTO_USER_API_HASH=y +CONFIG_CRYPTO_USER_API_SKCIPHER=y +CONFIG_CRYPTO_DEV_FSL_CAAM=y +CONFIG_FONTS=y From 3ab6c6caa5892522991252e933de4426d4be6d9b Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 5 Apr 2017 13:24:50 +0200 Subject: [PATCH 04/95] meta-digi-dey: Add bluetooth main configuration files Configure bluetoothd to enable the controller automatically. https://jira.digi.com/browse/DEL-3711 https://jira.digi.com/browse/DEL-3436 https://jira.digi.com/browse/DEL-3636 https://jira.digi.com/browse/DEL-3955 Signed-off-by: Alex Gonzalez --- .../bluez/bluez5-5.41/ccimx6/main.conf | 12 ++++++++++++ .../bluez/bluez5-5.41/ccimx6ul/main.conf | 12 ++++++++++++ .../recipes-connectivity/bluez/bluez5_5.41.bbappend | 3 +++ 3 files changed, 27 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6/main.conf create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/main.conf diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6/main.conf b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6/main.conf new file mode 100644 index 000000000..c0908f0b2 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6/main.conf @@ -0,0 +1,12 @@ +[General] + +# Default adapter name +# Defaults to 'BlueZ X.YZ' +Name = cc6 + +#[Policy] + +# AutoEnable defines option to enable all controllers when they are found. +# This includes adapters present on start as well as adapters that are plugged +# in later on. Defaults to 'false'. +#AutoEnable=true diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/main.conf b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/main.conf new file mode 100644 index 000000000..e3c0cacbc --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/main.conf @@ -0,0 +1,12 @@ +[General] + +# Default adapter name +# Defaults to 'BlueZ X.YZ' +Name = cc6ul + +[Policy] + +# AutoEnable defines option to enable all controllers when they are found. +# This includes adapters present on start as well as adapters that are plugged +# in later on. Defaults to 'false'. +AutoEnable=true diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend index c6edca2b5..02ac853df 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend @@ -4,6 +4,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" SRC_URI += " \ file://bluetooth-init \ + file://main.conf \ file://0001-hcitool-do-not-show-unsupported-refresh-option.patch \ file://0002-hcitool-increase-the-shown-connection-limit-to-20.patch \ " @@ -37,10 +38,12 @@ PACKAGECONFIG_append = " experimental" do_install_append() { install -d ${D}${sysconfdir}/init.d/ install -m 0755 ${WORKDIR}/bluetooth-init ${D}${sysconfdir}/init.d/bluetooth-init + install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/bluetooth/ } PACKAGES =+ "${PN}-init" +FILES_${PN} += " ${sysconfdir}/bluetooth/main.conf" FILES_${PN}-init = "${sysconfdir}/init.d/bluetooth-init" INITSCRIPT_PACKAGES += "${PN}-init" From ae8e695cf779dc1168089997bdc4add4f49936ce Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 6 Apr 2017 09:31:23 +0200 Subject: [PATCH 05/95] meta-digi-dey: bluez5-5.41: ccim6ul: Modify hciattach This commits adds patches to hciattach for the following: * Strict flow control setting The hciattach application has a flow | noflow command line argument that is currently only applied on the first configuration of the uart port. The hciattach_rome plugin ignores this setting and assumes hardware flow control is always supported. This commits makes hciattach obey the user flow control indication. * Modify hciattach_rome to set MAC address. The MAC address setting feature in the rome plugin now works with the command line specified MAC. * Reduce verbosity. hciattach now accepts a "-v" verbose flag. By default verbose output it omitted. https://jira.digi.com/browse/DEL-3711 https://jira.digi.com/browse/DEL-3436 https://jira.digi.com/browse/DEL-3636 https://jira.digi.com/browse/DEL-3955 Signed-off-by: Alex Gonzalez --- ...espect-the-user-indication-for-noflo.patch | 186 +++++ ...If-the-user-supplies-a-bdaddr-use-it.patch | 177 +++++ .../0024-hciattach-Add-verbosity-option.patch | 723 ++++++++++++++++++ .../bluez/bluez5_5.41.bbappend | 3 + 4 files changed, 1089 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0022-hciattach_rome-Respect-the-user-indication-for-noflo.patch create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0023-hciattach-If-the-user-supplies-a-bdaddr-use-it.patch create mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0024-hciattach-Add-verbosity-option.patch diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0022-hciattach_rome-Respect-the-user-indication-for-noflo.patch b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0022-hciattach_rome-Respect-the-user-indication-for-noflo.patch new file mode 100644 index 000000000..e5d76303a --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0022-hciattach_rome-Respect-the-user-indication-for-noflo.patch @@ -0,0 +1,186 @@ +From: Alex Gonzalez +Date: Thu, 6 Apr 2017 09:27:09 +0200 +Subject: [PATCH] hciattach_rome: Respect the user indication for noflow + +When hciattach is called with noflow, it should not assume the hardware +supports hardware flow control. + +Basically, use 'flow' or 'noflow' on the hciattach command line arguments +to indicate whether to use or not hardware flow control. + +Signed-off-by: Alex Gonzalez +--- + tools/hciattach.c | 2 +- + tools/hciattach.h | 2 +- + tools/hciattach_rome.c | 50 +++++++++++++++++++++++++++++++++++--------------- + tools/hciattach_rome.h | 1 + + 4 files changed, 38 insertions(+), 17 deletions(-) + +diff --git a/tools/hciattach.c b/tools/hciattach.c +index dda639cabca3..81d78ab3f69a 100644 +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -286,7 +286,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti) + static int qca(int fd, struct uart_t *u, struct termios *ti) + { + fprintf(stderr,"qca\n"); +- return qca_soc_init(fd, u->speed, u->bdaddr); ++ return qca_soc_init(fd, u->speed, u->bdaddr, ti); + } + + static int qualcomm(int fd, struct uart_t *u, struct termios *ti) +diff --git a/tools/hciattach.h b/tools/hciattach.h +index 49e59321fcac..3524e716c847 100644 +--- a/tools/hciattach.h ++++ b/tools/hciattach.h +@@ -64,7 +64,7 @@ int ath3k_init(int fd, int speed, int init_speed, char *bdaddr, + struct termios *ti); + int ath3k_post(int fd, int pm); + int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr); +-int qca_soc_init(int fd, int speed, char *bdaddr); ++int qca_soc_init(int fd, int speed, char *bdaddr , struct termios * ti); + int intel_init(int fd, int init_speed, int *speed, struct termios *ti); + int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti, + const char *bdaddr); +diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c +index 59bdc16e4e8f..ee67bb068c09 100644 +--- a/tools/hciattach_rome.c ++++ b/tools/hciattach_rome.c +@@ -1565,7 +1565,8 @@ static void flow_control(int fd, int opt) + } + + +-int rome_set_baudrate_req(int fd, int local_baud_rate, int controller_baud_rate) ++int rome_set_baudrate_req(int fd, int local_baud_rate, ++ int controller_baud_rate, int hwfc) + { + int size, err = 0; + unsigned char cmd[HCI_MAX_CMD_SIZE]; +@@ -1575,6 +1576,12 @@ int rome_set_baudrate_req(int fd, int local_baud_rate, int controller_baud_rate) + + memset(cmd, 0x0, HCI_MAX_CMD_SIZE); + ++ /* If not using hardware flow control limit baud rate to 115200 */ ++ if (!hwfc) { ++ local_baud_rate = USERIAL_BAUD_115200; ++ controller_baud_rate = BAUDRATE_115200; ++ } ++ + cmd_hdr = (void *) (cmd + 1); + cmd[0] = HCI_COMMAND_PKT; + cmd_hdr->opcode = cmd_opcode_pack(HCI_VENDOR_CMD_OGF, EDL_SET_BAUDRATE_CMD_OCF); +@@ -1621,7 +1628,7 @@ error: + } + + +-int rome_hci_reset_req(int fd, char baud) ++int rome_hci_reset_req(int fd, char baud, int hwfc) + { + int size, err = 0; + unsigned char cmd[HCI_MAX_CMD_SIZE]; +@@ -1641,8 +1648,9 @@ int rome_hci_reset_req(int fd, char baud) + /* Total length of the packet to be sent to the Controller */ + size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE); + +- /* Flow off during baudrate change */ +- flow_control(fd, MSM_DISABLE_FLOW_CTRL); ++ /* If using hardware flow control, turn off during baudrate change */ ++ if (hwfc) ++ flow_control(fd, MSM_DISABLE_FLOW_CTRL); + + /* Send the HCI command packet to UART for transmission */ + fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3]); +@@ -1655,8 +1663,9 @@ int rome_hci_reset_req(int fd, char baud) + /* Change Local UART baudrate to high speed UART */ + userial_vendor_set_baud(baud); + +- /* Flow on after changing local uart baudrate */ +- flow_control(fd, MSM_ENABLE_FLOW_CTRL); ++ /* If using hardware flow control, turn on after changing local uart baudrate */ ++ if (hwfc) ++ flow_control(fd, MSM_ENABLE_FLOW_CTRL); + + /* Wait for command complete event */ + err = read_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE); +@@ -1778,7 +1787,7 @@ int isSpeedValid(int speed, int *local_baud_rate, int *controller_baud_rate) + return -1; + } + +-int qca_soc_init(int fd, int speed, char *bdaddr) ++int qca_soc_init(int fd, int speed, char *bdaddr , struct termios * ti) + { + int err = -1; + int size, local_baud_rate = 0, controller_baud_rate = 0; +@@ -1793,6 +1802,12 @@ int qca_soc_init(int fd, int speed, char *bdaddr) + return -1; + } + #endif ++ ++ /* Assume we don't use hardware flow control unless user requested 'flow' */ ++ vnd_userial.hwfc = 0; ++ if (ti->c_cflag & ~CRTSCTS) ++ vnd_userial.hwfc = 1; ++ + /* Get Rome version information */ + if((err = rome_patch_ver_req(fd)) <0){ + fprintf(stderr, "%s: Fail to get Rome Version (0x%x)\n", __FUNCTION__, err); +@@ -1838,11 +1853,14 @@ int qca_soc_init(int fd, int speed, char *bdaddr) + goto error; + } + +- /* Change baud rate 115.2 kbps to 3Mbps*/ +- err = rome_hci_reset_req(fd, local_baud_rate); +- if ( err <0 ) { +- fprintf(stderr, "HCI Reset Failed !!\n"); +- goto error; ++ /* If using hw flow control, change baud rate 115.2 kbps to 3Mbps*/ ++ if (vnd_userial.hwfc) { ++ err = rome_hci_reset_req(fd, local_baud_rate, ++ vnd_userial.hwfc); ++ if ( err <0 ) { ++ fprintf(stderr, "HCI Reset Failed !!\n"); ++ goto error; ++ } + } + + fprintf(stderr, "HCI Reset is done\n"); +@@ -1888,7 +1906,8 @@ download: + if (local_baud_rate < 0 || controller_baud_rate < 0) + goto error; + +- err = rome_set_baudrate_req(fd, local_baud_rate, controller_baud_rate); ++ err = rome_set_baudrate_req(fd, local_baud_rate, ++ controller_baud_rate, vnd_userial.hwfc); + if (err < 0) { + fprintf(stderr, "%s: Baud rate change failed!\n", __FUNCTION__); + goto error; +@@ -1907,14 +1926,15 @@ download: + * Overriding the baud rate value in NVM file with the user + * requested baud rate, since default baud rate in NVM file is 3M. + */ +- err = rome_set_baudrate_req(fd, local_baud_rate, controller_baud_rate); ++ err = rome_set_baudrate_req(fd, local_baud_rate, ++ controller_baud_rate, vnd_userial.hwfc); + if (err < 0) { + fprintf(stderr, "%s: Baud rate change failed!\n", __FUNCTION__); + goto error; + } + + /* Perform HCI reset here*/ +- err = rome_hci_reset_req(fd, local_baud_rate); ++ err = rome_hci_reset_req(fd, local_baud_rate, vnd_userial.hwfc); + if ( err <0 ) { + fprintf(stderr, "HCI Reset Failed !!!\n"); + goto error; +diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h +index 89f7db3bef86..760685ad7915 100644 +--- a/tools/hciattach_rome.h ++++ b/tools/hciattach_rome.h +@@ -62,6 +62,7 @@ typedef struct + int fd; /* fd to Bluetooth device */ + struct termios termios; /* serial terminal of BT port */ + char port_name[256]; ++ int hwfc; + } vnd_userial_cb_t; + + /**** baud rates ****/ diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0023-hciattach-If-the-user-supplies-a-bdaddr-use-it.patch b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0023-hciattach-If-the-user-supplies-a-bdaddr-use-it.patch new file mode 100644 index 000000000..208f587a2 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0023-hciattach-If-the-user-supplies-a-bdaddr-use-it.patch @@ -0,0 +1,177 @@ +From: Alex Gonzalez +Date: Thu, 6 Apr 2017 14:37:57 +0200 +Subject: [PATCH] hciattach: If the user supplies a bdaddr, use it + +The QCA6564 has no non-volatile configuration file for the bluetooth +MAC, so use the one supplied on the command line. + +Signed-off-by: Alex Gonzalez +--- + tools/hciattach.c | 4 +-- + tools/hciattach_rome.c | 76 ++++++++++---------------------------------------- + 2 files changed, 17 insertions(+), 63 deletions(-) + +diff --git a/tools/hciattach.c b/tools/hciattach.c +index 81d78ab3f69a..022bbe5fa6d5 100644 +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -285,7 +285,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti) + + static int qca(int fd, struct uart_t *u, struct termios *ti) + { +- fprintf(stderr,"qca\n"); ++ fprintf(stderr,"qca, bdaddr %s\n", u->bdaddr ? u->bdaddr : "Default"); + return qca_soc_init(fd, u->speed, u->bdaddr, ti); + } + +@@ -1363,7 +1363,7 @@ int main(int argc, char *argv[]) + fprintf(stderr, "Unknown device type or id\n"); + exit(1); + } +- ++ u->bdaddr = NULL; + break; + + case 2: +diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c +index ee67bb068c09..854cfff707aa 100644 +--- a/tools/hciattach_rome.c ++++ b/tools/hciattach_rome.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + #include + #include "hciattach_rome.h" + #include "hciattach.h" +@@ -911,7 +912,7 @@ int get_value_from_config(char *file_path,char *param) + return ret; + } + +-int rome_get_tlv_file(char *file_path) ++int rome_get_tlv_file(char *file_path, unsigned char * bdaddr) + { + FILE * pFile; + long fileSize; +@@ -921,7 +922,6 @@ int rome_get_tlv_file(char *file_path) + tlv_nvm_hdr *nvm_ptr; + unsigned char data_buf[PRINT_BUF_SIZE]={0,}; + unsigned char *nvm_byte_ptr; +- unsigned char bdaddr[6]; + unsigned short pcm_value, ibs_value; + + fprintf(stderr, "File Open (%s)\n", file_path); +@@ -1008,12 +1008,15 @@ int rome_get_tlv_file(char *file_path) + nvm_byte_ptr+=sizeof(tlv_nvm_hdr); + + /* Write BD Address */ +- if(nvm_ptr->tag_id == TAG_NUM_2 && read_bd_address(&bdaddr) == 0) { +- memcpy(nvm_byte_ptr, bdaddr, 6); +- fprintf(stderr, "Overriding default BD ADDR with user" +- " programmed BD Address: %02x:%02x:%02x:%02x:%02x:%02x\n", +- *nvm_byte_ptr, *(nvm_byte_ptr+1), *(nvm_byte_ptr+2), +- *(nvm_byte_ptr+3), *(nvm_byte_ptr+4), *(nvm_byte_ptr+5)); ++ if(nvm_ptr->tag_id == TAG_NUM_2 && bdaddr) { ++ bdaddr_t ba; ++ if (!str2ba(bdaddr, &ba)) { ++ memcpy(nvm_byte_ptr, &ba, 6); ++ fprintf(stderr, "Overriding default BD ADDR with user" ++ " programmed BD Address: %02x:%02x:%02x:%02x:%02x:%02x\n", ++ *(nvm_byte_ptr+5), *(nvm_byte_ptr+4), *(nvm_byte_ptr+3), ++ *(nvm_byte_ptr+2), *(nvm_byte_ptr+1), *nvm_byte_ptr); ++ } + } + + if (nvm_ptr->tag_id == TAG_NUM_17) { +@@ -1209,14 +1212,14 @@ error: + return err; + } + +-int rome_download_tlv_file(int fd) ++int rome_download_tlv_file(int fd, char * bdaddr) + { + int tlv_size, err = -1; + + /* Rampatch TLV file Downloading */ + pdata_buffer = NULL; + +- if((tlv_size = rome_get_tlv_file(rampatch_file_path)) < 0) ++ if((tlv_size = rome_get_tlv_file(rampatch_file_path, bdaddr)) < 0) + goto error; + + if((err =rome_tlv_dnld_req(fd, tlv_size)) <0 ) +@@ -1228,7 +1231,7 @@ int rome_download_tlv_file(int fd) + } + + /* NVM TLV file Downloading */ +- if((tlv_size = rome_get_tlv_file(nvm_file_path)) < 0) ++ if((tlv_size = rome_get_tlv_file(nvm_file_path, bdaddr)) < 0) + goto error; + + if((err =rome_tlv_dnld_req(fd, tlv_size)) <0 ) +@@ -1679,55 +1682,6 @@ error: + + } + +-int read_bd_address(unsigned char *bdaddr) +-{ +- int fd = -1; +- int readPtr = 0; +- unsigned char data[BD_ADDR_LEN]; +- +- /* Open the persist file for reading device address*/ +- fd = open("/etc/bluetooth/.bt_nv.bin", O_RDONLY); +- if(fd < 0) +- { +- fprintf(stderr, "%s: Open failed: Programming default BD ADDR\n", __func__); +- return -1; +- } +- +- /* Read the NVM Header : fp will be advanced by readPtr number of bytes */ +- readPtr = read(fd, data, PERSIST_HEADER_LEN); +- if (readPtr > 0) +- fprintf(stderr, "%s: Persist header data: %02x \t %02x \t %02x\n", __func__, +- data[NVITEM], data[RDWR_PROT], data[NVITEM_SIZE]); +- else { +- fprintf(stderr, "%s: Read from persist memory failed : Programming default" +- " BD ADDR\n"); +- close(fd); +- return -1; +- } +- +- /* Check for BD ADDR length before programming */ +- if(data[NVITEM_SIZE] != BD_ADDR_LEN) { +- fprintf(stderr, "Invalid BD ADDR: Programming default BD ADDR!\n"); +- close(fd); +- return -1; +- } +- +- /* Read the BD ADDR info */ +- readPtr = read(fd, data, BD_ADDR_LEN); +- if (readPtr > 0) +- fprintf(stderr, "BD-ADDR: ==> %02x:%02x:%02x:%02x:%02x:%02x\n", data[0], +- data[1], data[2], data[3], data[4], data[5]); +- else { +- fprintf(stderr, "%s: Read from persist memory failed : Programming default" +- " BD ADDR\n"); +- close(fd); +- return -1; +- } +- memcpy(bdaddr, data, BD_ADDR_LEN); +- close(fd); +- return 0; +-} +- + int isSpeedValid(int speed, int *local_baud_rate, int *controller_baud_rate) + { + switch(speed) { +@@ -1915,7 +1869,7 @@ download: + } + + /* Donwload TLV files (rampatch, NVM) */ +- err = rome_download_tlv_file(fd); ++ err = rome_download_tlv_file(fd, bdaddr); + if (err < 0) { + fprintf(stderr, "%s: Download TLV file failed!\n", __FUNCTION__); + goto error; diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0024-hciattach-Add-verbosity-option.patch b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0024-hciattach-Add-verbosity-option.patch new file mode 100644 index 000000000..d1e540a92 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/0024-hciattach-Add-verbosity-option.patch @@ -0,0 +1,723 @@ +From: Alex Gonzalez +Date: Mon, 10 Apr 2017 12:44:00 +0200 +Subject: [PATCH] hciattach: Add verbosity option + +And reduce the verbosity of the hciattach_rome plugin. + +Signed-off-by: Alex Gonzalez +--- + lib/bluetooth.h | 3 + + tools/hciattach.c | 13 ++- + tools/hciattach_rome.c | 244 ++++++++++++++++++++++++------------------------- + 3 files changed, 132 insertions(+), 128 deletions(-) + +diff --git a/lib/bluetooth.h b/lib/bluetooth.h +index eb279260e009..38e3e6900744 100644 +--- a/lib/bluetooth.h ++++ b/lib/bluetooth.h +@@ -136,6 +136,9 @@ enum { + BT_CLOSED + }; + ++extern int verbose_on; ++#define hciprintf(fd, arg...) if (verbose_on) { fprintf(fd, ##arg);} else { do {} while (0);} ++ + /* Byte order conversions */ + #if __BYTE_ORDER == __LITTLE_ENDIAN + #define htobs(d) (d) +diff --git a/tools/hciattach.c b/tools/hciattach.c +index 022bbe5fa6d5..4aacdafeda7d 100644 +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -50,6 +50,8 @@ + + #include "hciattach.h" + ++int verbose_on = 0; ++ + struct uart_t { + char *type; + int m_id; +@@ -125,8 +127,6 @@ int read_hci_event(int fd, unsigned char* buf, int size) + fprintf(stderr, "%s: Timing out on select for 3 secs.\n", __FUNCTION__); + return -1; + } +- else +- fprintf(stderr, "%s: Data(HCI-CMD-COMP-EVENT) available in TTY Serial buffer\n", __FUNCTION__); + + /* The first byte identifies the packet type. For HCI event packets, it + * should be 0x04, so we read until we get to the 0x04. */ +@@ -285,7 +285,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti) + + static int qca(int fd, struct uart_t *u, struct termios *ti) + { +- fprintf(stderr,"qca, bdaddr %s\n", u->bdaddr ? u->bdaddr : "Default"); ++ fprintf(stderr,"qca, bdaddr %s, verbose %d\n", u->bdaddr ? u->bdaddr : "Default", verbose_on); + return qca_soc_init(fd, u->speed, u->bdaddr, ti); + } + +@@ -1258,7 +1258,7 @@ static void usage(void) + { + printf("hciattach - HCI UART driver initialization utility\n"); + printf("Usage:\n"); +- printf("\thciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed]" ++ printf("\thciattach [-n] [-p] [-b] [-r] [-v] [-t timeout] [-s initial_speed]" + " [speed] [flow|noflow]" + " [sleep|nosleep] [bdaddr]\n"); + printf("\thciattach -l\n"); +@@ -1281,7 +1281,7 @@ int main(int argc, char *argv[]) + printpid = 0; + raw = 0; + +- while ((opt=getopt(argc, argv, "bnpt:s:lrf:")) != EOF) { ++ while ((opt=getopt(argc, argv, "bnpt:s:lrf:v")) != EOF) { + switch(opt) { + case 'b': + send_break = 1; +@@ -1319,6 +1319,9 @@ int main(int argc, char *argv[]) + fprintf(stderr, "Line_disp val : %d\n", line_disp); + break; + ++ case 'v': ++ verbose_on = 1; ++ break; + default: + usage(); + exit(1); +diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c +index 854cfff707aa..40983fc087c0 100644 +--- a/tools/hciattach_rome.c ++++ b/tools/hciattach_rome.c +@@ -139,7 +139,7 @@ unsigned char userial_to_tcio_baud(unsigned char cfg_baud, unsigned int *baud) + void userial_vendor_set_baud(unsigned char userial_baud) + { + unsigned int tcio_baud; +- fprintf(stderr, "## userial_vendor_set_baud: %d\n", userial_baud); ++ hciprintf(stderr, "## userial_vendor_set_baud: %d\n", userial_baud); + + if (tcgetattr(vnd_userial.fd, &vnd_userial.termios) < 0) { + perror("Can't get port settings"); +@@ -201,7 +201,7 @@ int userial_vendor_ioctl(int fd, userial_vendor_ioctl_op_t op, int *p_data) + break; + #endif // (BT_WAKE_VIA_USERIAL_IOCTL==TRUE) + case USERIAL_OP_FLOW_ON: +- fprintf(stderr, "## userial_vendor_ioctl: UART Flow On\n "); ++ hciprintf(stderr, "## userial_vendor_ioctl: UART Flow On\n "); + ti.c_cflag |= CRTSCTS; + + if (err = tcsetattr(fd, TCSANOW, &ti) < 0) { +@@ -212,7 +212,7 @@ int userial_vendor_ioctl(int fd, userial_vendor_ioctl_op_t op, int *p_data) + break; + + case USERIAL_OP_FLOW_OFF: +- fprintf(stderr, "## userial_vendor_ioctl: UART Flow Off\n "); ++ hciprintf(stderr, "## userial_vendor_ioctl: UART Flow Off\n "); + ti.c_cflag &= ~CRTSCTS; + if (err = tcsetattr(fd, TCSANOW, &ti) < 0) { + fprintf(stderr, "Can't set port settings"); +@@ -233,51 +233,51 @@ int get_vs_hci_event(unsigned char *rsp) + int err = 0, soc_id =0; + unsigned char paramlen = 0; + +- if( (rsp[EVENTCODE_OFFSET] == VSEVENT_CODE) || (rsp[EVENTCODE_OFFSET] == EVT_CMD_COMPLETE)) +- fprintf(stderr, "%s: Received HCI-Vendor Specific event\n", __FUNCTION__); +- else { ++ if( (rsp[EVENTCODE_OFFSET] == VSEVENT_CODE) || (rsp[EVENTCODE_OFFSET] == EVT_CMD_COMPLETE)) { ++ hciprintf(stderr, "%s: Received HCI-Vendor Specific event\n", __FUNCTION__); ++ } else { + fprintf(stderr, "%s: Failed to receive HCI-Vendor Specific event\n", __FUNCTION__); + err = -EIO; + goto failed; + } + +- fprintf(stderr, "%s: Parameter Length: 0x%x\n", __FUNCTION__, paramlen = rsp[EVT_PLEN]); +- fprintf(stderr, "%s: Command response: 0x%x\n", __FUNCTION__, rsp[CMD_RSP_OFFSET]); +- fprintf(stderr, "%s: Response type : 0x%x\n", __FUNCTION__, rsp[RSP_TYPE_OFFSET]); ++ paramlen = rsp[EVT_PLEN]; ++ hciprintf(stderr, "%s: Parameter Length: 0x%x\n", __FUNCTION__, paramlen); ++ hciprintf(stderr, "%s: Command response: 0x%x\n", __FUNCTION__, rsp[CMD_RSP_OFFSET]); ++ hciprintf(stderr, "%s: Response type : 0x%x\n", __FUNCTION__, rsp[RSP_TYPE_OFFSET]); + + /* Check the status of the operation */ + switch ( rsp[CMD_RSP_OFFSET] ) + { + case EDL_CMD_REQ_RES_EVT: +- fprintf(stderr, "%s: Command Request Response\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Command Request Response\n", __FUNCTION__); + switch(rsp[RSP_TYPE_OFFSET]) + { + case EDL_PATCH_VER_RES_EVT: + case EDL_APP_VER_RES_EVT: +- fprintf(stderr, "\t Current Product ID\t\t: 0x%08x\n", +- (unsigned int)(rsp[PATCH_PROD_ID_OFFSET +3] << 24 | ++ hciprintf(stderr, "\t Current Product ID\t\t: 0x%08x\n", ++ (unsigned int)(rsp[PATCH_PROD_ID_OFFSET +3] << 24 | + rsp[PATCH_PROD_ID_OFFSET+2] << 16 | + rsp[PATCH_PROD_ID_OFFSET+1] << 8 | + rsp[PATCH_PROD_ID_OFFSET] )); + + /* Patch Version indicates FW patch version */ +- fprintf(stderr, "\t Current Patch Version\t\t: 0x%04x\n", +- (unsigned short)(rsp[PATCH_PATCH_VER_OFFSET + 1] << 8 | ++ hciprintf(stderr, "\t Current Patch Version\t\t: 0x%04x\n", ++ (unsigned short)(rsp[PATCH_PATCH_VER_OFFSET + 1] << 8 | + rsp[PATCH_PATCH_VER_OFFSET] )); + + /* ROM Build Version indicates ROM build version like 1.0/1.1/2.0 */ +- fprintf(stderr, "\t Current ROM Build Version\t: 0x%04x\n", rome_ver = +- (int)(rsp[PATCH_ROM_BUILD_VER_OFFSET + 1] << 8 | +- rsp[PATCH_ROM_BUILD_VER_OFFSET] )); ++ rome_ver = (int)(rsp[PATCH_ROM_BUILD_VER_OFFSET + 1] << 8 | ++ rsp[PATCH_ROM_BUILD_VER_OFFSET] ); ++ hciprintf(stderr, "\t Current ROM Build Version\t: 0x%04x\n", rome_ver); + + /* In case rome 1.0/1.1, there is no SOC ID version available */ +- if (paramlen - 10) +- { +- fprintf(stderr, "\t Current SOC Version\t\t: 0x%08x\n", soc_id = +- (unsigned int)(rsp[PATCH_SOC_VER_OFFSET +3] << 24 | +- rsp[PATCH_SOC_VER_OFFSET+2] << 16 | +- rsp[PATCH_SOC_VER_OFFSET+1] << 8 | +- rsp[PATCH_SOC_VER_OFFSET] )); ++ if (paramlen - 10) { ++ soc_id = (unsigned int)(rsp[PATCH_SOC_VER_OFFSET +3] << 24 | ++ rsp[PATCH_SOC_VER_OFFSET+2] << 16 | ++ rsp[PATCH_SOC_VER_OFFSET+1] << 8 | ++ rsp[PATCH_SOC_VER_OFFSET]); ++ hciprintf(stderr, "\t Current SOC Version\t\t: 0x%08x\n", soc_id); + } + + /* Rome Chipset Version can be decided by Patch version and SOC version, +@@ -290,7 +290,7 @@ int get_vs_hci_event(unsigned char *rsp) + switch (err = rsp[CMD_STATUS_OFFSET]) + { + case HCI_CMD_SUCCESS: +- fprintf(stderr, "%s: Download Packet successfully!\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Download Packet successfully!\n", __FUNCTION__); + break; + case PATCH_LEN_ERROR: + fprintf(stderr, "%s: Invalid patch length argument passed for EDL PATCH " +@@ -318,7 +318,7 @@ int get_vs_hci_event(unsigned char *rsp) + break; + + case NVM_ACCESS_CODE: +- fprintf(stderr, "%s: NVM Access Code!!!\n", __FUNCTION__); ++ hciprintf(stderr, "%s: NVM Access Code!!!\n", __FUNCTION__); + err = HCI_CMD_SUCCESS; + break; + case EDL_SET_BAUDRATE_RSP_EVT: +@@ -362,7 +362,7 @@ int wait_for_data(int fd, int maxTimeOut) + return -1; + } + else +- fprintf(stderr, "%s: HCI-VS-EVENT available in TTY Serial buffer\n", ++ hciprintf(stderr, "%s: HCI-VS-EVENT available in TTY Serial buffer\n", + __FUNCTION__); + + return 1; +@@ -381,7 +381,7 @@ int read_vs_hci_event(int fd, unsigned char* buf, int size) + return -1; + } + +- fprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC\n", ++ hciprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC\n", + __FUNCTION__); + + /* Check whether data is available in TTY buffer before calling read() */ +@@ -425,7 +425,7 @@ int read_vs_hci_event(int fd, unsigned char* buf, int size) + } + count++; + +- fprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC, buf[0] - 0x%x\n", __FUNCTION__, buf[0]); ++ hciprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC, buf[0] - 0x%x\n", __FUNCTION__, buf[0]); + /* The next two bytes are the event code and parameter total length. */ + while (count < 3) { + r = read(fd, buf + count, 3 - count); +@@ -436,7 +436,7 @@ int read_vs_hci_event(int fd, unsigned char* buf, int size) + count += r; + } + +- fprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC, buf[1] - 0x%x\n", __FUNCTION__, buf[1]); ++ hciprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC, buf[1] - 0x%x\n", __FUNCTION__, buf[1]); + /* Now we read the parameters. */ + if (buf[2] < (size - 3)) + remain = buf[2]; +@@ -454,7 +454,7 @@ int read_vs_hci_event(int fd, unsigned char* buf, int size) + if(get_vs_hci_event(buf) != HCI_CMD_SUCCESS) + return -1; + +- fprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC, count - 0x%x\n", __FUNCTION__, count); ++ hciprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC, count - 0x%x\n", __FUNCTION__, count); + return count; + } + +@@ -477,7 +477,7 @@ int hci_send_vs_cmd(int fd, unsigned char *cmd, unsigned char *rsp, int size) + fprintf(stderr, "%s: Failed to get HCI-VS Event from SOC\n", __FUNCTION__); + goto failed; + } +- fprintf(stderr, "%s: Received HCI-Vendor Specific Event from SOC\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Received HCI-Vendor Specific Event from SOC\n", __FUNCTION__); + } + + failed: +@@ -507,8 +507,8 @@ void frame_hci_cmd_pkt( + case EDL_PATCH_SET_REQ_CMD: + /* Copy the patch header info as CMD params */ + memcpy(&cmd[5], phdr_buffer, PATCH_HDR_LEN); +- fprintf(stderr, "%s: Sending EDL_PATCH_SET_REQ_CMD\n", __FUNCTION__); +- fprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", ++ hciprintf(stderr, "%s: Sending EDL_PATCH_SET_REQ_CMD\n", __FUNCTION__); ++ hciprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", + segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]); + break; + case EDL_PATCH_DLD_REQ_CMD: +@@ -522,36 +522,36 @@ void frame_hci_cmd_pkt( + cmd[9] = EXTRACT_BYTE(p_base_addr, 3); + memcpy(&cmd[10], (pdata_buffer + offset), size); + +- fprintf(stderr, "%s: Sending EDL_PATCH_DLD_REQ_CMD: size: %d bytes\n", ++ hciprintf(stderr, "%s: Sending EDL_PATCH_DLD_REQ_CMD: size: %d bytes\n", + __FUNCTION__, size); +- fprintf(stderr, "HCI-CMD %d:\t0x%x\t0x%x\t0x%x\t0x%x\t0x%x\t0x%x\t0x%x\t" ++ hciprintf(stderr, "HCI-CMD %d:\t0x%x\t0x%x\t0x%x\t0x%x\t0x%x\t0x%x\t0x%x\t" + "0x%x\t0x%x\t0x%x\t\n", segtNo, cmd[0], cmd[1], cmd[2], + cmd[3], cmd[4], cmd[5], cmd[6], cmd[7], cmd[8], cmd[9]); + break; + case EDL_PATCH_ATCH_REQ_CMD: +- fprintf(stderr, "%s: Sending EDL_PATCH_ATTACH_REQ_CMD\n", __FUNCTION__); +- fprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", +- segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]); ++ hciprintf(stderr, "%s: Sending EDL_PATCH_ATTACH_REQ_CMD\n", __FUNCTION__); ++ hciprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", ++ segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]); + break; + case EDL_PATCH_RST_REQ_CMD: +- fprintf(stderr, "%s: Sending EDL_PATCH_RESET_REQ_CMD\n", __FUNCTION__); +- fprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", +- segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]); ++ hciprintf(stderr, "%s: Sending EDL_PATCH_RESET_REQ_CMD\n", __FUNCTION__); ++ hciprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", ++ segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]); + break; + case EDL_PATCH_VER_REQ_CMD: +- fprintf(stderr, "%s: Sending EDL_PATCH_VER_REQ_CMD\n", __FUNCTION__); +- fprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", +- segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]); +- break; ++ hciprintf(stderr, "%s: Sending EDL_PATCH_VER_REQ_CMD\n", __FUNCTION__); ++ hciprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", ++ segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]); ++ break; + case EDL_PATCH_TLV_REQ_CMD: +- fprintf(stderr, "%s: Sending EDL_PATCH_TLV_REQ_CMD\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Sending EDL_PATCH_TLV_REQ_CMD\n", __FUNCTION__); + /* Parameter Total Length */ + cmd[3] = size +2; + + /* TLV Segment Length */ + cmd[5] = size; +- fprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", +- segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5]); ++ hciprintf(stderr, "HCI-CMD %d:\t0x%x \t0x%x \t0x%x \t0x%x \t0x%x \t0x%x\n", ++ segtNo, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5]); + offset = (segtNo * MAX_SIZE_PER_TLV_SEGMENT); + memcpy(&cmd[6], (pdata_buffer + offset), size); + break; +@@ -601,14 +601,13 @@ void rome_extract_patch_header_info(unsigned char *buf) + rampatch_patch_info.patch_ctrl |= + (LSH(buf[index + P_CONTROL_OFFSET], (index * 8))); + +- fprintf(stderr, "PATCH_ID\t : 0x%x\n", rampatch_patch_info.patch_id); +- fprintf(stderr, "ROM_VERSION\t : 0x%x\n", rampatch_patch_info.patch_ver.rom_version); +- fprintf(stderr, "BUILD_VERSION\t : 0x%x\n", rampatch_patch_info.patch_ver.build_version); +- fprintf(stderr, "PATCH_LENGTH\t : 0x%x\n", rampatch_patch_info.patch_length); +- fprintf(stderr, "PATCH_CRC\t : 0x%x\n", rampatch_patch_info.patch_crc); +- fprintf(stderr, "PATCH_CONTROL\t : 0x%x\n", rampatch_patch_info.patch_ctrl); +- fprintf(stderr, "PATCH_BASE_ADDR\t : 0x%x\n", rampatch_patch_info.patch_base_addr); +- ++ hciprintf(stderr, "PATCH_ID\t : 0x%x\n", rampatch_patch_info.patch_id); ++ hciprintf(stderr, "ROM_VERSION\t : 0x%x\n", rampatch_patch_info.patch_ver.rom_version); ++ hciprintf(stderr, "BUILD_VERSION\t : 0x%x\n", rampatch_patch_info.patch_ver.build_version); ++ hciprintf(stderr, "PATCH_LENGTH\t : 0x%x\n", rampatch_patch_info.patch_length); ++ hciprintf(stderr, "PATCH_CRC\t : 0x%x\n", rampatch_patch_info.patch_crc); ++ hciprintf(stderr, "PATCH_CONTROL\t : 0x%x\n", rampatch_patch_info.patch_ctrl); ++ hciprintf(stderr, "PATCH_BASE_ADDR\t : 0x%x\n", rampatch_patch_info.patch_base_addr); + } + + int rome_edl_set_patch_request(int fd) +@@ -636,7 +635,7 @@ int rome_edl_set_patch_request(int fd) + fprintf(stderr, "%s: Failed to set patch info on Controller\n", __FUNCTION__); + goto error; + } +- fprintf(stderr, "%s: Successfully set patch info on the Controller\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Successfully set patch info on the Controller\n", __FUNCTION__); + error: + return err; + } +@@ -651,7 +650,7 @@ int rome_edl_patch_download_request(int fd) + + no_of_patch_segment = (rampatch_patch_info.patch_length / + MAX_DATA_PER_SEGMENT); +- fprintf(stderr, "%s: %d patch segments to be d'loaded from patch base addr: 0x%x\n", ++ hciprintf(stderr, "%s: %d patch segments to be d'loaded from patch base addr: 0x%x\n", + __FUNCTION__, no_of_patch_segment, + rampatch_patch_info.patch_base_addr); + +@@ -663,8 +662,7 @@ int rome_edl_patch_download_request(int fd) + * segments with a max. size of 239 bytes + */ + for (index = 1; index <= no_of_patch_segment; index++) { +- +- fprintf(stderr, "%s: Downloading patch segment: %d\n", __FUNCTION__, index); ++ hciprintf(stderr, "%s: Downloading patch segment: %d\n", __FUNCTION__, index); + + /* Frame the HCI CMD PKT to be sent to Controller*/ + frame_hci_cmd_pkt(cmd, EDL_PATCH_DLD_REQ_CMD, p_base_addr, +@@ -690,8 +688,9 @@ int rome_edl_patch_download_request(int fd) + __FUNCTION__, index); + goto error; + } +- fprintf(stderr, "%s: Successfully downloaded patch segment: %d\n", +- __FUNCTION__, index); ++ ++ hciprintf(stderr, "%s: Successfully downloaded patch segment: %d\n", ++ __FUNCTION__, index); + } + + /* Check if any pending patch data to be sent */ +@@ -725,8 +724,8 @@ int rome_edl_patch_download_request(int fd) + goto error; + } + +- fprintf(stderr, "%s: Successfully downloaded patch segment: %d\n", +- __FUNCTION__, index); ++ hciprintf(stderr, "%s: Successfully downloaded patch segment: %d\n", ++ __FUNCTION__, index); + } + + error: +@@ -740,7 +739,7 @@ static int rome_download_rampatch(int fd) + fprintf(stderr, "%s:\n", __FUNCTION__); + + /* Get handle to the RAMPATCH binary file */ +- fprintf(stderr, "%s: Getting handle to the RAMPATCH binary file from %s\n", __FUNCTION__, ROME_FW_PATH); ++ hciprintf(stderr, "%s: Getting handle to the RAMPATCH binary file from %s\n", __FUNCTION__, ROME_FW_PATH); + file = fopen(ROME_FW_PATH, "r"); + if (file == NULL) { + fprintf(stderr, "%s: Failed to get handle to the RAMPATCH bin file!\n", +@@ -749,7 +748,7 @@ static int rome_download_rampatch(int fd) + } + + /* Allocate memory for the patch headder info */ +- fprintf(stderr, "%s: Allocating memory for the patch header\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Allocating memory for the patch header\n", __FUNCTION__); + phdr_buffer = (unsigned char *) malloc(PATCH_HDR_LEN + 1); + if (phdr_buffer == NULL) { + fprintf(stderr, "%s: Failed to allocate memory for patch header\n", +@@ -760,7 +759,7 @@ static int rome_download_rampatch(int fd) + phdr_buffer[index] = 0x0; + + /* Read 28 bytes of patch header information */ +- fprintf(stderr, "%s: Reading patch header info\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Reading patch header info\n", __FUNCTION__); + index = 0; + do { + c = fgetc (file); +@@ -768,7 +767,7 @@ static int rome_download_rampatch(int fd) + } while (index != PATCH_HDR_LEN); + + /* Save the patch header info into local structure */ +- fprintf(stderr, "%s: Saving patch hdr. info\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Saving patch hdr. info\n", __FUNCTION__); + rome_extract_patch_header_info((unsigned char *)phdr_buffer); + + /* Set the patch header info onto the Controller */ +@@ -779,7 +778,7 @@ static int rome_download_rampatch(int fd) + } + + /* Allocate memory for the patch payload */ +- fprintf(stderr, "%s: Allocating memory for patch payload\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Allocating memory for patch payload\n", __FUNCTION__); + size = rampatch_patch_info.patch_length; + pdata_buffer = (unsigned char *) malloc(size+1); + if (pdata_buffer == NULL) { +@@ -791,7 +790,7 @@ static int rome_download_rampatch(int fd) + pdata_buffer[index] = 0x0; + + /* Read the patch data from Rampatch binary image */ +- fprintf(stderr, "%s: Reading patch payload from RAMPATCH file\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Reading patch payload from RAMPATCH file\n", __FUNCTION__); + index = 0; + do { + c = fgetc (file); +@@ -924,7 +923,7 @@ int rome_get_tlv_file(char *file_path, unsigned char * bdaddr) + unsigned char *nvm_byte_ptr; + unsigned short pcm_value, ibs_value; + +- fprintf(stderr, "File Open (%s)\n", file_path); ++ hciprintf(stderr, "File Open (%s)\n", file_path); + pFile = fopen ( file_path , "r" ); + if (pFile==NULL) {; + fprintf(stderr, "%s File Open Fail\n", file_path); +@@ -967,30 +966,30 @@ int rome_get_tlv_file(char *file_path, unsigned char * bdaddr) + gtlv_dwndcfg = ptlv_header->tlv.patch.dwnd_cfg; + + if(ptlv_header->tlv_type == TLV_TYPE_PATCH){ +- fprintf(stderr, "====================================================\n"); +- fprintf(stderr, "TLV Type\t\t\t : 0x%x\n", ptlv_header->tlv_type); +- fprintf(stderr, "Length\t\t\t : %d bytes\n", (ptlv_header->tlv_length1) | +- (ptlv_header->tlv_length2 << 8) | +- (ptlv_header->tlv_length3 << 16)); +- fprintf(stderr, "Total Length\t\t\t : %d bytes\n", ptlv_header->tlv.patch.tlv_data_len); +- fprintf(stderr, "Patch Data Length\t\t\t : %d bytes\n",ptlv_header->tlv.patch.tlv_patch_data_len); +- fprintf(stderr, "Signing Format Version\t : 0x%x\n", ptlv_header->tlv.patch.sign_ver); +- fprintf(stderr, "Signature Algorithm\t\t : 0x%x\n", ptlv_header->tlv.patch.sign_algorithm); +- fprintf(stderr, "Event Handling\t\t\t : 0x%x", ptlv_header->tlv.patch.dwnd_cfg); +- fprintf(stderr, "Reserved\t\t\t : 0x%x\n", ptlv_header->tlv.patch.reserved1); +- fprintf(stderr, "Product ID\t\t\t : 0x%04x\n", ptlv_header->tlv.patch.prod_id); +- fprintf(stderr, "Rom Build Version\t\t : 0x%04x\n", ptlv_header->tlv.patch.build_ver); +- fprintf(stderr, "Patch Version\t\t : 0x%04x\n", ptlv_header->tlv.patch.patch_ver); +- fprintf(stderr, "Reserved\t\t\t : 0x%x\n", ptlv_header->tlv.patch.reserved2); +- fprintf(stderr, "Patch Entry Address\t\t : 0x%x\n", (ptlv_header->tlv.patch.patch_entry_addr)); +- fprintf(stderr, "====================================================\n"); +- ++ hciprintf(stderr, "====================================================\n"); ++ hciprintf(stderr, "TLV Type\t\t\t : 0x%x\n", ptlv_header->tlv_type); ++ hciprintf(stderr, "Length\t\t\t : %d bytes\n", (ptlv_header->tlv_length1) | ++ (ptlv_header->tlv_length2 << 8) | ++ (ptlv_header->tlv_length3 << 16)); ++ hciprintf(stderr, "Total Length\t\t\t : %d bytes\n", ptlv_header->tlv.patch.tlv_data_len); ++ hciprintf(stderr, "Patch Data Length\t\t\t : %d bytes\n",ptlv_header->tlv.patch.tlv_patch_data_len); ++ hciprintf(stderr, "Signing Format Version\t : 0x%x\n", ptlv_header->tlv.patch.sign_ver); ++ hciprintf(stderr, "Signature Algorithm\t\t : 0x%x\n", ptlv_header->tlv.patch.sign_algorithm); ++ hciprintf(stderr, "Event Handling\t\t\t : 0x%x", ptlv_header->tlv.patch.dwnd_cfg); ++ hciprintf(stderr, "Reserved\t\t\t : 0x%x\n", ptlv_header->tlv.patch.reserved1); ++ hciprintf(stderr, "Product ID\t\t\t : 0x%04x\n", ptlv_header->tlv.patch.prod_id); ++ hciprintf(stderr, "Rom Build Version\t\t : 0x%04x\n", ptlv_header->tlv.patch.build_ver); ++ hciprintf(stderr, "Patch Version\t\t : 0x%04x\n", ptlv_header->tlv.patch.patch_ver); ++ hciprintf(stderr, "Reserved\t\t\t : 0x%x\n", ptlv_header->tlv.patch.reserved2); ++ hciprintf(stderr, "Patch Entry Address\t\t : 0x%x\n", (ptlv_header->tlv.patch.patch_entry_addr)); ++ hciprintf(stderr, "====================================================\n"); + } else if(ptlv_header->tlv_type == TLV_TYPE_NVM) { +- fprintf(stderr, "====================================================\n"); +- fprintf(stderr, "TLV Type\t\t\t : 0x%x\n", ptlv_header->tlv_type); +- fprintf(stderr, "Length\t\t\t : %d bytes\n", nvm_length = (ptlv_header->tlv_length1) | +- (ptlv_header->tlv_length2 << 8) | +- (ptlv_header->tlv_length3 << 16)); ++ nvm_length = (ptlv_header->tlv_length1) | ++ (ptlv_header->tlv_length2 << 8) | ++ (ptlv_header->tlv_length3 << 16); ++ hciprintf(stderr, "====================================================\n"); ++ hciprintf(stderr, "TLV Type\t\t\t : 0x%x\n", ptlv_header->tlv_type); ++ hciprintf(stderr, "Length\t\t\t : %d bytes\n", nvm_length); + + if(nvm_length <= 0) + return readSize; +@@ -998,11 +997,11 @@ int rome_get_tlv_file(char *file_path, unsigned char * bdaddr) + for(nvm_byte_ptr=(unsigned char *)(nvm_ptr = &(ptlv_header->tlv.nvm)), nvm_index=0; + nvm_index < nvm_length ; nvm_ptr = (tlv_nvm_hdr *) nvm_byte_ptr) + { +- fprintf(stderr, "TAG ID\t\t\t : %d\n", nvm_ptr->tag_id); +- fprintf(stderr, "TAG Length\t\t\t : %d\n", nvm_tag_len = nvm_ptr->tag_len); +- fprintf(stderr, "TAG Pointer\t\t\t : %d\n", nvm_ptr->tag_ptr); +- fprintf(stderr, "TAG Extended Flag\t\t : %d\n", nvm_ptr->tag_ex_flag); +- ++ nvm_tag_len = nvm_ptr->tag_len; ++ hciprintf(stderr, "TAG ID\t\t\t : %d\n", nvm_ptr->tag_id); ++ hciprintf(stderr, "TAG Length\t\t\t : %d\n", nvm_tag_len); ++ hciprintf(stderr, "TAG Pointer\t\t\t : %d\n", nvm_ptr->tag_ptr); ++ hciprintf(stderr, "TAG Extended Flag\t\t : %d\n", nvm_ptr->tag_ex_flag); + /* Increase nvm_index to NVM data */ + nvm_index+=sizeof(tlv_nvm_hdr); + nvm_byte_ptr+=sizeof(tlv_nvm_hdr); +@@ -1058,7 +1057,7 @@ int rome_get_tlv_file(char *file_path, unsigned char * bdaddr) + snprintf((char *) data_buf, PRINT_BUF_SIZE, "%s%.02x ", + (char *)data_buf, *(nvm_byte_ptr + i)); + +- fprintf(stderr, "TAG Data\t\t\t : %s\n", data_buf); ++ hciprintf(stderr, "TAG Data\t\t\t : %s\n", data_buf); + + /* Clear buffer */ + memset(data_buf, 0x0, PRINT_BUF_SIZE); +@@ -1068,7 +1067,7 @@ int rome_get_tlv_file(char *file_path, unsigned char * bdaddr) + nvm_byte_ptr +=nvm_ptr->tag_len; + } + +- fprintf(stderr, "====================================================\n"); ++ hciprintf(stderr, "====================================================\n"); + + } else { + fprintf(stderr, "TLV Header type is unknown (%d) \n", ptlv_header->tlv_type); +@@ -1083,7 +1082,7 @@ int rome_tlv_dnld_segment(int fd, int index, int seg_size, unsigned char wait_cc + unsigned char cmd[HCI_MAX_CMD_SIZE]; + unsigned char rsp[HCI_MAX_EVENT_SIZE]; + +- fprintf(stderr, "%s: Downloading TLV Patch segment no.%d, size:%d wait_cc_evt = 0x%x\n", __FUNCTION__, index, seg_size, wait_cc_evt); ++ hciprintf(stderr, "%s: Downloading TLV Patch segment no.%d, size:%d wait_cc_evt = 0x%x\n", __FUNCTION__, index, seg_size, wait_cc_evt); + + /* Frame the HCI CMD PKT to be sent to Controller*/ + frame_hci_cmd_pkt(cmd, EDL_PATCH_TLV_REQ_CMD, 0, index, seg_size); +@@ -1109,7 +1108,7 @@ int rome_tlv_dnld_segment(int fd, int index, int seg_size, unsigned char wait_cc + } + } + +- fprintf(stderr, "%s: Successfully downloaded patch segment: %d\n", __FUNCTION__, index); ++ hciprintf(stderr, "%s: Successfully downloaded patch segment: %d\n", __FUNCTION__, index); + return err; + } + +@@ -1123,7 +1122,7 @@ int rome_tlv_dnld_req(int fd, int tlv_size) + remain_size = (tlv_size < MAX_SIZE_PER_TLV_SEGMENT)?\ + tlv_size: (tlv_size%MAX_SIZE_PER_TLV_SEGMENT); + +- fprintf(stderr, "%s: TLV size: %d, Total Seg num: %d, remain size: %d\n", ++ hciprintf(stderr, "%s: TLV size: %d, Total Seg num: %d, remain size: %d\n", + __FUNCTION__,tlv_size, total_segment, remain_size); + + if (gTlv_type == TLV_TYPE_PATCH) { +@@ -1137,12 +1136,12 @@ int rome_tlv_dnld_req(int fd, int tlv_size) + case ROME_SKIP_EVT_NONE: + wait_vsc_evt = TRUE; + wait_cc_evt = TRUE; +- fprintf(stderr, "%s: Event handling type: ROME_SKIP_EVT_NONE", __func__); ++ hciprintf(stderr, "%s: Event handling type: ROME_SKIP_EVT_NONE", __func__); + break; + case ROME_SKIP_EVT_VSE_CC: + wait_vsc_evt = FALSE; + wait_cc_evt = FALSE; +- fprintf(stderr, "%s: Event handling type: ROME_SKIP_EVT_VSE_CC", __func__); ++ hciprintf(stderr, "%s: Event handling type: ROME_SKIP_EVT_VSE_CC", __func__); + break; + /* Not handled for now */ + case ROME_SKIP_EVT_VSE: +@@ -1479,14 +1478,14 @@ int rome_1_0_nvm_tag_dnld(int fd) + }; + #endif + +- fprintf(stderr, "%s: Start sending NVM Tags (ver: 0x%x)\n", __FUNCTION__, (unsigned int) NVM_VERSION); ++ hciprintf(stderr, "%s: Start sending NVM Tags (ver: 0x%x)\n", __FUNCTION__, (unsigned int) NVM_VERSION); + + for (i=0; (i < MAX_TAG_CMD) && (cmds[i][0] != TAG_END); i++) + { + /* Write BD Address */ + if(cmds[i][TAG_NUM_OFFSET] == TAG_NUM_2){ + memcpy(&cmds[i][TAG_BDADDR_OFFSET], vnd_local_bd_addr, 6); +- fprintf(stderr, "BD Address: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", ++ hciprintf(stderr, "BD Address: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + cmds[i][TAG_BDADDR_OFFSET ], cmds[i][TAG_BDADDR_OFFSET + 1], + cmds[i][TAG_BDADDR_OFFSET + 2], cmds[i][TAG_BDADDR_OFFSET + 3], + cmds[i][TAG_BDADDR_OFFSET + 4], cmds[i][TAG_BDADDR_OFFSET + 5]); +@@ -1598,7 +1597,7 @@ int rome_set_baudrate_req(int fd, int local_baud_rate, + flow_control(fd, MSM_DISABLE_FLOW_CTRL); + + /* Send the HCI command packet to UART for transmission */ +- fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3],cmd[4]) ; ++ hciprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3],cmd[4]) ; + err = write(fd, cmd, size); + if (err != size) { + fprintf(stderr, "%s: Send failed with ret value: %d\n", __FUNCTION__, err); +@@ -1616,7 +1615,7 @@ int rome_set_baudrate_req(int fd, int local_baud_rate, + goto error; + } + +- fprintf(stderr, "%s: Received HCI-Vendor Specific Event from SOC\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Received HCI-Vendor Specific Event from SOC\n", __FUNCTION__); + + /* Wait for command complete event */ + err = read_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE); +@@ -1624,7 +1623,6 @@ int rome_set_baudrate_req(int fd, int local_baud_rate, + fprintf(stderr, "%s: Failed to set patch info on Controller\n", __FUNCTION__); + goto error; + } +- fprintf(stderr, "%s\n", __FUNCTION__); + error: + return err; + +@@ -1639,7 +1637,7 @@ int rome_hci_reset_req(int fd, char baud, int hwfc) + hci_command_hdr *cmd_hdr; + int flags; + +- fprintf(stderr, "%s: HCI RESET \n", __FUNCTION__); ++ hciprintf(stderr, "%s: HCI RESET \n", __FUNCTION__); + + memset(cmd, 0x0, HCI_MAX_CMD_SIZE); + +@@ -1656,7 +1654,7 @@ int rome_hci_reset_req(int fd, char baud, int hwfc) + flow_control(fd, MSM_DISABLE_FLOW_CTRL); + + /* Send the HCI command packet to UART for transmission */ +- fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3]); ++ hciprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3]); + err = write(fd, cmd, size); + if (err != size) { + fprintf(stderr, "%s: Send failed with ret value: %d\n", __FUNCTION__, err); +@@ -1768,28 +1766,28 @@ int qca_soc_init(int fd, int speed, char *bdaddr , struct termios * ti) + goto error; + } + +- fprintf(stderr, "%s: Rome Version (0x%08x)\n", __FUNCTION__, rome_ver); ++ hciprintf(stderr, "%s: Rome Version (0x%08x)\n", __FUNCTION__, rome_ver); + + switch (rome_ver){ + case ROME_VER_1_0: + { + /* Set and Download the RAMPATCH */ +- fprintf(stderr, "%s: Setting Patch Header & Downloading Patches\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Setting Patch Header & Downloading Patches\n", __FUNCTION__); + err = rome_download_rampatch(fd); + if (err < 0) { + fprintf(stderr, "%s: DOWNLOAD RAMPATCH failed!\n", __FUNCTION__); + goto error; + } +- fprintf(stderr, "%s: DOWNLOAD RAMPTACH complete\n", __FUNCTION__); ++ hciprintf(stderr, "%s: DOWNLOAD RAMPTACH complete\n", __FUNCTION__); + + /* Attach the RAMPATCH */ +- fprintf(stderr, "%s: Attaching the patches\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Attaching the patches\n", __FUNCTION__); + err = rome_attach_rampatch(fd); + if (err < 0) { + fprintf(stderr, "%s: ATTACH RAMPATCH failed!\n", __FUNCTION__); + goto error; + } +- fprintf(stderr, "%s: ATTACH RAMPTACH complete\n", __FUNCTION__); ++ hciprintf(stderr, "%s: ATTACH RAMPTACH complete\n", __FUNCTION__); + + /* Send Reset */ + size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + EDL_PATCH_CMD_LEN); +@@ -1800,7 +1798,7 @@ int qca_soc_init(int fd, int speed, char *bdaddr , struct termios * ti) + } + + /* NVM download */ +- fprintf(stderr, "%s: Downloading NVM\n", __FUNCTION__); ++ hciprintf(stderr, "%s: Downloading NVM\n", __FUNCTION__); + err = rome_1_0_nvm_tag_dnld(fd); + if ( err <0 ) { + fprintf(stderr, "Downloading NVM Failed !!\n"); +@@ -1817,7 +1815,7 @@ int qca_soc_init(int fd, int speed, char *bdaddr , struct termios * ti) + } + } + +- fprintf(stderr, "HCI Reset is done\n"); ++ hciprintf(stderr, "HCI Reset is done\n"); + } + break; + case ROME_VER_1_1: +@@ -1874,7 +1872,7 @@ download: + fprintf(stderr, "%s: Download TLV file failed!\n", __FUNCTION__); + goto error; + } +- fprintf(stderr, "%s: Download TLV file successfully \n", __FUNCTION__); ++ hciprintf(stderr, "%s: Download TLV file successfully \n", __FUNCTION__); + + /* + * Overriding the baud rate value in NVM file with the user +@@ -1893,7 +1891,7 @@ download: + fprintf(stderr, "HCI Reset Failed !!!\n"); + goto error; + } +- fprintf(stderr, "HCI Reset is done\n"); ++ hciprintf(stderr, "HCI Reset is done\n"); + + break; + case ROME_VER_UNKNOWN: diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend index 02ac853df..2bb3bf356 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend @@ -29,6 +29,9 @@ SRC_URI_append_ccimx6ul = " \ file://0019-bluetooth-Fix-flow-control-operation.patch \ file://0020-Adding-MDM-specific-code-under-_PLATFORM_MDM_.patch \ file://0021-Bluetooth-Fix-static-analysis-issues.patch \ + file://0022-hciattach_rome-Respect-the-user-indication-for-noflo.patch \ + file://0023-hciattach-If-the-user-supplies-a-bdaddr-use-it.patch \ + file://0024-hciattach-Add-verbosity-option.patch \ " inherit update-rc.d From d776c9c282f77dad80d3af9f625016b65a0326ba Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 6 Apr 2017 13:27:19 +0200 Subject: [PATCH 06/95] meta-digi-dey: bluez5-5.41: ccimx6ul: Rewrite bluetooth-init The following changes have been made to the bluetooth-init script: * Remove "hciconfig hci0 up/down" and this is now deprecated and likely to fail. We use the AutoEnable feature of bluetoothd for this now. * Move setting the MAC address to hciattach instead of using hcitool. * Remove resets performed by hcitool and hciconfig. The hciattach application already performs a reset and that should suffice. * Remove hciattach retries. https://jira.digi.com/browse/DEL-3711 https://jira.digi.com/browse/DEL-3436 https://jira.digi.com/browse/DEL-3636 https://jira.digi.com/browse/DEL-3955 Signed-off-by: Alex Gonzalez --- .../bluez/bluez5-5.41/ccimx6ul/bluetooth-init | 72 +++---------------- 1 file changed, 9 insertions(+), 63 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init index b325cc9fa..2219ab7a6 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init @@ -67,66 +67,13 @@ bluetooth_init() { # Start the Bluetooth driver and bring up the interface HCIATTACH_LOG="/var/log/hciattach.log" - BT_CMD="HCIATTACH" - RETRIES="5" - while [ "${RETRIES}" -gt "0" ]; do - case "${BT_CMD}" in - HCIATTACH) - # Reset BT - killproc hciattach - powercycle_gpio "${BT_EN_QCA_GPIO_NR}" - if hciattach ttyBt qca ${BT_RATE:-3000000} ${BT_FLOW:-flow} >${HCIATTACH_LOG} 2>&1; then - BT_CMD="HCICONFIG_UP" - else - BT_ERROR="FAILED (hciattach)" - BT_CMD="BT_INIT_FAIL" - fi - ;; - HCICONFIG_UP) - if hciconfig hci0 up; then - BT_CMD="HCITOOL_SETMAC" - else - BT_ERROR="FAILED (hciconfig up)" - BT_CMD="BT_INIT_FAIL" - fi - ;; - HCITOOL_SETMAC) - # - # Set the MAC address (the interface needs to be up to send HCI commands) - # - # Convert it to the format accepted by 'hcitool' ("00:04:F3:11:22:33" -> "33 22 11 F3 04 00") - # - HCI_MACADDR="$(echo ${BT_MACADDR} | tr ':' '\n' | tac | tr '\n' ' ' | sed -e 's/ $//g')" - if hcitool -i hci0 cmd 3F 000B 01 02 06 ${HCI_MACADDR} >/dev/null; then - BT_CMD="HCITOOL_RESET" - else - BT_ERROR="FAILED (hcitool set MAC)" - BT_CMD="BT_INIT_FAIL" - fi - ;; - HCITOOL_RESET) - if hcitool -i hci0 cmd 03 0003 00 >/dev/null; then - BT_CMD="HCICONFIG_RESET" - else - BT_ERROR="FAILED (hcitool reset)" - BT_CMD="BT_INIT_FAIL" - fi - ;; - HCICONFIG_RESET) - if hciconfig hci0 reset; then - break - else - BT_ERROR="FAILED (hciconfig reset)" - BT_CMD="BT_INIT_FAIL" - fi - ;; - BT_INIT_FAIL) - RETRIES="$((RETRIES - 1))" - BT_CMD="HCIATTACH" - ;; - esac - done - [ "${RETRIES}" = "0" ] && error "${BT_ERROR}" + killproc hciattach + powercycle_gpio "${BT_EN_QCA_GPIO_NR}" + if hciattach ttyBt qca ${BT_RATE:-3000000} -t30 ${BT_FLOW:-flow} unused ${BT_MACADDR} >${HCIATTACH_LOG} 2>&1; then + echo "[OK]" + else + echo "[FAIL]" + fi } # Source function library @@ -137,17 +84,16 @@ case "$1" in if [ -d "/proc/device-tree/bluetooth" ]; then echo -n "Starting bluetooth hardware: " bluetooth_init - echo "done." + echo "${BT_ERROR:-done.}" fi ;; stop) if [ -d "/sys/class/bluetooth/hci0" ]; then echo -n "Stopping bluetooth hardware: " - hciconfig hci0 down || BT_ERROR="FAILED (hciconfig down)" killproc hciattach # Power down bluetooth set_gpio_value "${BT_EN_QCA_GPIO_NR}" 0 - echo "${BT_ERROR:-done.}" + echo "done." fi ;; restart) From 02730dcdabd06aac399c5b7cbdc8318d51372b08 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Thu, 27 Apr 2017 11:21:14 +0200 Subject: [PATCH 07/95] sysinfo: add meta-digi revision Signed-off-by: Diaz de Grenu, Jose --- meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo index bc65b5ba2..c09669029 100755 --- a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo +++ b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo @@ -275,6 +275,7 @@ printf "\n\n" echo "|| U-Boot | ${UBOOT_VERSION}" echo "|| Firmware | ${DISTRO}-${DEY_VERSION}-$(cat /etc/version)" echo "|| Kernel | $(uname -a)" + echo "|| meta-digi | $(sed -ne '/^meta-digi-dey/s,.*= \(.*\)$,\1,g;T;p' /etc/build)" [ -n "${MCA_VERSION}" ] && echo "|| Kinetis | ${MCA_VERSION}" [ -n "${IOEXP_VERSION}" ] && echo "|| I/O Expander | ${IOEXP_VERSION}" printf "\n\n" From c1762b40f53f12992e75bf53cd1d0e6273eee92e Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 4 May 2017 17:24:25 +0200 Subject: [PATCH 08/95] modemmanager: add support for u-blox based XBee Cellular Add patch to MM, so it detects the U-Blox modem connected to the XBee socket. https://jira.digi.com/browse/DEL-4084 Signed-off-by: Javier Viguera --- ...port-modems-connected-to-serial-port.patch | 32 +++++++++++++++++++ .../modemmanager/modemmanager_git.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch new file mode 100644 index 000000000..8d25e6036 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch @@ -0,0 +1,32 @@ +From: Javier Viguera +Date: Thu, 4 May 2017 17:03:37 +0200 +Subject: [PATCH] ublox: support modems connected to serial port + +Add the vendor string, so it can be probed via AT commands. This allows +to support modems that are connected to a serial port. + +Upstream-Status: Pending + +Signed-off-by: Javier Viguera +--- + plugins/ublox/mm-plugin-ublox.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/plugins/ublox/mm-plugin-ublox.c b/plugins/ublox/mm-plugin-ublox.c +index 890f520754aa..0ca74d903f88 100644 +--- a/plugins/ublox/mm-plugin-ublox.c ++++ b/plugins/ublox/mm-plugin-ublox.c +@@ -66,11 +66,13 @@ mm_plugin_create (void) + { + static const gchar *subsystems[] = { "tty", "net", NULL }; + static const guint16 vendor_ids[] = { 0x1546, 0 }; ++ static const gchar *vendor_strings[] = { "u-blox", NULL }; + + return MM_PLUGIN (g_object_new (MM_TYPE_PLUGIN_UBLOX, + MM_PLUGIN_NAME, "u-blox", + MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, + MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, ++ MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings, + MM_PLUGIN_ALLOWED_AT, TRUE, + MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe, + NULL)); diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb index 620720075..064e68dc8 100644 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb @@ -15,6 +15,7 @@ PV = "1.7.0+git${SRCPV}" SRC_URI = " \ git://anongit.freedesktop.org/git/ModemManager/ModemManager.git;protocol=https \ file://0001-configure.ac-add-foreign-automake-option.patch \ + file://0002-ublox-support-modems-connected-to-serial-port.patch \ file://0003-port-serial-add-B230400-and-B921600-missing-baudrate.patch \ " SRCREV = "d09bc8baaa9fe93a72bb715530b1403a7a81c891" From f7dbce692322a85f2b5c3143526755d9a2e6baa1 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 5 May 2017 15:54:28 +0200 Subject: [PATCH 09/95] README: bump version for 2.2-r2 Add the support for Digi XBee Cellular 3G Global in the changelog. Signed-off-by: Javier Viguera --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ef239754..4bede6af3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Digi Embedded Yocto (DEY) 2.2 -## Release 2.2-r1 +## Release 2.2-r2 This document provides information about Digi Embedded Yocto, Digi International's professional embedded Yocto development environment. @@ -62,6 +62,11 @@ Documentation is available online on the Digi documentation site: # Release Changelog +## 2.2-r2 + +* Digi Embedded Yocto + * Added support for Digi XBee Cellular 3G Global, with P/N XBC-M5-UT-001 + ## 2.2-r1 * Release based on [Yocto 2.2 (Morty)](https://www.yoctoproject.org/downloads/core/morty22) including: From a2063b11a349a4ef542b7f4788eddb19fc615760 Mon Sep 17 00:00:00 2001 From: Salvador Penalva Date: Thu, 11 May 2017 09:55:41 +0200 Subject: [PATCH 10/95] modemmanager: update to fix QMI bug and add Ublox patches for XBee QMI modems didn't work with the version of modemmanager that the dey-2.2-r1 release was using. We were using two patches for uBlox plugin to use XBee Cellular 3G that are now merged in modemmanager master. This updates modemmanager to use the commit where QMI problem was fixed and also include uBlox patches. https://jira.digi.com/browse/DEL-4192 Signed-off-by: Salvador Penalva --- ...port-modems-connected-to-serial-port.patch | 32 ------------------ ...B230400-and-B921600-missing-baudrate.patch | 33 ------------------- .../modemmanager/modemmanager_git.bb | 4 +-- 3 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch delete mode 100644 meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0003-port-serial-add-B230400-and-B921600-missing-baudrate.patch diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch deleted file mode 100644 index 8d25e6036..000000000 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0002-ublox-support-modems-connected-to-serial-port.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Javier Viguera -Date: Thu, 4 May 2017 17:03:37 +0200 -Subject: [PATCH] ublox: support modems connected to serial port - -Add the vendor string, so it can be probed via AT commands. This allows -to support modems that are connected to a serial port. - -Upstream-Status: Pending - -Signed-off-by: Javier Viguera ---- - plugins/ublox/mm-plugin-ublox.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/plugins/ublox/mm-plugin-ublox.c b/plugins/ublox/mm-plugin-ublox.c -index 890f520754aa..0ca74d903f88 100644 ---- a/plugins/ublox/mm-plugin-ublox.c -+++ b/plugins/ublox/mm-plugin-ublox.c -@@ -66,11 +66,13 @@ mm_plugin_create (void) - { - static const gchar *subsystems[] = { "tty", "net", NULL }; - static const guint16 vendor_ids[] = { 0x1546, 0 }; -+ static const gchar *vendor_strings[] = { "u-blox", NULL }; - - return MM_PLUGIN (g_object_new (MM_TYPE_PLUGIN_UBLOX, - MM_PLUGIN_NAME, "u-blox", - MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems, - MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids, -+ MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings, - MM_PLUGIN_ALLOWED_AT, TRUE, - MM_PLUGIN_CUSTOM_AT_PROBE, custom_at_probe, - NULL)); diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0003-port-serial-add-B230400-and-B921600-missing-baudrate.patch b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0003-port-serial-add-B230400-and-B921600-missing-baudrate.patch deleted file mode 100644 index 2eedc9ea2..000000000 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0003-port-serial-add-B230400-and-B921600-missing-baudrate.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Javier Viguera -Date: Wed, 19 Apr 2017 14:13:56 +0200 -Subject: [PATCH] port-serial: add B230400 and B921600 missing baudrates - -So MM can use them when opening a specific serial port. - -Upstream-Status: Pending - -Signed-off-by: Javier Viguera ---- - src/mm-port-serial.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/mm-port-serial.c b/src/mm-port-serial.c -index 04ab17fe1675..b6359d28acd3 100644 ---- a/src/mm-port-serial.c -+++ b/src/mm-port-serial.c -@@ -260,9 +260,15 @@ parse_baudrate (guint baudrate_num, - case 115200: - speed = B115200; - break; -+ case 230400: -+ speed = B230400; -+ break; - case 460800: - speed = B460800; - break; -+ case 921600: -+ speed = B921600; -+ break; - default: - return FALSE; - } diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb index 064e68dc8..623a8db0a 100644 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_git.bb @@ -15,10 +15,8 @@ PV = "1.7.0+git${SRCPV}" SRC_URI = " \ git://anongit.freedesktop.org/git/ModemManager/ModemManager.git;protocol=https \ file://0001-configure.ac-add-foreign-automake-option.patch \ - file://0002-ublox-support-modems-connected-to-serial-port.patch \ - file://0003-port-serial-add-B230400-and-B921600-missing-baudrate.patch \ " -SRCREV = "d09bc8baaa9fe93a72bb715530b1403a7a81c891" +SRCREV = "d41d717112e6a183a0df510c210e80a86fc11060" S = "${WORKDIR}/git" From 0dbe44072f2ac51078455e9de308aeb5343892b3 Mon Sep 17 00:00:00 2001 From: Salvador Penalva Date: Thu, 11 May 2017 10:00:42 +0200 Subject: [PATCH 11/95] README: add support for EC-25 and U-Blox L200/L-210 Signed-off-by: Salvador Penalva --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4bede6af3..03c496f14 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ Documentation is available online on the Digi documentation site: * Digi Embedded Yocto * Added support for Digi XBee Cellular 3G Global, with P/N XBC-M5-UT-001 + * Added support for U-Blox TOBY L-200/L-210 + * Added support for Quectel EC-25 ## 2.2-r1 From b1d3b02cd93d8e2357257b00b632e165d77ef272 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Thu, 27 Apr 2017 20:03:18 +0200 Subject: [PATCH 12/95] meta-digi-dey: add mbedtls recipe mbedTLS is an open source, portable, easy to use, readable and flexible SSL library. https://jira.digi.com/browse/DEL-4101 Signed-off-by: Tatiana Leon --- ...-mbedtls-library-add-pkg-config-file.patch | 41 ++++++++++++++++ .../mbedtls/mbedtls_2.1.1.bb | 47 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/mbedtls/mbedtls-2.1.1/0001-mbedtls-library-add-pkg-config-file.patch create mode 100644 meta-digi-dey/recipes-connectivity/mbedtls/mbedtls_2.1.1.bb diff --git a/meta-digi-dey/recipes-connectivity/mbedtls/mbedtls-2.1.1/0001-mbedtls-library-add-pkg-config-file.patch b/meta-digi-dey/recipes-connectivity/mbedtls/mbedtls-2.1.1/0001-mbedtls-library-add-pkg-config-file.patch new file mode 100644 index 000000000..e6c74a08f --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/mbedtls/mbedtls-2.1.1/0001-mbedtls-library-add-pkg-config-file.patch @@ -0,0 +1,41 @@ +From: Tatiana Leon +Date: Fri, 28 Apr 2017 14:47:43 +0200 +Subject: [PATCH] mbedtls library: add pkg-config file + +Signed-off-by: Tatiana Leon +--- + CMakeLists.txt | 4 ++++ + mbedtls.pc.in | 12 ++++++++++++ + 2 files changed, 16 insertions(+) + create mode 100644 mbedtls.pc.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 094d906..b662eee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,3 +124,7 @@ if(ENABLE_TESTING) + ) + endif(UNIX) + endif() ++ ++SET(prefix ${CMAKE_INSTALL_PREFIX}) ++CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/mbedtls.pc.in ${CMAKE_BINARY_DIR}/mbedtls.pc @ONLY) ++INSTALL(FILES ${CMAKE_BINARY_DIR}/mbedtls.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) +diff --git a/mbedtls.pc.in b/mbedtls.pc.in +new file mode 100644 +index 0000000..9eff4ac +--- /dev/null ++++ b/mbedtls.pc.in +@@ -0,0 +1,12 @@ ++prefix=@prefix@ ++exec_prefix=${prefix} ++libdir=${exec_prefix}/lib ++includedir=${prefix}/include ++ ++Name: mbedtls ++Description: Light-weight open source cryptographic and SSL/TLS library ++Version: 2.1.1 ++ ++Libs: -L${libdir} -lmbedtls -lmbedcrypto -lmbedx509 ++Cflags: -I${includedir}/mbedtls ++ diff --git a/meta-digi-dey/recipes-connectivity/mbedtls/mbedtls_2.1.1.bb b/meta-digi-dey/recipes-connectivity/mbedtls/mbedtls_2.1.1.bb new file mode 100644 index 000000000..624d256f1 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/mbedtls/mbedtls_2.1.1.bb @@ -0,0 +1,47 @@ +# Copyright (C) 2017 Digi International. + +SUMMARY = "An open source, portable, easy to use, readable and flexible SSL \ +library" +DESCRIPTION = "mbedtls is a lean open source crypto library \ +for providing SSL and TLS support in your programs. It offers \ +an intuitive API and documented header files, so you can actually \ +understand what the code does. It features: \ + \ + - Symmetric algorithms, like AES, Blowfish, Triple-DES, DES, ARC4, \ + Camellia and XTEA \ + - Hash algorithms, like SHA-1, SHA-2, RIPEMD-160 and MD5 \ + - Entropy pool and random generators, like CTR-DRBG and HMAC-DRBG \ + - Public key algorithms, like RSA, Elliptic Curves, Diffie-Hellman, \ + ECDSA and ECDH \ + - SSL v3 and TLS 1.0, 1.1 and 1.2 \ + - Abstraction layers for ciphers, hashes, public key operations, \ + platform abstraction and threading \ +" + +HOMEPAGE = "https://tls.mbed.org/" +SECTION = "libdevel" +BUGTRACKER = "https://github.com/ARMmbed/mbedtls/issues" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=302d50a6369f5f22efdb674db908167a" + +SRC_URI = " \ + https://github.com/ARMmbed/mbedtls/archive/${PN}-${PV}.tar.gz \ + file://0001-mbedtls-library-add-pkg-config-file.patch \ +" +SRC_URI[md5sum] = "6f5d3e7154ce4e04bcb9b299f614775f" +SRC_URI[sha256sum] = "ae458a4987f36819bdf1d39519212f4063780fe448d4155878fccf4e782a715f" + +S = "${WORKDIR}/${PN}-${PN}-${PV}" + +inherit cmake + +EXTRA_OECMAKE = " \ + -DENABLE_PROGRAMS:BOOL=OFF \ + -DENABLE_TESTING:BOOL=OFF \ + -DUSE_STATIC_MBEDTLS_LIBRARY:BOOL=ON \ + -DUSE_SHARED_MBEDTLS_LIBRARY:BOOL=ON \ + -DLIB_INSTALL_DIR:STRING=${libdir} \ + -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ +" + +ALLOW_EMPTY_${PN} = "1" From 9a296b79a3b4c13c22939c7bb202f1ac01a0ab2e Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Wed, 10 May 2017 14:09:56 +0200 Subject: [PATCH 13/95] meta-digi: add awsiotsdk-c configuration class This commit adds an awsiotsdk-c class to encapsulate all AWS IoT device SDK configurations. In general, the variables are the macros that users can configure in their 'aws_iot_config.h' file. See for example, the header file for the 'shadow_sample' at GitHub: https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/master/samples/linux/shadow_sample/aws_iot_config.h https://jira.digi.com/browse/DEL-4101 Signed-off-by: Tatiana Leon --- meta-digi-dey/classes/awsiotsdk-c.bbclass | 65 +++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 meta-digi-dey/classes/awsiotsdk-c.bbclass diff --git a/meta-digi-dey/classes/awsiotsdk-c.bbclass b/meta-digi-dey/classes/awsiotsdk-c.bbclass new file mode 100644 index 000000000..2bd560922 --- /dev/null +++ b/meta-digi-dey/classes/awsiotsdk-c.bbclass @@ -0,0 +1,65 @@ +# Adds AWS IoT device SDK for embedded C configuration +# + +# Customer specific MQTT HOST +AWS_IOT_MQTT_HOST ?= "" + +# Default port for MQTT/S +AWS_IOT_MQTT_PORT ?= "8883" + +# Thing Name of the Shadow the device is associated with +AWS_IOT_MY_THING_NAME ?= "AWS-IoT-C-SDK" + +# Root CA file name +AWS_IOT_ROOT_CA_FILENAME ?= "rootCA.crt" + +# Device signed certificate file name +AWS_IOT_CERTIFICATE_FILENAME ?= "cert.pem" + +# Device private key filename +AWS_IOT_PRIVATE_KEY_FILENAME ?= "privkey.pem" + +# MQTT PubSub + +# Any time a message is sent out through the MQTT layer. The message is copied +# into this buffer anytime a publish is done. +# This will also be used in the case of Thing Shadow +AWS_IOT_MQTT_TX_BUF_LEN ?= "512" + +# Any message that comes into the device should be less than this buffer size. +# If a received message is bigger than this buffer size the message will be +# dropped +AWS_IOT_MQTT_RX_BUF_LEN ?= "512" + +# Maximum number of topic filters the MQTT client can handle at any given time. +# This should be increased appropriately when using Thing Shadow +AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS ?= "5" + +# Thing Shadow specific configs + +# At any given time we will wait for this many responses. +# This will correlate to the rate at which the shadow actions are requested +MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME ?= "10" + +# We could perform shadow action on any thing Name and this is maximum Thing +# Names we can act on at any given time +MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME ?= "10" + +# These are the max tokens that is expected to be in the Shadow JSON document. +# It includes the metadata that gets published +MAX_JSON_TOKEN_EXPECTED ?= "120" + +# The Thing Name should not be bigger than this value. Modify this if the Thing +# Name needs to be bigger +MAX_SIZE_OF_THING_NAME ?= "20" + +# Auto Reconnect specific config + +# Minimum time before the First reconnect attempt is made as part of the +# exponential back-off algorithm (milliseconds) +AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL ?= "1000" + +# Maximum time interval after which exponential back-off will stop attempting +# to reconnect (milliseconds) +AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL ?= "128000" + From cd078339f79b1bbbcfdbcb4bce47cda70cade755 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Wed, 10 May 2017 14:22:35 +0200 Subject: [PATCH 14/95] meta-digi-dey: add aws iot sdk embedded-c recipe The AWS IoT device SDK for embedded C is a collection of C source files that can be used in embedded applications to securely connect to the AWS IoT platform. The SDK code is available in GitHub and includes the library code and several sample applications. A user must provide from its 'local.conf': * AWS_IOT_CERTS_DIR: Absolute path to the directories where the required certifies are stored: * Root CA. * Device signed certificate. * Device private key. And optionally, values for the rest of variables defined in the 'awsiotsdk-c' bbclass. This recipe is building the library code and the binaries for the samples: * shadow_sample * shadow_sample_console_echo * subscribe_publish_sample See https://github.com/aws/aws-iot-device-sdk-embedded-C. https://jira.digi.com/browse/DEL-4101 Signed-off-by: Tatiana Leon --- .../awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile | 41 ++++++++ .../awsiotsdk-c-2.1.1/Makefile.app | 67 +++++++++++++ .../awsiotsdk-c-2.1.1/Makefile.lib | 79 +++++++++++++++ .../aws_iot_config.h.template | 98 +++++++++++++++++++ .../awsiotsdk-c-2.1.1/awsiotsdk.pc | 12 +++ .../awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 98 +++++++++++++++++++ 6 files changed, 395 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile new file mode 100644 index 000000000..94be98239 --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile @@ -0,0 +1,41 @@ +# *************************************************************************** +# Copyright (c) 2017 Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# +# Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 +# +# *************************************************************************** + +SAMPLES_SUBDIR := samples/linux + +EXAMPLES := $(SAMPLES_SUBDIR)/shadow_sample \ + $(SAMPLES_SUBDIR)/shadow_sample_console_echo \ + $(SAMPLES_SUBDIR)/subscribe_publish_sample + +SUBDIRS := src $(EXAMPLES) + +all: $(SUBDIRS) + +$(SAMPLES_SUBDIR)/shadow_sample: src +$(SAMPLES_SUBDIR)/shadow_sample_console_echo: src +$(SAMPLES_SUBDIR)/subscribe_publish_sample: src + +.PHONY: $(SUBDIRS) +$(SUBDIRS): + $(MAKE) -C $@ + +.PHONY: clean install +clean install: + for a in $(SUBDIRS); do $(MAKE) -C $$a $@; done + diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app new file mode 100644 index 000000000..e8bea6506 --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app @@ -0,0 +1,67 @@ +# *************************************************************************** +# Copyright (c) 2017 Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# +# Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 +# +# *************************************************************************** +# Use GNU C Compiler. +CC ?= gcc + +# Generated Executable Name. +EXECUTABLE = $(notdir $(CURDIR)) + +# Location of Source Code. +SRC = . + +#IoT client directory. +IOT_CLIENT_DIR = ../../.. + +PLATFORM_DIR = $(IOT_CLIENT_DIR)/platform/linux/mbedtls +PLATFORM_COMMON_DIR = $(IOT_CLIENT_DIR)/platform/linux/common + +CFLAGS += -I $(SRC) +CFLAGS += -I $(IOT_CLIENT_DIR)/include +CFLAGS += -I $(IOT_CLIENT_DIR)/external_libs/jsmn +CFLAGS += -I $(PLATFORM_COMMON_DIR) +CFLAGS += -I $(PLATFORM_DIR) +CFLAGS += -Wall -g +CFLAGS += $(LOG_FLAGS) + +# Libraries to Link +LIBS += $(shell PKG_CONFIG_PATH=../../..:$${PKG_CONFIG_PATH} pkg-config --libs --static awsiotsdk) + +# Linking Flags. +LDFLAGS += -L$(IOT_CLIENT_DIR)/src $(DFLAGS) + +# Target output to generate. +SRCS = $(wildcard $(SRC)/*.c) + +OBJS = $(SRCS:.c=.o) + +.PHONY: all +all: $(EXECUTABLE) + +$(EXECUTABLE): $(OBJS) + $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ + +.PHONY: install +install: $(EXECUTABLE) + install -d $(DESTDIR)/usr/bin + install -m 0755 $< $(DESTDIR)/usr/bin/ + +.PHONY: clean +clean: + rm -f $(EXECUTABLE) $(OBJS) + diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib new file mode 100644 index 000000000..ff4ad1835 --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib @@ -0,0 +1,79 @@ +# *************************************************************************** +# Copyright (c) 2017 Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# +# Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 +# +# *************************************************************************** +# Use GNU C Compiler. +CC ?= gcc + +# Generated Library name. +NAME := awsiotsdk + +# Location of Source Code. +SRC = . + +#IoT client directory. +IOT_CLIENT_DIR = $(SRC)/.. + +PLATFORM_DIR = $(IOT_CLIENT_DIR)/platform/linux/mbedtls +PLATFORM_COMMON_DIR = $(IOT_CLIENT_DIR)/platform/linux/common +INSTALL_HEADERS_DIR = /usr/include/awsiotsdk + +CFLAGS += -I $(IOT_CLIENT_DIR)/include +CFLAGS += -I $(IOT_CLIENT_DIR)/external_libs/jsmn +CFLAGS += -I $(PLATFORM_COMMON_DIR) +CFLAGS += -I $(PLATFORM_DIR) +CFLAGS += -Wall -g +CFLAGS += $(LOG_FLAGS) +CFLAGS += $(shell pkg-config --cflags mbedtls) + +# Libraries to Link. +LIBS += $(shell pkg-config --libs --static mbedtls) + +# Linking Flags. +LDFLAGS += $(DFLAGS) + +# Target output to generate. +SRCS += $(wildcard $(SRC)/*.c) +SRCS += $(wildcard $(IOT_CLIENT_DIR)/external_libs/jsmn/*.c) +SRCS += $(wildcard $(PLATFORM_DIR)/*.c) +SRCS += $(wildcard $(PLATFORM_COMMON_DIR)/*.c) + +OBJS = $(SRCS:.c=.o) + +.PHONY: all +all: lib$(NAME).a + +lib$(NAME).a: $(OBJS) + $(AR) -rcs $@ $^ + +.PHONY: install +install: lib$(NAME).a + # Install library and pkg-config file. + install -d $(DESTDIR)/usr/lib/pkgconfig + install -m 0644 lib$(NAME).a $(DESTDIR)/usr/lib/ + install -m 0644 ../awsiotsdk.pc $(DESTDIR)/usr/lib/pkgconfig/ + # Install header files. + install -d $(DESTDIR)$(INSTALL_HEADERS_DIR) + install -m 0644 $(IOT_CLIENT_DIR)/include/*.h $(DESTDIR)$(INSTALL_HEADERS_DIR)/ + install -m 0644 $(IOT_CLIENT_DIR)/external_libs/jsmn/*.h $(DESTDIR)$(INSTALL_HEADERS_DIR)/ + install -m 0644 $(PLATFORM_COMMON_DIR)/*.h $(DESTDIR)$(INSTALL_HEADERS_DIR)/ + install -m 0644 $(PLATFORM_DIR)/*.h $(DESTDIR)$(INSTALL_HEADERS_DIR)/ + +.PHONY: clean +clean: + -rm -f lib$(NAME).a $(OBJS) + diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template new file mode 100644 index 000000000..a2375a657 --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template @@ -0,0 +1,98 @@ +/* + * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/** + * @file aws_iot_config.h + * @brief AWS IoT specific configuration file + */ + +#ifndef SRC_SHADOW_IOT_SHADOW_CONFIG_H_ +#define SRC_SHADOW_IOT_SHADOW_CONFIG_H_ + +/* Get from console */ +/* ================================================= */ +/* Customer specific MQTT HOST. The same will be used for Thing Shadow */ +#define AWS_IOT_MQTT_HOST "##AWS_IOT_MQTT_HOST##" +/* Default port for MQTT/S */ +#define AWS_IOT_MQTT_PORT ##AWS_IOT_MQTT_PORT## +/* Thing Name of the Shadow this device is associated with */ +#define AWS_IOT_MY_THING_NAME "##AWS_IOT_MY_THING_NAME##" +/* MQTT client ID should be unique for every device */ +#define AWS_IOT_MQTT_CLIENT_ID AWS_IOT_MY_THING_NAME +/* Root CA file name */ +#define AWS_IOT_ROOT_CA_FILENAME "##AWS_IOT_ROOT_CA_FILENAME##" +/* Device signed certificate file name */ +#define AWS_IOT_CERTIFICATE_FILENAME "##AWS_IOT_CERTIFICATE_FILENAME##" +/* Device private key filename */ +#define AWS_IOT_PRIVATE_KEY_FILENAME "##AWS_IOT_PRIVATE_KEY_FILENAME##" +/* ================================================= */ + +/* MQTT PubSub */ +/* ================================================= */ +/* Any time a message is sent out through the MQTT layer. The message is copied + * into this buffer anytime a publish is done. + * This will also be used in the case of Thing Shadow */ +#define AWS_IOT_MQTT_TX_BUF_LEN ##AWS_IOT_MQTT_TX_BUF_LEN## +/* Any message that comes into the device should be less than this buffer size. + * If a received message is bigger than this buffer size the message will be + * dropped. */ +#define AWS_IOT_MQTT_RX_BUF_LEN ##AWS_IOT_MQTT_RX_BUF_LEN## +/* Maximum number of topic filters the MQTT client can handle at any given time. + * This should be increased appropriately when using Thing Shadow */ +#define AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS ##AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS## + +/* Thing Shadow specific configs */ +/* Maximum size of the Shadow buffer to store the received Shadow message */ +#define SHADOW_MAX_SIZE_OF_RX_BUFFER AWS_IOT_MQTT_RX_BUF_LEN + 1 +/* Maximum size of the Unique Client Id. + * For More info on the Client Id refer \ref response "Acknowledgments" */ +#define MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 +/* This is size of the extra sequence number that will be appended to the + * Unique client Id */ +#define MAX_SIZE_CLIENT_ID_WITH_SEQUENCE MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES + 10 +/* This is size of the the total clientToken key and value pair in the JSON */ +#define MAX_SIZE_CLIENT_TOKEN_CLIENT_SEQUENCE MAX_SIZE_CLIENT_ID_WITH_SEQUENCE + 20 +/* At any given time we will wait for this many responses. + * This will correlate to the rate at which the shadow actions are requested */ +#define MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME ##MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME## +/* We could perform shadow action on any thing Name and this is maximum Thing + * Names we can act on at any given time */ +#define MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME ##MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME## +/* These are the max tokens that is expected to be in the Shadow JSON document. + * It includes the metadata that gets published */ +#define MAX_JSON_TOKEN_EXPECTED ##MAX_JSON_TOKEN_EXPECTED## +/* All shadow actions have to be published or subscribed to a topic which is of + * the format $aws/things/{thingName}/shadow/update/accepted. + * This refers to the size of the topic without the Thing Name */ +#define MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 +/* The Thing Name should not be bigger than this value. Modify this if the + * Thing Name needs to be bigger */ +#define MAX_SIZE_OF_THING_NAME ##MAX_SIZE_OF_THING_NAME## +/* This size includes the length of topic with Thing Name */ +#define MAX_SHADOW_TOPIC_LENGTH_BYTES MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME + MAX_SIZE_OF_THING_NAME +/* ================================================= */ + +/* Auto Reconnect specific config */ +/* ================================================= */ +/* Minimum time before the First reconnect attempt is made as part of the + * exponential back-off algorithm */ +#define AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL ##AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL## +/* Maximum time interval after which exponential back-off will stop attempting + * to reconnect */ +#define AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL ##AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL## +/* ================================================= */ + +#endif /* SRC_SHADOW_IOT_SHADOW_CONFIG_H_ */ + diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc new file mode 100644 index 000000000..2c5037037 --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: awsiotsdk +Description: SDK for connecting to AWS IoT from a device using embedded C +Version: 2.1.1 + +Requires.private: mbedtls +Libs: -L${libdir} -lawsiotsdk +Cflags: -I${includedir}/awsiotsdk -I${includedir} diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb new file mode 100644 index 000000000..36dd35755 --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb @@ -0,0 +1,98 @@ +# Copyright (C) 2017 Digi International. + +SUMMARY = "SDK for connecting to AWS IoT from a device using embedded C" +HOMEPAGE = "https://github.com/aws/aws-iot-device-sdk-embedded-C" +SECTION = "base" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=acc7a1bf87c055789657b148939e4b40" + +DEPENDS = "mbedtls" + +SRC_URI = " \ + https://github.com/aws/aws-iot-device-sdk-embedded-C/archive/v${PV}.tar.gz \ + file://aws_iot_config.h.template \ + file://awsiotsdk.pc \ + file://Makefile \ + file://Makefile.app \ + file://Makefile.lib \ +" + +SRC_URI[md5sum] = "2c415af16bbd68440b62d71a7e9775c5" +SRC_URI[sha256sum] = "74d434b3258654cea048b20eb52d4fc627f5c87e8727ce180a1d529e3285a97e" + +S = "${WORKDIR}/aws-iot-device-sdk-embedded-C-${PV}" + +inherit awsiotsdk-c pkgconfig + +do_configure() { + cp -f ${WORKDIR}/awsiotsdk.pc ${S} + + # Copy and update the configuration header file. + cp -f ${WORKDIR}/aws_iot_config.h.template ${S}/include/aws_iot_config.h + sed -i -e "s,##AWS_IOT_MQTT_HOST##,${AWS_IOT_MQTT_HOST},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_MQTT_PORT##,${AWS_IOT_MQTT_PORT},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_MY_THING_NAME##,${AWS_IOT_MY_THING_NAME},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_ROOT_CA_FILENAME##,${AWS_IOT_ROOT_CA_FILENAME},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_CERTIFICATE_FILENAME##,${AWS_IOT_CERTIFICATE_FILENAME},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_PRIVATE_KEY_FILENAME##,${AWS_IOT_PRIVATE_KEY_FILENAME},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_MQTT_TX_BUF_LEN##,${AWS_IOT_MQTT_TX_BUF_LEN},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_MQTT_RX_BUF_LEN##,${AWS_IOT_MQTT_RX_BUF_LEN},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS##,${AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME##,${MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME##,${MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##MAX_JSON_TOKEN_EXPECTED##,${MAX_JSON_TOKEN_EXPECTED},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##MAX_SIZE_OF_THING_NAME##,${MAX_SIZE_OF_THING_NAME},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL##,${AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL},g" "${S}/include/aws_iot_config.h" + sed -i -e "s,##AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL##,${AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL},g" "${S}/include/aws_iot_config.h" + + # Remove the examples header files. + rm -f ${S}/samples/linux/shadow_sample/aws_iot_config.h + rm -f ${S}/samples/linux/shadow_sample_console_echo/aws_iot_config.h + rm -f ${S}/samples/linux/subscribe_publish_sample/aws_iot_config.h + + # Copy the Makefiles. + cp -f ${WORKDIR}/Makefile ${S} + cp -f ${WORKDIR}/Makefile.lib ${S}/src/Makefile + cp -f ${WORKDIR}/Makefile.app ${S}/samples/linux/shadow_sample/Makefile + cp -f ${WORKDIR}/Makefile.app ${S}/samples/linux/shadow_sample_console_echo/Makefile + cp -f ${WORKDIR}/Makefile.app ${S}/samples/linux/subscribe_publish_sample/Makefile +} + +do_install() { + oe_runmake DESTDIR=${D} install + + # Check if certificate variables are defined and files exist. + if [ -z "${AWS_IOT_CERTS_DIR}" ]; then + bberror "Undefined variable AWS_IOT_CERTS_DIR. Define it in your project 'local.conf'." + return -1 + elif [ ! -d "${AWS_IOT_CERTS_DIR}" ]; then + bberror "Unable to find defined AWS_IOT_CERTS_DIR ('${AWS_IOT_CERTS_DIR}')." + return -1 + elif [ ! -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ]; then + bberror "Unable to find defined AWS_IOT_ROOT_CA_FILENAME ('${AWS_IOT_ROOT_CA_FILENAME}') in '${AWS_IOT_CERTS_DIR}'." + return -1 + elif [ ! -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ]; then + bberror "Unable to find defined AWS_IOT_CERTIFICATE_FILENAME ('${AWS_IOT_CERTIFICATE_FILENAME}') in '${AWS_IOT_CERTS_DIR}'." + return -1 + elif [ ! -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ]; then + bberror "Unable to find defined AWS_IOT_PRIVATE_KEY_FILENAME ('${AWS_IOT_PRIVATE_KEY_FILENAME}') in '${AWS_IOT_CERTS_DIR}'." + return -1 + fi + + # Install certificates. + install -d ${D}${sysconfdir}/ssl/certs + install -m 0644 ${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME} ${D}${sysconfdir}/ssl/certs/ + install -m 0644 ${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME} ${D}${sysconfdir}/ssl/certs/ + install -m 0644 ${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME} ${D}${sysconfdir}/ssl/certs/ +} + +PACKAGES =+ "${PN}-cert ${PN}-examples" + +FILES_${PN}-cert = "${sysconfdir}/ssl/certs/" +FILES_${PN}-examples = "${bindir}" + +RDEPENDS_${PN} = "${PN}-cert" +RDEPENDS_${PN}-examples = "${PN}-cert" + +ALLOW_EMPTY_${PN} = "1" + From 8a1a67f592be0884edb01a74e485ae058bc828ff Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Wed, 10 May 2017 14:31:50 +0200 Subject: [PATCH 15/95] aws-iot-sdk: add variable to establish the logging level Variable 'AWS_IOT_LOGGING_LEVEL' can be used from the project 'local.conf' to establish the logging level of the AWS IoT Device SDK. There are 6 incremental levels: none, error, warn, info, debug, and trace. Default is 'debug'. https://jira.digi.com/browse/DEL-4101 Signed-off-by: Tatiana Leon --- meta-digi-dey/classes/awsiotsdk-c.bbclass | 22 +++++++++++++++++++ .../awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 2 ++ 2 files changed, 24 insertions(+) diff --git a/meta-digi-dey/classes/awsiotsdk-c.bbclass b/meta-digi-dey/classes/awsiotsdk-c.bbclass index 2bd560922..1ec839042 100644 --- a/meta-digi-dey/classes/awsiotsdk-c.bbclass +++ b/meta-digi-dey/classes/awsiotsdk-c.bbclass @@ -63,3 +63,25 @@ AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL ?= "1000" # to reconnect (milliseconds) AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL ?= "128000" +# Logging level control: error, warn, info, debug, trace. +AWS_IOT_LOGGING_LEVEL ?= "debug" + +def get_log_level(d): + levels = ['error', 'warn', 'info', 'debug', 'trace'] + log_flags = "" + + log_level = d.getVar('AWS_IOT_LOGGING_LEVEL', True) + if log_level == 'none': + return "" + if log_level not in levels: + log_level = "debug" + d.setVar('AWS_IOT_LOGGING_LEVEL', log_level) + + log_index = levels.index(log_level) + for i, val in enumerate(levels): + log_flags = log_flags + "-DENABLE_IOT_" + val.upper() + " " + if i == log_index: + break; + + return log_flags + diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb index 36dd35755..866990ef0 100644 --- a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb @@ -24,6 +24,8 @@ S = "${WORKDIR}/aws-iot-device-sdk-embedded-C-${PV}" inherit awsiotsdk-c pkgconfig +EXTRA_OEMAKE += "'LOG_FLAGS=${@get_log_level(d)}'" + do_configure() { cp -f ${WORKDIR}/awsiotsdk.pc ${S} From c525e2caaf299c77815dd848fa2582098f4854ba Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 5 May 2017 18:25:41 +0200 Subject: [PATCH 16/95] aws-iot-sdk: patch aws iot sdk samples code to properly work on our platforms This patch modifies the code of some of the provided samples to be able to run them in our platforms. By default, these applications cannot find the certificates in the device, and the command line options are not working. Patched samples: * shadow_sample * shadow_sample_console_echo * subscribe_publish_sample See https://github.com/aws/aws-iot-device-sdk-embedded-C. https://jira.digi.com/browse/DEL-4101 Signed-off-by: Tatiana Leon --- ...modify-provided-samples-to-work-in-o.patch | 149 ++++++++++++++++++ .../awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 1 + 2 files changed, 150 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch new file mode 100644 index 000000000..8cf616baf --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch @@ -0,0 +1,149 @@ +From: Tatiana Leon +Date: Wed, 3 May 2017 18:12:52 +0200 +Subject: [PATCH] aws-iot-samples: modify provided samples to work in our + platforms + +Signed-off-by: Tatiana Leon +--- + samples/linux/shadow_sample/shadow_sample.c | 20 ++++++++++---------- + .../shadow_sample_console_echo/shadow_console_echo.c | 20 ++++++++++---------- + .../subscribe_publish_sample.c | 12 ++++++------ + 3 files changed, 26 insertions(+), 26 deletions(-) + +diff --git a/samples/linux/shadow_sample/shadow_sample.c b/samples/linux/shadow_sample/shadow_sample.c +index 9a0b270..fc73a2d 100644 +--- a/samples/linux/shadow_sample/shadow_sample.c ++++ b/samples/linux/shadow_sample/shadow_sample.c +@@ -59,7 +59,7 @@ + + #define MAX_LENGTH_OF_UPDATE_JSON_BUFFER 200 + +-static char certDirectory[PATH_MAX + 1] = "../../../certs"; ++static char certDirectory[PATH_MAX + 1] = ""; + static char HostAddress[255] = AWS_IOT_MQTT_HOST; + static uint32_t port = AWS_IOT_MQTT_PORT; + static uint8_t numPubs = 5; +@@ -164,27 +164,27 @@ int main(int argc, char **argv) { + char rootCA[PATH_MAX + 1]; + char clientCRT[PATH_MAX + 1]; + char clientKey[PATH_MAX + 1]; +- char CurrentWD[PATH_MAX + 1]; + + IOT_INFO("\nAWS IoT SDK Version %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG); + +- getcwd(CurrentWD, sizeof(CurrentWD)); +- snprintf(rootCA, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_ROOT_CA_FILENAME); +- snprintf(clientCRT, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_CERTIFICATE_FILENAME); +- snprintf(clientKey, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); ++ parseInputArgsForConnectParams(argc, argv); ++ ++ if (certDirectory[0] == '\0') ++ snprintf(certDirectory, PATH_MAX + 1, "%s", "/etc/ssl/certs"); ++ snprintf(rootCA, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_ROOT_CA_FILENAME); ++ snprintf(clientCRT, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_CERTIFICATE_FILENAME); ++ snprintf(clientKey, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); + + IOT_DEBUG("rootCA %s", rootCA); + IOT_DEBUG("clientCRT %s", clientCRT); + IOT_DEBUG("clientKey %s", clientKey); + +- parseInputArgsForConnectParams(argc, argv); +- + // initialize the mqtt client + AWS_IoT_Client mqttClient; + + ShadowInitParameters_t sp = ShadowInitParametersDefault; +- sp.pHost = AWS_IOT_MQTT_HOST; +- sp.port = AWS_IOT_MQTT_PORT; ++ sp.pHost = HostAddress; ++ sp.port = port; + sp.pClientCRT = clientCRT; + sp.pClientKey = clientKey; + sp.pRootCA = rootCA; +diff --git a/samples/linux/shadow_sample_console_echo/shadow_console_echo.c b/samples/linux/shadow_sample_console_echo/shadow_console_echo.c +index 1c491fb..e333094 100644 +--- a/samples/linux/shadow_sample_console_echo/shadow_console_echo.c ++++ b/samples/linux/shadow_sample_console_echo/shadow_console_echo.c +@@ -53,7 +53,7 @@ + * @note Ensure the buffer sizes in aws_iot_config.h are big enough to receive the delta message. The delta message will also contain the metadata with the timestamps + */ + +-char certDirectory[PATH_MAX + 1] = "../../../certs"; ++char certDirectory[PATH_MAX + 1] = ""; + char HostAddress[255] = AWS_IOT_MQTT_HOST; + uint32_t port = AWS_IOT_MQTT_PORT; + bool messageArrivedOnDelta = false; +@@ -80,27 +80,27 @@ int main(int argc, char** argv) { + char rootCA[PATH_MAX + 1]; + char clientCRT[PATH_MAX + 1]; + char clientKey[PATH_MAX + 1]; +- char CurrentWD[PATH_MAX + 1]; + + IOT_INFO("\nAWS IoT SDK Version %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG); + +- getcwd(CurrentWD, sizeof(CurrentWD)); +- snprintf(rootCA, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_ROOT_CA_FILENAME); +- snprintf(clientCRT, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_CERTIFICATE_FILENAME); +- snprintf(clientKey, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); ++ parseInputArgsForConnectParams(argc, argv); ++ ++ if (certDirectory[0] == '\0') ++ snprintf(certDirectory, PATH_MAX + 1, "%s", "/etc/ssl/certs"); ++ snprintf(rootCA, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_ROOT_CA_FILENAME); ++ snprintf(clientCRT, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_CERTIFICATE_FILENAME); ++ snprintf(clientKey, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); + + IOT_DEBUG("rootCA %s", rootCA); + IOT_DEBUG("clientCRT %s", clientCRT); + IOT_DEBUG("clientKey %s", clientKey); + +- parseInputArgsForConnectParams(argc, argv); +- + // initialize the mqtt client + AWS_IoT_Client mqttClient; + + ShadowInitParameters_t sp = ShadowInitParametersDefault; +- sp.pHost = AWS_IOT_MQTT_HOST; +- sp.port = AWS_IOT_MQTT_PORT; ++ sp.pHost = HostAddress; ++ sp.port = port; + sp.pClientCRT = clientCRT; + sp.pClientKey = clientKey; + sp.pRootCA = rootCA; +diff --git a/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c b/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c +index 4f92645..d0fef05 100644 +--- a/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c ++++ b/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c +@@ -40,7 +40,7 @@ + /** + * @brief Default cert location + */ +-char certDirectory[PATH_MAX + 1] = "../../../certs"; ++char certDirectory[PATH_MAX + 1] = ""; + + /** + * @brief Default MQTT HOST URL is pulled from the aws_iot_config.h +@@ -132,7 +132,6 @@ int main(int argc, char **argv) { + char rootCA[PATH_MAX + 1]; + char clientCRT[PATH_MAX + 1]; + char clientKey[PATH_MAX + 1]; +- char CurrentWD[PATH_MAX + 1]; + char cPayload[100]; + + int32_t i = 0; +@@ -150,10 +149,11 @@ int main(int argc, char **argv) { + + IOT_INFO("\nAWS IoT SDK Version %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG); + +- getcwd(CurrentWD, sizeof(CurrentWD)); +- snprintf(rootCA, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_ROOT_CA_FILENAME); +- snprintf(clientCRT, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_CERTIFICATE_FILENAME); +- snprintf(clientKey, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); ++ if (certDirectory[0] == '\0') ++ snprintf(certDirectory, PATH_MAX + 1, "%s", "/etc/ssl/certs"); ++ snprintf(rootCA, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_ROOT_CA_FILENAME); ++ snprintf(clientCRT, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_CERTIFICATE_FILENAME); ++ snprintf(clientKey, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); + + IOT_DEBUG("rootCA %s", rootCA); + IOT_DEBUG("clientCRT %s", clientCRT); diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb index 866990ef0..47d97b281 100644 --- a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb @@ -10,6 +10,7 @@ DEPENDS = "mbedtls" SRC_URI = " \ https://github.com/aws/aws-iot-device-sdk-embedded-C/archive/v${PV}.tar.gz \ + file://0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch \ file://aws_iot_config.h.template \ file://awsiotsdk.pc \ file://Makefile \ From 0ce722decf4c3419cdcba3aed36d218e113b9f6f Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Thu, 11 May 2017 19:26:39 +0200 Subject: [PATCH 17/95] README: add support for AWS IoT Device SDK for embedded C https://jira.digi.com/browse/DEL-4101 Signed-off-by: Tatiana Leon --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 03c496f14..e2506de35 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Documentation is available online on the Digi documentation site: ## 2.2-r2 * Digi Embedded Yocto + * Support to connect to AWS IoT with AWS IoT Device SDK for embedded C. * Added support for Digi XBee Cellular 3G Global, with P/N XBC-M5-UT-001 * Added support for U-Blox TOBY L-200/L-210 * Added support for Quectel EC-25 From 0e7f5d3a4783a81617c8013eae28ffdcfa5fb433 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Tue, 16 May 2017 11:26:57 +0200 Subject: [PATCH 18/95] modemmanager: generalize udev rules for XBee cellular After the kernel update (v3.14 to v4.1) the sysfs path changed from: /devices/soc0/soc.0/2100000.aips-bus/21f4000.serial/tty/ttymxc4 to: /devices/soc0/soc/2100000.aips-bus/21f4000.serial/tty/ttymxc4 which caused the XBee Cellular not to be detected on the new kernel. These more general rules are compatible with both kernels. https://jira.digi.com/browse/DEL-4199 Signed-off-by: Diaz de Grenu, Jose --- .../modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules index 9fc89ca41..447c97be7 100644 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules @@ -4,9 +4,9 @@ ACTION!="add|change|move", GOTO="mm_digi_xbee_cellular_modem_end" # baudrates may be used by setting the ID_MM_TTY_BAUDRATE udev tag. # ConnectCore 6 SBC -DEVPATH=="/devices/soc0/soc.0/2100000.aips-bus/21f4000.serial/tty/ttymxc4", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" +DEVPATH=="/devices/*/2100000.aips-bus/21f4000.serial/tty/ttymxc4", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" # ConnectCore 6UL SBC Pro -DEVPATH=="/devices/platform/soc/2100000.aips-bus/21e8000.serial/tty/ttymxc1", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" +DEVPATH=="/devices/*/2100000.aips-bus/21e8000.serial/tty/ttymxc1", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" LABEL="mm_digi_xbee_cellular_modem_end" From b9d6f4406a9e34ff2e83c07c82b669ed14f1d44d Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Wed, 17 May 2017 13:18:10 +0200 Subject: [PATCH 19/95] modemmanager: rework udev rules for cellular XBee After 0e7f5d3a4783a81617c8013eae28ffdcfa5fb433 both platforms probe both ports, which is problematic (for example, ttymxc4 is the console in the 6UL based platforms). Use more concrete rules to avoid that problem. https://jira.digi.com/browse/DEL-4199 Signed-off-by: Diaz de Grenu, Jose off-by: Diaz de Grenu, Jose --- .../modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules index 447c97be7..6c23a015f 100644 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/78-mm-digi-xbee-cellular.rules @@ -4,9 +4,10 @@ ACTION!="add|change|move", GOTO="mm_digi_xbee_cellular_modem_end" # baudrates may be used by setting the ID_MM_TTY_BAUDRATE udev tag. # ConnectCore 6 SBC -DEVPATH=="/devices/*/2100000.aips-bus/21f4000.serial/tty/ttymxc4", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" +DEVPATH=="/devices/soc0/soc.0/2100000.aips-bus/21f4000.serial/tty/ttymxc4", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" +DEVPATH=="/devices/soc0/soc/2100000.aips-bus/21f4000.serial/tty/ttymxc4", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" # ConnectCore 6UL SBC Pro -DEVPATH=="/devices/*/2100000.aips-bus/21e8000.serial/tty/ttymxc1", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" +DEVPATH=="/devices/platform/soc/2100000.aips-bus/21e8000.serial/tty/ttymxc1", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" LABEL="mm_digi_xbee_cellular_modem_end" From 7f59bc7eda975242f5e60aae9ca34d463e373dea Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Tue, 16 May 2017 22:29:00 +0200 Subject: [PATCH 20/95] dey-examples: add cmp_sample application for ccimx6ul This application tests the MCA comparator feature by configuring the thresholds, sample rate and other parameters. Signed-off-by: Sebastian Pastor https://jira.digi.com/browse/CC6UL-600 --- .../dey-examples/dey-examples-adc-cmp.bb | 18 + .../files/adc_cmp_sample/Makefile | 30 + .../files/adc_cmp_sample/adc_cmp_sample.c | 473 +++++++++++++ .../files/adc_cmp_sample/iio_utils.c | 669 ++++++++++++++++++ .../files/adc_cmp_sample/iio_utils.h | 71 ++ .../packagegroup-dey-examples.bb | 1 + 6 files changed, 1262 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/Makefile create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.h diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb new file mode 100644 index 000000000..18c1f9946 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc-cmp.bb @@ -0,0 +1,18 @@ +# Copyright (C) 2017 Digi International. + +SUMMARY = "DEY examples: Analog Comparator test application" +SECTION = "examples" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = "file://adc_cmp_sample" + +S = "${WORKDIR}/adc_cmp_sample" + +do_install() { + install -d ${D}${bindir} + install -m 0755 adc_cmp_sample ${D}${bindir} +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(ccimx6ul)" diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/Makefile new file mode 100644 index 000000000..7c6ef556f --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/Makefile @@ -0,0 +1,30 @@ +# *************************************************************************** +# Copyright (c) 2017 Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# +# Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 +# +# *************************************************************************** + +CFLAGS = -Wall -g -D_GNU_SOURCE + +all: adc_cmp_sample + +adc_cmp_sample: adc_cmp_sample.o iio_utils.o + +%.o: %.c iio_utils.h + +.PHONY: clean +clean: + rm -f *.o adc_cmp_sample diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c new file mode 100644 index 000000000..3e533ccb8 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c @@ -0,0 +1,473 @@ +/* + * ConnectCore 6UL Analog Comparator sample application. + * + * Copyright (c) 2017 Digi International Inc. + * All rights reserved. + * + * Based on iio_event_monitor.c from the tools/iio directory, of the linux + * kernel. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iio_utils.h" + +#define BUFFER_LEN 20 + +#define USAGE \ + "Usage:\n" \ + "adc_cmp_sample -c channel -l THRESH_LOW [options]\n\n" + +#define FULL_USAGE \ + "Usage:\n" \ + "adc_cmp_sample -c channel [options]\n\n" \ + "Options:\n" \ + " -c : channel number to read from\n" \ + " -h : Threshold_high higher limit of the comparator window\n" \ + " -l : Threshold_low lower limit of the comparator window\n" \ + " -e : edges enabled: 'rising', 'falling' or 'both'\n" \ + " -s : sample_rate how often to sample the input, in 100 ms units.\n"\ + " -v : use V for output and thresholds instead of raw values.\n"\ + " -? : help\n\n" + +typedef struct cmp { + char *sysfs_dir; + unsigned int channel; + double voltage_scale; + bool raw; +} cmp_t; + +static void show_usage(int full) +{ + fprintf(stdout, "%s", full ? FULL_USAGE : USAGE); +} + +static int read_adc_sample_sysfs(cmp_t *cmp, long int *val) +{ + int fd = -1; + int ret; + char buffer[BUFFER_LEN]; + char *path = NULL; + + ret = asprintf(&path, "%s/in_voltage%u_raw", + cmp->sysfs_dir, cmp->channel); + if (ret < 0) { + fprintf(stdout, "Failed to allocate memory\n"); + ret = -ENOMEM; + goto exit; + } + + fd = open(path, O_RDONLY); + if (fd < 0) { + fprintf(stdout, "%s: failed to open %s\n", + __func__, path); + ret = fd; + goto exit; + } + + ret = read(fd, buffer, BUFFER_LEN); + if (ret < 0) { + fprintf(stdout, "%s: failed to read ADC sample from %s (%d)\n", + __func__, path, ret); + goto exit; + } + + if (ret == 0) { + fprintf(stdout, "%s: no data available in %s\n", + __func__, path); + ret = -ENODATA; + goto exit; + } + + *val = strtol(buffer, NULL, 10); + ret = 0; + +exit: + free(path); + close(fd); + return ret; +} + +static int read_cmp_out_sysfs(cmp_t *cmp, int *val) +{ + int fd = -1; + int ret; + char buffer[BUFFER_LEN]; + char *path = NULL; + + ret = asprintf(&path, "%s/in_voltage%u_cmp_out", + cmp->sysfs_dir, cmp->channel); + if (ret < 0) { + fprintf(stdout, "Failed to allocate memory\n"); + ret = -ENOMEM; + goto exit; + } + + fd = open(path, O_RDONLY); + if (fd < 0) { + fprintf(stdout, "%s: failed to open %s\n", + __func__, path); + ret = fd; + goto exit; + } + + ret = read(fd, buffer, BUFFER_LEN); + if (ret < 0) { + fprintf(stdout, + "%s: failed to read Comparator Output from %s (%d)\n", + __func__, path, ret); + goto exit; + } else if (ret == 0) { + fprintf(stdout, "%s: no data available in %s\n", + __func__, path); + ret = -ENODATA; + goto exit; + } + + *val = strtol(buffer, NULL, 10); + ret = 0; + +exit: + free(path); + close(fd); + + return ret; +} + +static void process_event(cmp_t *cmp, struct iio_event_data *event) +{ + enum iio_event_direction dir = IIO_EVENT_CODE_EXTRACT_DIR(event->id); + int channel = IIO_EVENT_CODE_EXTRACT_CHAN(event->id); + const char *dir_str; + long sample_val; + int cmp_out; + int ret; + + switch (dir) { + case IIO_EV_DIR_EITHER: + dir_str = "Both"; + break; + case IIO_EV_DIR_RISING: + dir_str = "Rising"; + break; + case IIO_EV_DIR_FALLING: + dir_str = "Falling"; + break; + default: + dir_str = "Unknown"; + break; + } + + ret = read_adc_sample_sysfs(cmp, &sample_val); + if (ret) { + fprintf(stdout, "Failed to read ADC value\n"); + return; + } + + ret = read_cmp_out_sysfs(cmp, &cmp_out); + if (ret) { + fprintf(stdout, "Failed to read CMP Out\n"); + return; + } + + fprintf(stdout, "\n\nGot a Comparator event!\n"); + fprintf(stdout, "\tTime: %lld\n", event->timestamp); + fprintf(stdout, "\tChannel: %d\n", channel); + fprintf(stdout, "\tCMP Out: %d\n", (unsigned int)cmp_out); + fprintf(stdout, "\tEdge: %s\n", dir_str); + + if (cmp->raw) + fprintf(stdout, "\tADC Value: 0x%04x\n", + (unsigned int)sample_val); + else + fprintf(stdout, "\tADC Value: %.2f V\n", + sample_val * cmp->voltage_scale / 1000); +} + +static int read_voltage_scale(cmp_t *cmp) +{ + int fd, ret; + char buffer[BUFFER_LEN]; + char *temp; + + if (cmp->raw) + return 0; + + /* Read the voltage scale from the sysfs */ + ret = asprintf(&temp, "%s/in_voltage_scale", cmp->sysfs_dir); + if (ret < 0) { + fprintf(stdout, "%s: failed to allocate memory\n", __func__); + return -ENOMEM; + } + + fd = open(temp, O_RDONLY); + if (fd < 0) { + fprintf(stdout, "%s: failed to open %s\n", __func__, temp); + ret = fd; + goto free_temp; + } + + ret = read(fd, buffer, BUFFER_LEN); + if (ret < 0) { + fprintf(stdout, + "%s: failed to read voltage scale from %s (%d)\n", + __func__, temp, ret); + goto close_fd; + } else if (ret == 0) { + fprintf(stdout, + "%s: no data available in %s\n", __func__, temp); + ret = -ENODATA; + goto close_fd; + } + + cmp->voltage_scale = atof(buffer); + +close_fd: + close(fd); +free_temp: + free(temp); + return ret; +} + +static int write_in_path(const char *path, const char *str) +{ + int fd = -1; + int ret; + + fd = open(path, O_RDWR); + if (fd < 0) { + fprintf(stdout, "%s: failed to open %s\n", + __func__, path); + ret = fd; + goto exit; + } + + ret = write(fd, str, strlen(str)); + if (ret < 0) { + fprintf(stdout, "%s: failed to write data to %s (%d)\n", + __func__, path, ret); + goto exit; + } + +exit: + close(fd); + return ret; +} + +static int configure_comparator(cmp_t *cmp, uint16_t th_l, uint16_t th_h, + uint16_t srate, char *edge) +{ + char *path; + char buffer[BUFFER_LEN]; + int ret; + + /* Allocate a few bytes more, since it's reused several times */ + path = malloc(strlen(cmp->sysfs_dir) + strlen("/in_voltageX_cmp_thr_l") + + 15); + if (!path) { + fprintf(stdout, "Failed to allocate memory\n"); + goto exit; + } + + /* Configure Threshold LOW */ + sprintf(path, "%s/in_voltage%u_cmp_thr_l", + cmp->sysfs_dir, cmp->channel); + sprintf(buffer, "%d", th_l); + + ret = write_in_path(path, buffer); + if (ret < 0) + goto exit; + + /* Configure Threshold HIGH */ + sprintf(path, "%s/in_voltage%u_cmp_thr_h", + cmp->sysfs_dir, cmp->channel); + sprintf(buffer, "%d", th_h); + + ret = write_in_path(path, buffer); + if (ret < 0) + goto exit; + + /* Configure Sample rate */ + sprintf(path, "%s/in_voltage%u_cmp_rate", + cmp->sysfs_dir, cmp->channel); + sprintf(buffer, "%d", srate); + + ret = write_in_path(path, buffer); + if (ret < 0) + goto exit; + + /* Configure Edge */ + sprintf(path, "%s/in_voltage%u_cmp_edge", + cmp->sysfs_dir, cmp->channel); + + ret = write_in_path(path, edge); + if (ret < 0) + goto exit; +exit: + free(path); + + return ret; +} + +int main(int argc, char **argv) +{ + int ret, opt; + int fd = -1; + int event_fd = -1; + char *chrdev_path = NULL; + char *edge = NULL; + int dev_num; + unsigned int sample_rate = 1; + double threshold_low = 0; + double threshold_high = 0xFFFF; + cmp_t cmp = { + .sysfs_dir = NULL, + .raw = true, + }; + struct iio_event_data event; + + if (argc <= 3) { + show_usage(0); + return EXIT_FAILURE; + } + + while ((opt = getopt(argc, argv, "c:h:l:s:e:v?")) > 0) { + switch (opt) { + case 'c': + cmp.channel = strtoul(optarg, NULL, 10); + break; + case 'h': + threshold_high = atof(optarg); + break; + case 'l': + threshold_low = atof(optarg); + break; + case 's': + sample_rate = strtoul(optarg, NULL, 10); + break; + case 'e': + if (!strcmp(optarg, "rising") && + !strcmp(optarg, "falling") && + !strcmp(optarg, "both")) { + fprintf(stdout, + "Invalid edge (%s)\n", + optarg); + goto exit; + } + edge = strdup(optarg); + if (!edge) { + fprintf(stdout, "Failed to allocate memory\n"); + goto exit; + } + break; + case 'v': + cmp.raw = false; + break; + case '?': + show_usage(1); + return EXIT_SUCCESS; + default: + show_usage(0); + return EXIT_FAILURE; + } + } + + if (!edge) { + edge = strdup("both"); + if (!edge) { + fprintf(stdout, "Failed to allocate memory\n"); + goto exit; + } + } + + dev_num = find_type_by_name("mca-cc6ul-adc", "iio:device"); + if (dev_num < 0) { + fprintf(stdout, + "Failed to find iio:device for mca-cc6ul-adc\n"); + ret = -ENODEV; + goto exit; + } + + ret = asprintf(&chrdev_path, "/dev/iio:device%d", dev_num); + if (ret < 0) { + fprintf(stdout, "Failed to allocate memory\n"); + ret = -ENOMEM; + goto exit; + } + + ret = asprintf(&cmp.sysfs_dir, "/sys/bus/iio/devices/iio:device%d", + dev_num); + if (ret < 0) { + fprintf(stdout, "Failed to allocate memory\n"); + ret = -ENOMEM; + goto exit; + } + + if (!cmp.raw) { + ret = read_voltage_scale(&cmp); + if (ret < 0) + goto exit; + threshold_high = threshold_high * 1000 / cmp.voltage_scale; + threshold_low = threshold_low * 1000 / cmp.voltage_scale; + } + + ret = configure_comparator(&cmp, threshold_low, threshold_high, + sample_rate, edge); + if (ret < 0) + goto exit; + + + fd = open(chrdev_path, 0); + if (fd < 0) { + fprintf(stdout, "Failed to open %s\n", chrdev_path); + ret = fd; + goto exit; + } + + ret = ioctl(fd, IIO_GET_EVENT_FD_IOCTL, &event_fd); + + close(fd); + if (ret < 0 || event_fd < 0) { + fprintf(stdout, "Failed to retrieve event fd\n"); + ret = fd; + goto exit; + } + + fprintf(stdout, "Waiting for events:\n"); + + while (true) { + ret = read(event_fd, &event, sizeof(event)); + if (ret < 0) { + if (errno == EAGAIN) { + fprintf(stdout, "No events... continue\n"); + continue; + } else { + perror("Failed to read event from device"); + ret = -errno; + break; + } + } + process_event(&cmp, &event); + } + +exit: + free(cmp.sysfs_dir); + free(chrdev_path); + free(edge); + close(event_fd); + + return ret; +} diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.c new file mode 100644 index 000000000..6f6452167 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.c @@ -0,0 +1,669 @@ +/* IIO - useful set of util functionality + * + * Copyright (c) 2008 Jonathan Cameron + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ +#ifndef _IIO_UTILS_H +#define _IIO_UTILS_H + +#include +#include +#include +#include +#include +#include +#include +#include "iio_utils.h" + +const char *iio_dir = "/sys/bus/iio/devices/"; + +static char * const iio_direction[] = { + "in", + "out", +}; + +/** + * iioutils_break_up_name() - extract generic name from full channel name + * @full_name: the full channel name + * @generic_name: the output generic channel name + **/ +int iioutils_break_up_name(const char *full_name, + char **generic_name) +{ + char *current; + char *w, *r; + char *working, *prefix = ""; + int i; + + for (i = 0; i < sizeof(iio_direction) / sizeof(iio_direction[0]); i++) + if (!strncmp(full_name, iio_direction[i], + strlen(iio_direction[i]))) { + prefix = iio_direction[i]; + break; + } + + current = strdup(full_name + strlen(prefix) + 1); + working = strtok(current, "_\0"); + + w = working; + r = working; + + while (*r != '\0') { + if (!isdigit(*r)) { + *w = *r; + w++; + } + r++; + } + *w = '\0'; + asprintf(generic_name, "%s_%s", prefix, working); + free(current); + + return 0; +} + +/** + * iioutils_get_type() - find and process _type attribute data + * @is_signed: output whether channel is signed + * @bytes: output how many bytes the channel storage occupies + * @mask: output a bit mask for the raw data + * @be: big endian + * @device_dir: the iio device directory + * @name: the channel name + * @generic_name: the channel type name + **/ +int iioutils_get_type(unsigned *is_signed, + unsigned *bytes, + unsigned *bits_used, + unsigned *shift, + uint64_t *mask, + unsigned *be, + const char *device_dir, + const char *name, + const char *generic_name) +{ + FILE *sysfsfp; + int ret; + DIR *dp; + char *scan_el_dir, *builtname, *builtname_generic, *filename = 0; + char signchar, endianchar; + unsigned padint; + const struct dirent *ent; + + ret = asprintf(&scan_el_dir, FORMAT_SCAN_ELEMENTS_DIR, device_dir); + if (ret < 0) { + ret = -ENOMEM; + goto error_ret; + } + ret = asprintf(&builtname, FORMAT_TYPE_FILE, name); + if (ret < 0) { + ret = -ENOMEM; + goto error_free_scan_el_dir; + } + ret = asprintf(&builtname_generic, FORMAT_TYPE_FILE, generic_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_free_builtname; + } + + dp = opendir(scan_el_dir); + if (dp == NULL) { + ret = -errno; + goto error_free_builtname_generic; + } + while (ent = readdir(dp), ent != NULL) + /* + * Do we allow devices to override a generic name with + * a specific one? + */ + if ((strcmp(builtname, ent->d_name) == 0) || + (strcmp(builtname_generic, ent->d_name) == 0)) { + ret = asprintf(&filename, + "%s/%s", scan_el_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_closedir; + } + sysfsfp = fopen(filename, "r"); + if (sysfsfp == NULL) { + printf("failed to open %s\n", filename); + ret = -errno; + goto error_free_filename; + } + + ret = fscanf(sysfsfp, + "%ce:%c%u/%u>>%u", + &endianchar, + &signchar, + bits_used, + &padint, shift); + if (ret < 0) { + printf("failed to pass scan type description\n"); + ret = -errno; + goto error_close_sysfsfp; + } + *be = (endianchar == 'b'); + *bytes = padint / 8; + if (*bits_used == 64) + *mask = ~0; + else + *mask = (1 << *bits_used) - 1; + if (signchar == 's') + *is_signed = 1; + else + *is_signed = 0; + fclose(sysfsfp); + free(filename); + + filename = 0; + sysfsfp = 0; + } +error_close_sysfsfp: + if (sysfsfp) + fclose(sysfsfp); +error_free_filename: + if (filename) + free(filename); +error_closedir: + closedir(dp); +error_free_builtname_generic: + free(builtname_generic); +error_free_builtname: + free(builtname); +error_free_scan_el_dir: + free(scan_el_dir); +error_ret: + return ret; +} + +int iioutils_get_param_float(float *output, + const char *param_name, + const char *device_dir, + const char *name, + const char *generic_name) +{ + FILE *sysfsfp; + int ret; + DIR *dp; + char *builtname, *builtname_generic; + char *filename = NULL; + const struct dirent *ent; + + ret = asprintf(&builtname, "%s_%s", name, param_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_ret; + } + ret = asprintf(&builtname_generic, + "%s_%s", generic_name, param_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_free_builtname; + } + dp = opendir(device_dir); + if (dp == NULL) { + ret = -errno; + goto error_free_builtname_generic; + } + while (ent = readdir(dp), ent != NULL) + if ((strcmp(builtname, ent->d_name) == 0) || + (strcmp(builtname_generic, ent->d_name) == 0)) { + ret = asprintf(&filename, + "%s/%s", device_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_closedir; + } + sysfsfp = fopen(filename, "r"); + if (!sysfsfp) { + ret = -errno; + goto error_free_filename; + } + fscanf(sysfsfp, "%f", output); + break; + } +error_free_filename: + if (filename) + free(filename); +error_closedir: + closedir(dp); +error_free_builtname_generic: + free(builtname_generic); +error_free_builtname: + free(builtname); +error_ret: + return ret; +} + +/** + * bsort_channel_array_by_index() - reorder so that the array is in index order + * + **/ + +void bsort_channel_array_by_index(struct iio_channel_info **ci_array, + int cnt) +{ + + struct iio_channel_info temp; + int x, y; + + for (x = 0; x < cnt; x++) + for (y = 0; y < (cnt - 1); y++) + if ((*ci_array)[y].index > (*ci_array)[y+1].index) { + temp = (*ci_array)[y + 1]; + (*ci_array)[y + 1] = (*ci_array)[y]; + (*ci_array)[y] = temp; + } +} + +/** + * build_channel_array() - function to figure out what channels are present + * @device_dir: the IIO device directory in sysfs + * @ + **/ +int build_channel_array(const char *device_dir, + struct iio_channel_info **ci_array, + int *counter) +{ + DIR *dp; + FILE *sysfsfp; + int count, i; + struct iio_channel_info *current; + int ret; + const struct dirent *ent; + char *scan_el_dir; + char *filename; + + *counter = 0; + ret = asprintf(&scan_el_dir, FORMAT_SCAN_ELEMENTS_DIR, device_dir); + if (ret < 0) { + ret = -ENOMEM; + goto error_ret; + } + dp = opendir(scan_el_dir); + if (dp == NULL) { + ret = -errno; + goto error_free_name; + } + while (ent = readdir(dp), ent != NULL) + if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), + "_en") == 0) { + ret = asprintf(&filename, + "%s/%s", scan_el_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_close_dir; + } + sysfsfp = fopen(filename, "r"); + if (sysfsfp == NULL) { + ret = -errno; + free(filename); + goto error_close_dir; + } + fscanf(sysfsfp, "%i", &ret); + if (ret == 1) + (*counter)++; + fclose(sysfsfp); + free(filename); + } + *ci_array = malloc(sizeof(**ci_array) * (*counter)); + if (*ci_array == NULL) { + ret = -ENOMEM; + goto error_close_dir; + } + seekdir(dp, 0); + count = 0; + while (ent = readdir(dp), ent != NULL) { + if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), + "_en") == 0) { + int current_enabled = 0; + + current = &(*ci_array)[count++]; + ret = asprintf(&filename, + "%s/%s", scan_el_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + /* decrement count to avoid freeing name */ + count--; + goto error_cleanup_array; + } + sysfsfp = fopen(filename, "r"); + if (sysfsfp == NULL) { + free(filename); + ret = -errno; + goto error_cleanup_array; + } + fscanf(sysfsfp, "%i", ¤t_enabled); + fclose(sysfsfp); + + if (!current_enabled) { + free(filename); + count--; + continue; + } + + current->scale = 1.0; + current->offset = 0; + current->name = strndup(ent->d_name, + strlen(ent->d_name) - + strlen("_en")); + if (current->name == NULL) { + free(filename); + ret = -ENOMEM; + goto error_cleanup_array; + } + /* Get the generic and specific name elements */ + ret = iioutils_break_up_name(current->name, + ¤t->generic_name); + if (ret) { + free(filename); + goto error_cleanup_array; + } + ret = asprintf(&filename, + "%s/%s_index", + scan_el_dir, + current->name); + if (ret < 0) { + free(filename); + ret = -ENOMEM; + goto error_cleanup_array; + } + sysfsfp = fopen(filename, "r"); + fscanf(sysfsfp, "%u", ¤t->index); + fclose(sysfsfp); + free(filename); + /* Find the scale */ + ret = iioutils_get_param_float(¤t->scale, + "scale", + device_dir, + current->name, + current->generic_name); + if (ret < 0) + goto error_cleanup_array; + ret = iioutils_get_param_float(¤t->offset, + "offset", + device_dir, + current->name, + current->generic_name); + if (ret < 0) + goto error_cleanup_array; + ret = iioutils_get_type(¤t->is_signed, + ¤t->bytes, + ¤t->bits_used, + ¤t->shift, + ¤t->mask, + ¤t->be, + device_dir, + current->name, + current->generic_name); + } + } + + closedir(dp); + /* reorder so that the array is in index order */ + bsort_channel_array_by_index(ci_array, *counter); + + return 0; + +error_cleanup_array: + for (i = count - 1; i >= 0; i--) + free((*ci_array)[i].name); + free(*ci_array); +error_close_dir: + closedir(dp); +error_free_name: + free(scan_el_dir); +error_ret: + return ret; +} + +/** + * find_type_by_name() - function to match top level types by name + * @name: top level type instance name + * @type: the type of top level instance being sort + * + * Typical types this is used for are device and trigger. + **/ +int find_type_by_name(const char *name, const char *type) +{ + const struct dirent *ent; + int number, numstrlen; + + FILE *nameFile; + DIR *dp; + char thisname[IIO_MAX_NAME_LENGTH]; + char *filename; + + dp = opendir(iio_dir); + if (dp == NULL) { + printf("No industrialio devices available\n"); + return -ENODEV; + } + + while (ent = readdir(dp), ent != NULL) { + if (strcmp(ent->d_name, ".") != 0 && + strcmp(ent->d_name, "..") != 0 && + strlen(ent->d_name) > strlen(type) && + strncmp(ent->d_name, type, strlen(type)) == 0) { + numstrlen = sscanf(ent->d_name + strlen(type), + "%d", + &number); + /* verify the next character is not a colon */ + if (strncmp(ent->d_name + strlen(type) + numstrlen, + ":", + 1) != 0) { + filename = malloc(strlen(iio_dir) + + strlen(type) + + numstrlen + + 6); + if (filename == NULL) { + closedir(dp); + return -ENOMEM; + } + sprintf(filename, "%s%s%d/name", + iio_dir, + type, + number); + nameFile = fopen(filename, "r"); + if (!nameFile) { + free(filename); + continue; + } + free(filename); + fscanf(nameFile, "%s", thisname); + fclose(nameFile); + if (strcmp(name, thisname) == 0) { + closedir(dp); + return number; + } + } + } + } + closedir(dp); + return -ENODEV; +} + +int _write_sysfs_int(char *filename, char *basedir, int val, int verify) +{ + int ret = 0; + FILE *sysfsfp; + int test; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) + return -ENOMEM; + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "w"); + if (sysfsfp == NULL) { + printf("failed to open %s\n", temp); + ret = -errno; + goto error_free; + } + fprintf(sysfsfp, "%d", val); + fclose(sysfsfp); + if (verify) { + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + printf("failed to open %s\n", temp); + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%d", &test); + fclose(sysfsfp); + if (test != val) { + printf("Possible failure in int write %d to %s%s\n", + val, + basedir, + filename); + ret = -1; + } + } +error_free: + free(temp); + return ret; +} + +int write_sysfs_int(char *filename, char *basedir, int val) +{ + return _write_sysfs_int(filename, basedir, val, 0); +} + +int write_sysfs_int_and_verify(char *filename, char *basedir, int val) +{ + return _write_sysfs_int(filename, basedir, val, 1); +} + +int _write_sysfs_string(char *filename, char *basedir, char *val, int verify) +{ + int ret = 0; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed\n"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "w"); + if (sysfsfp == NULL) { + printf("Could not open %s\n", temp); + ret = -errno; + goto error_free; + } + fprintf(sysfsfp, "%s", val); + fclose(sysfsfp); + if (verify) { + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + printf("could not open file to verify\n"); + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%s", temp); + fclose(sysfsfp); + if (strcmp(temp, val) != 0) { + printf("Possible failure in string write of %s " + "Should be %s " + "written to %s\%s\n", + temp, + val, + basedir, + filename); + ret = -1; + } + } +error_free: + free(temp); + + return ret; +} + +/** + * write_sysfs_string_and_verify() - string write, readback and verify + * @filename: name of file to write to + * @basedir: the sysfs directory in which the file is to be found + * @val: the string to write + **/ +int write_sysfs_string_and_verify(char *filename, char *basedir, char *val) +{ + return _write_sysfs_string(filename, basedir, val, 1); +} + +int write_sysfs_string(char *filename, char *basedir, char *val) +{ + return _write_sysfs_string(filename, basedir, val, 0); +} + +int read_sysfs_posint(char *filename, char *basedir) +{ + int ret; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%d\n", &ret); + fclose(sysfsfp); +error_free: + free(temp); + return ret; +} + +int read_sysfs_float(char *filename, char *basedir, float *val) +{ + int ret = 0; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%f\n", val); + fclose(sysfsfp); +error_free: + free(temp); + return ret; +} + +int read_sysfs_string(const char *filename, const char *basedir, char *str) +{ + int ret = 0; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%s\n", str); + fclose(sysfsfp); +error_free: + free(temp); + return ret; +} + +#endif /* _IIO_UTILS_H */ diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.h b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.h new file mode 100644 index 000000000..1bc837b2d --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/iio_utils.h @@ -0,0 +1,71 @@ +#ifndef _IIO_UTILS_H_ +#define _IIO_UTILS_H_ + +/* IIO - useful set of util functionality + * + * Copyright (c) 2008 Jonathan Cameron + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include + +/* Made up value to limit allocation sizes */ +#define IIO_MAX_NAME_LENGTH 30 + +#define FORMAT_SCAN_ELEMENTS_DIR "%s/scan_elements" +#define FORMAT_TYPE_FILE "%s_type" + +extern const char *iio_dir; + +/** + * struct iio_channel_info - information about a given channel + * @name: channel name + * @generic_name: general name for channel type + * @scale: scale factor to be applied for conversion to si units + * @offset: offset to be applied for conversion to si units + * @index: the channel index in the buffer output + * @bytes: number of bytes occupied in buffer output + * @mask: a bit mask for the raw output + * @is_signed: is the raw value stored signed + * @enabled: is this channel enabled + **/ +struct iio_channel_info { + char *name; + char *generic_name; + float scale; + float offset; + unsigned index; + unsigned bytes; + unsigned bits_used; + unsigned shift; + uint64_t mask; + unsigned be; + unsigned is_signed; + unsigned location; +}; + +int iioutils_break_up_name(const char *full_name, char **generic_name); +int iioutils_get_type(unsigned *is_signed, unsigned *bytes, + unsigned *bits_used, unsigned *shift, + uint64_t *mask, unsigned *be, + const char *device_dir, const char *name, + const char *generic_name); +int iioutils_get_param_float(float *output, const char *param_name, + const char *device_dir, const char *name, + const char *generic_name); +void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt); +int build_channel_array(const char *device_dir, + struct iio_channel_info **ci_array, int *counter); +int find_type_by_name(const char *name, const char *type); +int write_sysfs_int(char *filename, char *basedir, int val); +int write_sysfs_int_and_verify(char *filename, char *basedir, int val); +int write_sysfs_string_and_verify(char *filename, char *basedir, char *val); +int write_sysfs_string(char *filename, char *basedir, char *val); +int read_sysfs_posint(char *filename, char *basedir); +int read_sysfs_float(char *filename, char *basedir, float *val); +int read_sysfs_string(const char *filename, const char *basedir, char *str); + +#endif /* _IIO_UTILS_H_ */ diff --git a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb index e854834b6..0167a33e3 100644 --- a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb +++ b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb @@ -37,6 +37,7 @@ RDEPENDS_${PN}_append_ccimx6ul = "\ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-bt", "", d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-btconfig", "", d)} \ dey-examples-adc \ + dey-examples-adc-cmp \ dey-examples-can \ dey-examples-cloudconnector \ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-hdp", "", d)} \ From a3bced4a17aee3ae1cad269be1d633e46d508701 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 12 May 2017 15:30:18 +0200 Subject: [PATCH 21/95] awsiotsdk-demo: add recipe to compile the AWS IoT device SDK demo application https://jira.digi.com/browse/DEL-4149 Signed-off-by: Tatiana Leon --- .../awsiotsdk-c/awsiotsdk-demo_git.bb | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-demo_git.bb diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-demo_git.bb b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-demo_git.bb new file mode 100644 index 000000000..156f6eed8 --- /dev/null +++ b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-demo_git.bb @@ -0,0 +1,51 @@ +# Copyright (C) 2017 Digi International. + +SUMMARY = "AWS IoT device SDK Demo" +DESCRIPTION = "Demo application for AWS IoT device SDK" +SECTION = "base" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" + +DEPENDS = "awsiotsdk-c confuse" + +AWS_USER_LED ?= "" +AWS_USER_LED_ccimx6ulstarter ?= "75" +AWS_USER_LED_ccimx6ulsbc ?= "488" +AWS_USER_LED_ccimx6sbc ?= "34" + +SRCBRANCH = "master" +SRCREV = "${AUTOREV}" + +CC_STASH = "${DIGI_MTK_GIT}dey/dey-examples.git;protocol=ssh" +CC_GITHUB = "${DIGI_GITHUB_GIT}/dey-examples.git;protocol=git" + +CC_GIT_URI ?= "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${CC_STASH}', '${CC_GITHUB}', d)}" + +SRC_URI = "${CC_GIT_URI};branch=${SRCBRANCH}" + +S = "${WORKDIR}/git/awsiot-sample" + +inherit awsiotsdk-c pkgconfig + +EXTRA_OEMAKE += "'LOG_FLAGS=${@get_log_level(d)}'" + +do_configure() { + # Update the configuration header file. + sed -i -e "s,\(thing_name = \)\"\",\1\"${AWS_IOT_MY_THING_NAME}\",g" \ + -e "s,\(host = \)\"\",\1\"${AWS_IOT_MQTT_HOST}\",g" \ + -e "s,8883,${AWS_IOT_MQTT_PORT},g" \ + -e "s,\([\"']\)rootCA.crt\([\"']\),\1${AWS_IOT_ROOT_CA_FILENAME}\2,g" \ + -e "s,\([\"']\)cert.pem\([\"']\),\1${AWS_IOT_CERTIFICATE_FILENAME}\2,g" \ + -e "s,\([\"']\)privkey.pem\([\"']\),\1${AWS_IOT_PRIVATE_KEY_FILENAME}\2,g" \ + -e "s,\(user_led = \)-1,\1${AWS_USER_LED},g" \ + "${S}/cfg_files/awsiotsdk.conf" +} + +do_install() { + oe_runmake DESTDIR=${D} install +} + +RDEPENDS_${PN} = "awsiotsdk-c-cert" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + From 0ae172613ab52a20a0316ac3f6a21517fce5287b Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Fri, 19 May 2017 15:35:26 +0200 Subject: [PATCH 22/95] memwatch: [cosmetic] fix output format The new line should be printed after the result, instead of before. Example: root@ccimx6sbc:~# memwatch -r -w -a 0x2190034 0x02190034: 0x00000000 root@ccimx6sbc:~# After this patch: root@ccimx6sbc:~# memwatch -r -w -a 0x2190034 0x02190034: 0x00000000 Signed-off-by: Diaz de Grenu, Jose --- meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c b/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c index 82c206b81..890b2800b 100644 --- a/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c +++ b/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c @@ -1,7 +1,7 @@ /* * memwatch.c: Program to read/write from/to memory. * - * Copyright (C) 2006 by Digi International Inc. + * Copyright (C) 2006-2017 by Digi International Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -243,10 +243,10 @@ int main( int argc, char** argv ) } if( ( verbose < VERB_PRNT_ADDR ) && ( j % 16 == 0 ) ) { - printf( "\n0x%08lx: ", address + j ); + printf( "0x%08lx: ", address + j ); } print_hex_formated( rd_val, access ); - + printf("\n"); } else { if( filename != NULL ) { if( ( ret = read( fd_file, &wr_val, access ) ) != access ) { From f8c28885293d6d11447cee47cdf887c97a753310 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 22 May 2017 09:40:02 +0200 Subject: [PATCH 23/95] wpa_supplicant: add missing leading space for 'append' command Signed-off-by: Javier Viguera --- .../wpa-supplicant/wpa-supplicant_%.bbappend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend index 28bb0c349..24383d38a 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend @@ -4,7 +4,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" PACKAGECONFIG ?= "openssl" -SRC_URI_append_ccimx6ul = "file://wpa_supplicant_p2p.conf" +SRC_URI_append_ccimx6ul = " file://wpa_supplicant_p2p.conf" do_install_append_ccimx6ul() { install -m 600 ${WORKDIR}/wpa_supplicant_p2p.conf ${D}${sysconfdir}/wpa_supplicant_p2p.conf From f9acd0af7cfd169afdd59770ca34dbf3cbda980e Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Mon, 22 May 2017 10:40:32 +0200 Subject: [PATCH 24/95] kernel-module-qualcomm: remove patches Since 30c253e108db16f the module is compiled from a repository which already includes the patches, so we can remove them from DEY. Signed-off-by: Diaz de Grenu, Jose --- ...ling-errors-when-BUILD_DEBUG_VERSION.patch | 64 ------ ...vendor_event_alloc-call-for-newer-ke.patch | 57 ----- ...date-cfg80211_ap_stopped-to-nl80211_.patch | 30 --- .../0004-qcacld-2.0-remove-unused-code.patch | 215 ------------------ ...header-file-for-regulatory_hint_user.patch | 28 --- ...06-Updating-calls-to-alloc_netdev_mq.patch | 75 ------ ...1-update-cfg80211_inform_bss-params-.patch | 28 --- ...ate-call-to-cfg80211_rx_mgmt-for-dif.patch | 45 ---- .../0009-linux_ac-Fix-for-f_dentry.patch | 43 ---- ...hif-Do-not-call-to-HIGH-SPEED-functi.patch | 70 ------ ...for-undefined-ath_sysctl_pktlog_size.patch | 24 -- ...ilation-flag-based-on-kernel-support.patch | 37 --- ...mpile-the-DEBUG-version-inconditiona.patch | 25 -- ...p-most-of-the-relevant-DEBUG-options.patch | 48 ---- ...dd_cfg80211-fix-missing-ifdef-clause.patch | 28 --- .../0016-Add-.gitignore-rules.patch | 25 -- ...itialize-all-adapter-completion-vari.patch | 206 ----------------- ...ate-disconnect-event-to-upper-layers.patch | 76 ------- ...nt-con_mode-to-clearly-see-if-in-FTM.patch | 26 --- ...BUILD_DEBUG_VERSION-to-kbuild-system.patch | 23 -- .../0021-cosmetic-change-log-level.patch | 53 ----- .../0022-fix-issue-with-_scan_callback.patch | 102 --------- 22 files changed, 1328 deletions(-) delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-qcacld-Fix-compiling-errors-when-BUILD_DEBUG_VERSION.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0002-Update-cfg80211_vendor_event_alloc-call-for-newer-ke.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0003-wlan_hdd_main-Update-cfg80211_ap_stopped-to-nl80211_.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0004-qcacld-2.0-remove-unused-code.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0005-Including-header-file-for-regulatory_hint_user.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0006-Updating-calls-to-alloc_netdev_mq.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0007-wlan_hdd_cfg80211-update-cfg80211_inform_bss-params-.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0008-wlan_hdd_p2p-Update-call-to-cfg80211_rx_mgmt-for-dif.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0009-linux_ac-Fix-for-f_dentry.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0010-native_sdio-src-hif-Do-not-call-to-HIGH-SPEED-functi.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0011-osdep_adf.h-fix-for-undefined-ath_sysctl_pktlog_size.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0012-Kbuild-Add-compilation-flag-based-on-kernel-support.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-Add-.gitignore-rules.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-cosmetic-change-log-level.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0022-fix-issue-with-_scan_callback.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-qcacld-Fix-compiling-errors-when-BUILD_DEBUG_VERSION.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-qcacld-Fix-compiling-errors-when-BUILD_DEBUG_VERSION.patch deleted file mode 100644 index 63847821a..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0001-qcacld-Fix-compiling-errors-when-BUILD_DEBUG_VERSION.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: Yi Chen -Date: Fri, 28 Aug 2015 19:24:45 +0800 -Subject: [PATCH] qcacld: Fix compiling errors when BUILD_DEBUG_VERSION := 0. - -This is a compiling issue when BUILD_DEBUG_VERSION := 0 is set in Kbuild. - -Change-Id: Iaee98eb91d66990dfa4989a7c07cb5592f8a6079 -CRs-Fixed: 898366 -(cherry picked from commit d0258ff1dcf19236e4cfa69e45f75b72a1334609) ---- - CORE/UTILS/FWLOG/dbglog_host.c | 4 ++-- - Kbuild | 8 ++++---- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/CORE/UTILS/FWLOG/dbglog_host.c b/CORE/UTILS/FWLOG/dbglog_host.c -index 2dfa45983a87..63fc742259fc 100644 ---- a/CORE/UTILS/FWLOG/dbglog_host.c -+++ b/CORE/UTILS/FWLOG/dbglog_host.c -@@ -55,8 +55,6 @@ - #include - #define FWLOG_DEBUG ATH_DEBUG_MAKE_MODULE_MASK(0) - --#if defined(DEBUG) -- - static bool appstarted = FALSE; - static bool senddriverstatus = FALSE; - static bool kd_nl_init = FALSE; -@@ -64,6 +62,8 @@ static int cnss_diag_pid = INVALID_PID; - static int get_version = 0; - static int gprint_limiter = 0; - -+#if defined(DEBUG) -+ - static ATH_DEBUG_MASK_DESCRIPTION g_fwlogDebugDescription[] = { - {FWLOG_DEBUG,"fwlog"}, - }; -diff --git a/Kbuild b/Kbuild -index 04461cfb7945..b248eee28bf0 100644 ---- a/Kbuild -+++ b/Kbuild -@@ -882,7 +882,6 @@ CDEFINES := -DANI_LITTLE_BYTE_ENDIAN \ - -DWLAN_PERF \ - -DPTT_SOCK_SVC_ENABLE \ - -Wall\ -- -Werror\ - -D__linux__ \ - -DHAL_SELF_STA_PER_BSS=1 \ - -DWLAN_FEATURE_VOWIFI_11R \ -@@ -966,11 +965,12 @@ CDEFINES += -DWCN_PRONTO - CDEFINES += -DWCN_PRONTO_V1 - endif - -+CDEFINES += -DTRACE_RECORD \ -+ -DLIM_TRACE_RECORD \ -+ -DSME_TRACE_RECORD -+ - ifeq ($(BUILD_DEBUG_VERSION),1) - CDEFINES += -DWLAN_DEBUG \ -- -DTRACE_RECORD \ -- -DLIM_TRACE_RECORD \ -- -DSME_TRACE_RECORD \ - -DPE_DEBUG_LOGW \ - -DPE_DEBUG_LOGE \ - -DDEBUG diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0002-Update-cfg80211_vendor_event_alloc-call-for-newer-ke.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0002-Update-cfg80211_vendor_event_alloc-call-for-newer-ke.patch deleted file mode 100644 index 221547159..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0002-Update-cfg80211_vendor_event_alloc-call-for-newer-ke.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Isaac Hermida -Date: Mon, 18 Apr 2016 08:48:14 +0200 -Subject: [PATCH] Update cfg80211_vendor_event_alloc call for newer kernel - versions - -Current compilation fails with next error. - -> wlan_hdd_cfg80211.h:995:9: error: too few arguments to function 'cfg80211_vendor_event_alloc' - -This function has been updated starting with kernel 3.15 - -Signed-off-by: Isaac Hermida ---- - CORE/HDD/inc/wlan_hdd_cfg80211.h | 2 +- - CORE/HDD/src/wlan_hdd_assoc.c | 8 ++++++++ - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h -index 7602f1d3874b..a40c55144bc5 100644 ---- a/CORE/HDD/inc/wlan_hdd_cfg80211.h -+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h -@@ -992,7 +992,7 @@ backported_cfg80211_vendor_event_alloc(struct wiphy *wiphy, - int approxlen, - int event_idx, gfp_t gfp) - { -- return cfg80211_vendor_event_alloc(wiphy, approxlen, event_idx, gfp); -+ return cfg80211_vendor_event_alloc(wiphy, wdev, approxlen, event_idx, gfp); - } - #define cfg80211_vendor_event_alloc backported_cfg80211_vendor_event_alloc - #endif -diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c -index bc3e15009d97..5dc882fa8f83 100644 ---- a/CORE/HDD/src/wlan_hdd_assoc.c -+++ b/CORE/HDD/src/wlan_hdd_assoc.c -@@ -2027,6 +2027,8 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, - eRoamCmdStatus roamStatus, - eCsrRoamResult roamResult ) - { -+ struct ieee80211_channel *chann; -+ - hddLog(VOS_TRACE_LEVEL_INFO, "%s: %s: id %d, status %d, result %d", - __func__, pAdapter->dev->name, roamId, roamStatus, roamResult); - -@@ -2082,7 +2084,13 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter, - return; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) -+ chann = ieee80211_get_channel(pAdapter->wdev.wiphy, -+ (int)pRoamInfo->pBssDesc->channelId); -+ cfg80211_ibss_joined(pAdapter->dev, bss->bssid, chann, GFP_KERNEL); -+#else - cfg80211_ibss_joined(pAdapter->dev, bss->bssid, GFP_KERNEL); -+#endif - cfg80211_put_bss( - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) || defined(WITH_BACKPORTS) - pHddCtx->wiphy, diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0003-wlan_hdd_main-Update-cfg80211_ap_stopped-to-nl80211_.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0003-wlan_hdd_main-Update-cfg80211_ap_stopped-to-nl80211_.patch deleted file mode 100644 index 86c6a4ca7..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0003-wlan_hdd_main-Update-cfg80211_ap_stopped-to-nl80211_.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 10:30:51 +0200 -Subject: [PATCH] wlan_hdd_main: Update cfg80211_ap_stopped to - nl80211_send_ap_stopped - -Use nl80211_send_ap_stopped instead of cfg80211_ap_stopped for newer -kernel versions - -Signed-off-by: Isaac Hermida ---- - CORE/HDD/src/wlan_hdd_main.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c -index 5e4e95aaaee4..0ff3f31b9863 100755 ---- a/CORE/HDD/src/wlan_hdd_main.c -+++ b/CORE/HDD/src/wlan_hdd_main.c -@@ -9929,8 +9929,12 @@ VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ) - #if defined(MSM_PLATFORM) && !defined(WITH_BACKPORTS) - hddLog(VOS_TRACE_LEVEL_ERROR, "%s [SSR] send stop ap to supplicant", - __func__); -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) - cfg80211_ap_stopped(pAdapter->dev, GFP_KERNEL); - #else -+ nl80211_send_ap_stopped(pAdapter->dev->ieee80211_ptr); -+#endif -+#else - hddLog(VOS_TRACE_LEVEL_ERROR, "%s [SSR] send restart supplicant", - __func__); - /* event supplicant to restart */ diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0004-qcacld-2.0-remove-unused-code.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0004-qcacld-2.0-remove-unused-code.patch deleted file mode 100644 index 09b3ee892..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0004-qcacld-2.0-remove-unused-code.patch +++ /dev/null @@ -1,215 +0,0 @@ -From: Karthick S -Date: Fri, 14 Aug 2015 14:52:23 +0530 -Subject: [PATCH] qcacld-2.0: remove unused code - -Removed unused code from ReinitSDIO. Also removed mmcbusmode and it's -related references in the code. - -Change-Id: Idaa40f31cc830c0e2fa5d6fbda8c78c9f434bdaf -CRs-Fixed: 890630 -(cherry picked from commit acca7f817db52580a985de2804f30973b2ed9cb7) - -Signed-off-by: Isaac Hermida -(cherry picked from commit d63533a6cc46671141ac31290e4f020c236298ee) ---- - CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c | 165 +-------------------- - 1 file changed, 2 insertions(+), 163 deletions(-) - -diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -index 31641c94351c..b3afed2a8d7c 100644 ---- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -+++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -@@ -57,11 +57,6 @@ - - #define MAX_HIF_DEVICES 2 - --unsigned int mmcbusmode = 0; --module_param(mmcbusmode, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); --MODULE_PARM_DESC(mmcbusmode, "Set MMC driver Bus Mode: 1-SDR12, 2-SDR25, 3-SDR50, 4-DDR50, 5-SDR104"); --EXPORT_SYMBOL(mmcbusmode); -- - unsigned int mmcbuswidth = 0; - module_param(mmcbuswidth, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - MODULE_PARM_DESC(mmcbuswidth, "Set MMC driver Bus Width: 1-1Bit, 4-4Bit, 8-8Bit"); -@@ -689,98 +684,6 @@ A_STATUS ReinitSDIO(HIF_DEVICE *device) - sdio_claim_host(func); - - do { -- /* 2.6.32 kernel does part of the SDIO initalization upon resume */ -- A_BOOL lt_2_6_32 = (LINUX_VERSION_CODEocr_avail) - 1; -- /* emulate the mmc_power_up(...) */ -- host->ios.vdd = bit; -- host->ios.chip_select = MMC_CS_DONTCARE; -- host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; -- host->ios.power_mode = MMC_POWER_UP; -- host->ios.bus_width = MMC_BUS_WIDTH_1; -- host->ios.timing = MMC_TIMING_LEGACY; -- host->ops->set_ios(host, &host->ios); -- /* -- * This delay should be sufficient to allow the power supply -- * to reach the minimum voltage. -- */ -- msleep(2); -- -- host->ios.clock = host->f_min; -- host->ios.power_mode = MMC_POWER_ON; -- host->ops->set_ios(host, &host->ios); -- -- /* -- * This delay must be at least 74 clock sizes, or 1 ms, or the -- * time required to reach a stable voltage. -- */ -- msleep(2); -- -- /* Issue CMD0. Goto idle state */ -- host->ios.chip_select = MMC_CS_HIGH; -- host->ops->set_ios(host, &host->ios); -- msleep(1); -- err = IssueSDCommand(device, MMC_GO_IDLE_STATE, 0, (MMC_RSP_NONE | MMC_CMD_BC), NULL); -- host->ios.chip_select = MMC_CS_DONTCARE; -- host->ops->set_ios(host, &host->ios); -- msleep(1); -- host->use_spi_crc = 0; -- -- if (err) { -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD0 failed : %d \n",err)); -- break; -- } -- -- if (!host->ocr) { -- /* Issue CMD5, arg = 0 */ -- err = IssueSDCommand(device, SD_IO_SEND_OP_COND, 0, (MMC_RSP_R4 | MMC_CMD_BCR), &resp); -- if (err) { -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD5 failed : %d \n",err)); -- break; -- } -- host->ocr = resp; -- } -- -- /* Issue CMD5, arg = ocr. Wait till card is ready */ -- for (i=0;i<100;i++) { -- err = IssueSDCommand(device, SD_IO_SEND_OP_COND, host->ocr, (MMC_RSP_R4 | MMC_CMD_BCR), &resp); -- if (err) { -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD5 failed : %d \n",err)); -- break; -- } -- if (resp & MMC_CARD_BUSY) { -- break; -- } -- msleep(10); -- } -- -- if ((i == 100) || (err)) { -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: card in not ready : %d %d \n",i,err)); -- break; -- } -- -- /* Issue CMD3, get RCA */ -- err = IssueSDCommand(device, SD_SEND_RELATIVE_ADDR, 0, MMC_RSP_R6 | MMC_CMD_BCR, &resp); -- if (err) { -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD3 failed : %d \n",err)); -- break; -- } -- rca = resp >> 16; -- host->ios.bus_mode = MMC_BUSMODE_PUSHPULL; -- host->ops->set_ios(host, &host->ios); -- -- /* Issue CMD7, select card */ -- err = IssueSDCommand(device, MMC_SELECT_CARD, (rca << 16), MMC_RSP_R1 | MMC_CMD_AC, NULL); -- if (err) { -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD7 failed : %d \n",err)); -- break; -- } -- } -- - /* Enable high speed */ - if (card->host->caps & MMC_CAP_SD_HIGHSPEED) { - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("ReinitSDIO: Set high speed mode\n")); -@@ -1212,10 +1115,7 @@ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Powe - */ - { - A_UINT32 clock, clock_set = 12500000; --#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0) -- unsigned int bus_speed = 0, timing = 0; -- unsigned char speed = 0; --#endif -+ - sdio_claim_host(func); - if (writecccr1) { - A_UINT32 err = Func0_CMD52WriteByte(func->card, -@@ -1352,69 +1252,8 @@ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Powe - if (debugcccr) { - HIFDumpCCCR(device); - } -- // Set MMC Bus Mode: 1-SDR12, 2-SDR25, 3-SDR50, 4-DDR50, 5-SDR104 -- if (mmcbusmode > 0) { -- printk("host caps:0x%08X, card_sd3_bus_mode:0x%08X\n", (unsigned int)func->card->host->caps, (unsigned int)func->card->sw_caps.sd3_bus_mode); -- if (mmcbusmode == 5 && (func->card->host->caps & MMC_CAP_UHS_SDR104) && -- ((func->card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR104) || forcecard)) { -- bus_speed = SDIO_SPEED_SDR104; -- timing = MMC_TIMING_UHS_SDR104; -- func->card->sw_caps.uhs_max_dtr = UHS_SDR104_MAX_DTR; -- AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("%s: Set MMC bus mode to SDR104. \n", __func__)); -- } else if (mmcbusmode == 4 && (func->card->host->caps & MMC_CAP_UHS_DDR50) && -- ((func->card->sw_caps.sd3_bus_mode & SD_MODE_UHS_DDR50) || forcecard)) { -- bus_speed = SDIO_SPEED_DDR50; -- timing = MMC_TIMING_UHS_DDR50; -- func->card->sw_caps.uhs_max_dtr = UHS_DDR50_MAX_DTR; -- AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("%s: Set MMC bus mode to DDR50. \n", __func__)); -- } else if (mmcbusmode == 3 && (func->card->host->caps & (MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50)) && -- ((func->card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50) || forcecard)) { -- bus_speed = SDIO_SPEED_SDR50; -- timing = MMC_TIMING_UHS_SDR50; -- func->card->sw_caps.uhs_max_dtr = UHS_SDR50_MAX_DTR; -- AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("%s: Set MMC bus mode to SDR50. \n", __func__)); -- } else if (mmcbusmode == 2 && (func->card->host->caps & -- (MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR25)) && -- ((func->card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR25) || forcecard)) { -- bus_speed = SDIO_SPEED_SDR25; -- timing = MMC_TIMING_UHS_SDR25; -- func->card->sw_caps.uhs_max_dtr = UHS_SDR25_MAX_DTR; -- AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("%s: Set MMC bus mode to SDR25. \n", __func__)); -- } else if (mmcbusmode == 1 && (func->card->host->caps & (MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | -- MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR12)) && -- ((func->card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR12) || forcecard)) { -- bus_speed = SDIO_SPEED_SDR12; -- timing = MMC_TIMING_UHS_SDR12; -- func->card->sw_caps.uhs_max_dtr = UHS_SDR12_MAX_DTR; -- AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("%s: Set MMC bus mode to SDR12. \n", __func__)); -- } else { -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: MMC bus mode %d not supported. \n", __func__, mmcbusmode)); -- return ret = -1; -- } -- -- ret = Func0_CMD52ReadByte(func->card, SDIO_CCCR_SPEED, &speed); -- if (ret){ -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: CMD52 to get CCCR SPEED failed: %d, cap_uhs: %lu, sd3_bus_mode: %x \n", __func__, ret, (long unsigned int)(func->card->host->caps & (MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR12)), func->card->sw_caps.sd3_bus_mode)); -- return ret; -- } -- -- speed &= ~SDIO_SPEED_BSS_MASK; -- speed |= bus_speed; -- ret = Func0_CMD52WriteByte(func->card, SDIO_CCCR_SPEED, speed); -- if (ret){ -- AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: CMD52 to set CCCR SPPED failed: %d \n", __func__, ret)); -- return ret; -- } -- -- if (bus_speed) { -- device->host->ios.timing = timing; -- device->host->ops->set_ios(device->host, &device->host->ios); -- // mmc_set_clock(func->card->host, func->card->sw_caps.uhs_max_dtr); -- } -- } -- --#endif //#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0) */ - sdio_release_host(func); - } - diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0005-Including-header-file-for-regulatory_hint_user.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0005-Including-header-file-for-regulatory_hint_user.patch deleted file mode 100644 index 750db8f12..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0005-Including-header-file-for-regulatory_hint_user.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 13:19:10 +0200 -Subject: [PATCH] Including header file for "regulatory_hint_user" - -The function "regulatory_hint_user" has been moved from -include/net/cfg80211.h to net/wireless/reg.h. - -Signed-off-by: Isaac Hermida -(cherry picked from commit db944bc907127c191b1bbdcc58d3aecedcf44a8c) ---- - CORE/VOSS/src/vos_nvitem.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c -index d79ae2871e4b..47290c9d1744 100644 ---- a/CORE/VOSS/src/vos_nvitem.c -+++ b/CORE/VOSS/src/vos_nvitem.c -@@ -53,6 +53,10 @@ - #include "regdomain.h" - #include "regdomain_common.h" - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) -+#include <../net/wireless/reg.h> -+#endif -+ - #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) && !defined(WITH_BACKPORTS) - #define IEEE80211_CHAN_NO_80MHZ 1<<7 - #endif diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0006-Updating-calls-to-alloc_netdev_mq.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0006-Updating-calls-to-alloc_netdev_mq.patch deleted file mode 100644 index 644edbf66..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0006-Updating-calls-to-alloc_netdev_mq.patch +++ /dev/null @@ -1,75 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 13:52:18 +0200 -Subject: [PATCH] Updating calls to "alloc_netdev_mq" - -Signed-off-by: Isaac Hermida ---- - CORE/EPPING/src/epping_txrx.c | 6 ++++++ - CORE/HDD/src/wlan_hdd_hostapd.c | 4 ++++ - CORE/HDD/src/wlan_hdd_main.c | 10 +++++++--- - 3 files changed, 17 insertions(+), 3 deletions(-) - -diff --git a/CORE/EPPING/src/epping_txrx.c b/CORE/EPPING/src/epping_txrx.c -index 678d58e0cfae..0985e362f94a 100644 ---- a/CORE/EPPING/src/epping_txrx.c -+++ b/CORE/EPPING/src/epping_txrx.c -@@ -355,7 +355,13 @@ epping_adapter_t *epping_add_adapter(epping_context_t *pEpping_ctx, - struct net_device *dev; - epping_adapter_t *pAdapter; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) -+ dev = alloc_netdev(sizeof(epping_adapter_t), "wifi%d", NET_NAME_UNKNOWN, ether_setup); -+#else - dev = alloc_netdev(sizeof(epping_adapter_t), "wifi%d", ether_setup); -+#endif -+ -+ - if (dev == NULL) { - EPPING_LOG(VOS_TRACE_LEVEL_FATAL, - "%s: Cannot allocate epping_adapter_t\n", __func__); -diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c -index 6251224c11df..8a80d26f355a 100644 ---- a/CORE/HDD/src/wlan_hdd_hostapd.c -+++ b/CORE/HDD/src/wlan_hdd_hostapd.c -@@ -5447,7 +5447,11 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd - - hddLog(VOS_TRACE_LEVEL_DEBUG, "%s: iface_name = %s", __func__, iface_name); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) -+ pWlanHostapdDev = alloc_netdev_mq(sizeof(hdd_adapter_t), iface_name, NET_NAME_UNKNOWN, ether_setup, NUM_TX_QUEUES); -+#else - pWlanHostapdDev = alloc_netdev_mq(sizeof(hdd_adapter_t), iface_name, ether_setup, NUM_TX_QUEUES); -+#endif - - if (pWlanHostapdDev != NULL) - { -diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c -index 0ff3f31b9863..a10da2a9b164 100755 ---- a/CORE/HDD/src/wlan_hdd_main.c -+++ b/CORE/HDD/src/wlan_hdd_main.c -@@ -8226,7 +8226,11 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac - /* - * cfg80211 initialization and registration.... - */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) -+ pWlanDev = alloc_netdev_mq(sizeof( hdd_adapter_t ), name, NET_NAME_UNKNOWN, ether_setup, NUM_TX_QUEUES); -+#else - pWlanDev = alloc_netdev_mq(sizeof( hdd_adapter_t ), name, ether_setup, NUM_TX_QUEUES); -+#endif - - if(pWlanDev != NULL) - { -@@ -9929,10 +9933,10 @@ VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ) - #if defined(MSM_PLATFORM) && !defined(WITH_BACKPORTS) - hddLog(VOS_TRACE_LEVEL_ERROR, "%s [SSR] send stop ap to supplicant", - __func__); --#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) -- cfg80211_ap_stopped(pAdapter->dev, GFP_KERNEL); --#else -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) - nl80211_send_ap_stopped(pAdapter->dev->ieee80211_ptr); -+#else -+ cfg80211_ap_stopped(pAdapter->dev, GFP_KERNEL); - #endif - #else - hddLog(VOS_TRACE_LEVEL_ERROR, "%s [SSR] send restart supplicant", diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0007-wlan_hdd_cfg80211-update-cfg80211_inform_bss-params-.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0007-wlan_hdd_cfg80211-update-cfg80211_inform_bss-params-.patch deleted file mode 100644 index 58df7fd70..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0007-wlan_hdd_cfg80211-update-cfg80211_inform_bss-params-.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 13:56:15 +0200 -Subject: [PATCH] wlan_hdd_cfg80211: update "cfg80211_inform_bss" params for - kernel version - -Signed-off-by: Isaac Hermida ---- - CORE/HDD/src/wlan_hdd_cfg80211.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c -index c09ac0304852..c6c79552a9d0 100644 ---- a/CORE/HDD/src/wlan_hdd_cfg80211.c -+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c -@@ -8460,8 +8460,11 @@ static struct cfg80211_bss* wlan_hdd_cfg80211_inform_bss( - WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); - if (bss == NULL) { - rssi = (VOS_MIN ((pBssDesc->rssi + pBssDesc->sinr), 0))*100; -- -- return (cfg80211_inform_bss(wiphy, chan, pBssDesc->bssId, -+ return (cfg80211_inform_bss(wiphy, chan, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) -+ CFG80211_BSS_FTYPE_BEACON, -+#endif -+ pBssDesc->bssId, - le64_to_cpu(*(__le64 *)pBssDesc->timeStamp), - pBssDesc->capabilityInfo, - pBssDesc->beaconInterval, ie, ie_length, diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0008-wlan_hdd_p2p-Update-call-to-cfg80211_rx_mgmt-for-dif.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0008-wlan_hdd_p2p-Update-call-to-cfg80211_rx_mgmt-for-dif.patch deleted file mode 100644 index 773706b5c..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0008-wlan_hdd_p2p-Update-call-to-cfg80211_rx_mgmt-for-dif.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 13:57:03 +0200 -Subject: [PATCH] wlan_hdd_p2p: Update call to "cfg80211_rx_mgmt" for different - kernel versions - -Signed-off-by: Isaac Hermida ---- - CORE/HDD/src/wlan_hdd_p2p.c | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c -index 0c6645f077f1..476b456e165c 100644 ---- a/CORE/HDD/src/wlan_hdd_p2p.c -+++ b/CORE/HDD/src/wlan_hdd_p2p.c -@@ -826,7 +826,16 @@ void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ) - // Check for cached action frame - if(pRemainChanCtx->action_pkt_buff.frame_length != 0) - { --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) || defined(WITH_BACKPORTS) -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) -+ cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, -+ pRemainChanCtx->action_pkt_buff.freq, 0, -+ pRemainChanCtx->action_pkt_buff.frame_ptr, -+ pRemainChanCtx->action_pkt_buff.frame_length, -+ NL80211_RXMGMT_FLAG_ANSWERED); -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) || defined(WITH_BACKPORTS) -+ -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) || defined(WITH_BACKPORTS) - cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, - pRemainChanCtx->action_pkt_buff.freq, 0, - pRemainChanCtx->action_pkt_buff.frame_ptr, -@@ -2340,7 +2349,11 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, - - //Indicate Frame Over Normal Interface - hddLog( LOG1, FL("Indicate Frame over NL80211 Interface")); --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) || defined(WITH_BACKPORTS) -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) -+ cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames, -+ nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED); -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) || defined(WITH_BACKPORTS) - cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames, - nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED, GFP_ATOMIC); - #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0009-linux_ac-Fix-for-f_dentry.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0009-linux_ac-Fix-for-f_dentry.patch deleted file mode 100644 index f3bbd3bfa..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0009-linux_ac-Fix-for-f_dentry.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 13:58:29 +0200 -Subject: [PATCH] =?UTF-8?q?linux=5Fac:=20Fix=20for=20=E2=80=98f=5Fdentry?= - =?UTF-8?q?=E2=80=99?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://communities.vmware.com/thread/499483?start=0&tstart=0 - -Signed-off-by: Isaac Hermida ---- - CORE/UTILS/PKTLOG/linux_ac.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/CORE/UTILS/PKTLOG/linux_ac.c b/CORE/UTILS/PKTLOG/linux_ac.c -index b1969ad5d2ba..8d45d7365b2b 100644 ---- a/CORE/UTILS/PKTLOG/linux_ac.c -+++ b/CORE/UTILS/PKTLOG/linux_ac.c -@@ -576,7 +576,10 @@ pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos) - int rem_len; - int start_offset, end_offset; - int fold_offset, ppos_data, cur_rd_offset; --#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) -+ struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *) -+ PDE_DATA(file_inode(file)); -+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) - struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *) - PDE_DATA(file->f_dentry->d_inode); - #else -@@ -817,7 +820,10 @@ static struct vm_operations_struct pktlog_vmops = { - - static int pktlog_mmap(struct file *file, struct vm_area_struct *vma) - { --#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) -+ struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *) -+ PDE_DATA(file_inode(file)); -+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) - struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *) - PDE_DATA(file->f_dentry->d_inode); - #else diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0010-native_sdio-src-hif-Do-not-call-to-HIGH-SPEED-functi.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0010-native_sdio-src-hif-Do-not-call-to-HIGH-SPEED-functi.patch deleted file mode 100644 index a2a7ce05e..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0010-native_sdio-src-hif-Do-not-call-to-HIGH-SPEED-functi.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 14:00:59 +0200 -Subject: [PATCH] native_sdio/src/hif: Do not call to HIGH SPEED functions for - newer kernels - -Signed-off-by: Isaac Hermida ---- - CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -index b3afed2a8d7c..1a1e51eff8c7 100644 ---- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -+++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -@@ -690,7 +690,9 @@ A_STATUS ReinitSDIO(HIF_DEVICE *device) - err = Func0_CMD52ReadByte(card, SDIO_CCCR_SPEED, &cmd52_resp); - if (err) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD52 read to CCCR speed register failed : %d \n",err)); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) - card->state &= ~MMC_STATE_HIGHSPEED; -+#endif - /* no need to break */ - } else { - err = Func0_CMD52WriteByte(card, SDIO_CCCR_SPEED, (cmd52_resp | SDIO_SPEED_EHS)); -@@ -698,14 +700,20 @@ A_STATUS ReinitSDIO(HIF_DEVICE *device) - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("ReinitSDIO: CMD52 write to CCCR speed register failed : %d \n",err)); - break; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) - mmc_card_set_highspeed(card); -+#endif - host->ios.timing = MMC_TIMING_SD_HS; - host->ops->set_ios(host, &host->ios); - } - } - - /* Set clock */ -- if (mmc_card_highspeed(card)) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) -+ if (mmc_card_highspeed(card)) { -+#else -+ if (mmc_card_hs(card)) { -+#endif - clock = 50000000; - } else { - clock = card->cis.max_dtr; -@@ -1181,7 +1189,11 @@ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Powe - if (mmcclock > 0){ - clock_set = mmcclock; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) - if (mmc_card_highspeed(func->card)){ -+#else -+ if (mmc_card_hs(func->card)){ -+#endif - clock = 50000000; - } else { - clock = func->card->cis.max_dtr; -@@ -2000,7 +2012,11 @@ addHifDevice(struct sdio_func *func) - hifdevice->func = func; - hifdevice->powerConfig = HIF_DEVICE_POWER_UP; - hifdevice->DeviceState = HIF_DEVICE_STATE_ON; -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) - ret = sdio_set_drvdata(func, hifdevice); -+#else -+ sdio_set_drvdata(func, hifdevice); -+#endif - - EXIT("status %d", ret); - return hifdevice; diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0011-osdep_adf.h-fix-for-undefined-ath_sysctl_pktlog_size.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0011-osdep_adf.h-fix-for-undefined-ath_sysctl_pktlog_size.patch deleted file mode 100644 index 53fc1fb07..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0011-osdep_adf.h-fix-for-undefined-ath_sysctl_pktlog_size.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Isaac Hermida -Date: Thu, 21 Apr 2016 14:32:57 +0200 -Subject: [PATCH] osdep_adf.h: fix for undefined ath_sysctl_pktlog_size - -Signed-off-by: Isaac Hermida ---- - CORE/SERVICES/COMMON/osdep_adf.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/CORE/SERVICES/COMMON/osdep_adf.h b/CORE/SERVICES/COMMON/osdep_adf.h -index 708b6f89fa03..48ca78618840 100644 ---- a/CORE/SERVICES/COMMON/osdep_adf.h -+++ b/CORE/SERVICES/COMMON/osdep_adf.h -@@ -168,6 +168,10 @@ typedef unsigned long TQUEUE_ARG; - #define ATH_SYSCTL_PROC_DOSTRING(ctl, write, filp, buffer, lenp, ppos) \ - proc_dostring(ctl, write, filp, buffer, lenp, ppos) - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) -+typedef struct ctl_table ctl_table; -+#endif -+ - /* - * Byte Order stuff - */ diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0012-Kbuild-Add-compilation-flag-based-on-kernel-support.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0012-Kbuild-Add-compilation-flag-based-on-kernel-support.patch deleted file mode 100644 index de5ce9002..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0012-Kbuild-Add-compilation-flag-based-on-kernel-support.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Isaac Hermida -Date: Thu, 19 May 2016 12:28:39 +0200 -Subject: [PATCH] Kbuild: Add compilation flag based on kernel support - -The option WLAN_NL80211_TESTMODE was inconditionally added to the compilation -but it does required the specific kernel support. - -https://jira.digi.com/browse/DEL-2567 - -Signed-off-by: Isaac Hermida ---- - Kbuild | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Kbuild b/Kbuild -index b248eee28bf0..339262874c94 100644 ---- a/Kbuild -+++ b/Kbuild -@@ -908,7 +908,6 @@ CDEFINES := -DANI_LITTLE_BYTE_ENDIAN \ - -DWLAN_WAKEUP_EVENTS \ - -DFEATURE_WLAN_RA_FILTERING\ - -DWLAN_KD_READY_NOTIFIER \ -- -DWLAN_NL80211_TESTMODE \ - -DFEATURE_WLAN_BATCH_SCAN \ - -DFEATURE_WLAN_LPHB \ - -DFEATURE_WLAN_PAL_TIMER_DISABLE \ -@@ -948,6 +947,10 @@ CDEFINES += -DDFS_MASTER_OFFLOAD_IND_SUPPORT - endif - endif - -+ifeq ($(CONFIG_NL80211_TESTMODE), y) -+CDEFINES += -DWLAN_NL80211_TESTMODE -+endif -+ - ifeq ($(CONFIG_ARCH_MSM), y) - CDEFINES += -DMSM_PLATFORM - endif diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch deleted file mode 100644 index 98eb059b5..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Isaac Hermida -Date: Tue, 5 Jul 2016 17:57:07 +0200 -Subject: [PATCH] Kbuild: do not compile the DEBUG version inconditionally - -Do not compile the DEBUG version inconditionally by adding the posibility to -define the DEBUG version as a flag parameter. - -Signed-off-by: Isaac Hermida ---- - Kbuild | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Kbuild b/Kbuild -index b14417a558cd..a0e203ce5493 100644 ---- a/Kbuild -+++ b/Kbuild -@@ -121,7 +121,7 @@ endif - # Feature flags which are not (currently) configurable via Kconfig - - #Whether to build debug version --BUILD_DEBUG_VERSION := 1 -+BUILD_DEBUG_VERSION ?= 1 - - #Enable this flag to build driver in diag version - BUILD_DIAG_VERSION := 1 diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch deleted file mode 100644 index 0c9c91943..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Isaac Hermida -Date: Tue, 5 Jul 2016 17:52:44 +0200 -Subject: [PATCH] Kbuild: Group most of the relevant DEBUG options - -The value of BUILD_DEBUG_VERSION will be used to compile the driver with most -of the relevant DEBUG flags. Use that variable to compile the debug version. - -Signed-off-by: Isaac Hermida ---- - Kbuild | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/Kbuild b/Kbuild -index a0e203ce5493..e5f2e8ebd4ad 100644 ---- a/Kbuild -+++ b/Kbuild -@@ -896,9 +896,7 @@ CDEFINES := -DANI_LITTLE_BYTE_ENDIAN \ - -DWLAN_FEATURE_PACKET_FILTERING \ - -DWLAN_FEATURE_VOWIFI \ - -DWLAN_FEATURE_11AC \ -- -DWLAN_FEATURE_P2P_DEBUG \ - -DWLAN_ENABLE_AGEIE_ON_SCAN_RESULTS \ -- -DWLANTL_DEBUG\ - -DWLAN_NS_OFFLOAD \ - -DWLAN_ACTIVEMODE_OFFLOAD_FEATURE \ - -DWLAN_FEATURE_HOLD_RX_WAKELOCK \ -@@ -936,8 +934,7 @@ CDEFINES += -DCONFIG_HL_SUPPORT \ - -DSDIO_3_0 \ - -DHIF_SDIO \ - -DCONFIG_ATH_PROCFS_DIAG_SUPPORT \ -- -DFEATURE_HL_GROUP_CREDIT_FLOW_CONTROL \ -- -DDEBUG_HL_LOGGING -+ -DFEATURE_HL_GROUP_CREDIT_FLOW_CONTROL - endif - - ifeq ($(CONFIG_QCA_WIFI_SDIO), 1) -@@ -974,8 +971,11 @@ CDEFINES += -DTRACE_RECORD \ - - ifeq ($(BUILD_DEBUG_VERSION),1) - CDEFINES += -DWLAN_DEBUG \ -+ -DWLAN_FEATURE_P2P_DEBUG \ -+ -DWLANTL_DEBUG\ - -DPE_DEBUG_LOGW \ - -DPE_DEBUG_LOGE \ -+ -DDEBUG_HL_LOGGING \ - -DDEBUG - endif - diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch deleted file mode 100644 index c5621575e..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Isaac Hermida -Date: Fri, 14 Oct 2016 10:28:29 +0200 -Subject: [PATCH] wlan_hdd_cfg80211: fix missing ifdef clause - -Fix the compilation for old kernels by defining a missing "ifdef" clause. - -Signed-off-by: Isaac Hermida ---- - CORE/HDD/inc/wlan_hdd_cfg80211.h | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h -index a40c55144bc5..95c1ddce7de4 100644 ---- a/CORE/HDD/inc/wlan_hdd_cfg80211.h -+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h -@@ -992,7 +992,12 @@ backported_cfg80211_vendor_event_alloc(struct wiphy *wiphy, - int approxlen, - int event_idx, gfp_t gfp) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) - return cfg80211_vendor_event_alloc(wiphy, wdev, approxlen, event_idx, gfp); -+#else -+ return cfg80211_vendor_event_alloc(wiphy, approxlen, event_idx, gfp); -+#endif -+ - } - #define cfg80211_vendor_event_alloc backported_cfg80211_vendor_event_alloc - #endif diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-Add-.gitignore-rules.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-Add-.gitignore-rules.patch deleted file mode 100644 index f29152d5c..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-Add-.gitignore-rules.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Isaac Hermida -Date: Mon, 17 Oct 2016 10:06:18 +0200 -Subject: [PATCH] Add .gitignore rules - -Signed-off-by: Isaac Hermida ---- - .gitignore | 9 +++++++++ - 1 file changed, 9 insertions(+) - create mode 100644 .gitignore - -diff --git a/.gitignore b/.gitignore -new file mode 100644 -index 000000000000..9886b5284c3f ---- /dev/null -+++ b/.gitignore -@@ -0,0 +1,9 @@ -+*.o -+*.o.cmd -+.tmp_versions -+.* -+Module.symvers -+modules.order -+*.mod.c -+cscope.* -+wlan.ko diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch deleted file mode 100644 index 501d36add..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch +++ /dev/null @@ -1,206 +0,0 @@ -From: Isaac Hermida -Date: Tue, 5 Jul 2016 14:55:15 +0530 -Subject: [PATCH] wlan_hdd_main: initialize all adapter completion variables - -In order to change the p2p device mode, delete and add virtual_iface -followed by change_iface will be invoked. But in this case device mode -is changed by invoking change_iface method without invoking delete and -add virtual_iface functions resulting in kernel panic. - -This is because, in latter case hdd_open_adapter will not be invoked -for the intended device mode. Hence uninitialized completion variables -will be used for further operations. - -To mitigate this issue, Initialize all completion variables of -hdd_adapter_t structure during open adapter irrespective of adapter's -device mode. - -https://jira.digi.com/browse/DEL-3072 -https://jira.digi.com/browse/DEL-3037 - -(cherry-picked from 20ed76a8e436042590aa25acb33a2ba3d6d34250) -Signed-off-by: Isaac Hermida ---- - CORE/HDD/inc/wlan_hdd_main.h | 1 + - CORE/HDD/src/wlan_hdd_hostapd.c | 10 ----- - CORE/HDD/src/wlan_hdd_main.c | 82 ++++++++++++++++++++++++----------------- - 3 files changed, 50 insertions(+), 43 deletions(-) - -diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h -index f01b7f309dc2..3c5a51a57d6c 100644 ---- a/CORE/HDD/inc/wlan_hdd_main.h -+++ b/CORE/HDD/inc/wlan_hdd_main.h -@@ -1740,4 +1740,5 @@ static inline void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter) {} - static inline void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) {} - #endif - bool wlan_hdd_get_fw_state(hdd_adapter_t *adapter); -+void hdd_initialize_adapter_common(hdd_adapter_t *adapter); - #endif // end #if !defined( WLAN_HDD_MAIN_H ) -diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c -index 8a80d26f355a..4bd6b844ac5a 100644 ---- a/CORE/HDD/src/wlan_hdd_hostapd.c -+++ b/CORE/HDD/src/wlan_hdd_hostapd.c -@@ -5389,9 +5389,6 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ) - return status; - } - -- init_completion(&pAdapter->session_close_comp_var); -- init_completion(&pAdapter->session_open_comp_var); -- - sema_init(&(WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->semWpsPBCOverlapInd, 1); - - // Register as a wireless device -@@ -5494,13 +5491,6 @@ hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAd - pWlanHostapdDev->ieee80211_ptr = &pHostapdAdapter->wdev ; - pHostapdAdapter->wdev.wiphy = pHddCtx->wiphy; - pHostapdAdapter->wdev.netdev = pWlanHostapdDev; -- init_completion(&pHostapdAdapter->tx_action_cnf_event); -- init_completion(&pHostapdAdapter->cancel_rem_on_chan_var); -- init_completion(&pHostapdAdapter->rem_on_chan_ready_event); -- init_completion(&pHostapdAdapter->ula_complete); -- init_completion(&pHostapdAdapter->offchannel_tx_event); -- init_completion(&pHostapdAdapter->scan_info.scan_req_completion_event); -- init_completion(&pHostapdAdapter->scan_info.abortscan_event_var); - vos_event_init(&pHostapdAdapter->scan_info.scan_finished_event); - pHostapdAdapter->scan_info.scan_pending_option = WEXT_SCAN_PENDING_GIVEUP; - -diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c -index a10da2a9b164..b447f0931d52 100755 ---- a/CORE/HDD/src/wlan_hdd_main.c -+++ b/CORE/HDD/src/wlan_hdd_main.c -@@ -8234,7 +8234,6 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac - - if(pWlanDev != NULL) - { -- - //Save the pointer to the net_device in the HDD adapter - pAdapter = (hdd_adapter_t*) netdev_priv( pWlanDev ); - -@@ -8244,43 +8243,11 @@ static hdd_adapter_t* hdd_alloc_station_adapter( hdd_context_t *pHddCtx, tSirMac - pAdapter->pHddCtx = pHddCtx; - pAdapter->magic = WLAN_HDD_ADAPTER_MAGIC; - -- init_completion(&pAdapter->session_open_comp_var); -- init_completion(&pAdapter->session_close_comp_var); -- init_completion(&pAdapter->disconnect_comp_var); -- init_completion(&pAdapter->linkup_event_var); -- init_completion(&pAdapter->cancel_rem_on_chan_var); -- init_completion(&pAdapter->rem_on_chan_ready_event); -- init_completion(&pAdapter->offchannel_tx_event); -- init_completion(&pAdapter->tx_action_cnf_event); --#ifdef FEATURE_WLAN_TDLS -- init_completion(&pAdapter->tdls_add_station_comp); -- init_completion(&pAdapter->tdls_del_station_comp); -- init_completion(&pAdapter->tdls_mgmt_comp); -- init_completion(&pAdapter->tdls_link_establish_req_comp); --#endif -- -- init_completion(&pHddCtx->mc_sus_event_var); -- init_completion(&pHddCtx->tx_sus_event_var); -- init_completion(&pHddCtx->rx_sus_event_var); -- init_completion(&pHddCtx->ready_to_suspend); -- init_completion(&pAdapter->ula_complete); -- init_completion(&pAdapter->change_country_code); -- --#ifdef WLAN_FEATURE_EXTWOW_SUPPORT -- init_completion(&pHddCtx->ready_to_extwow); --#endif -- --#ifdef FEATURE_WLAN_BATCH_SCAN -- init_completion(&pAdapter->hdd_set_batch_scan_req_var); -- init_completion(&pAdapter->hdd_get_batch_scan_req_var); - pAdapter->pBatchScanRsp = NULL; - pAdapter->numScanList = 0; - pAdapter->batchScanState = eHDD_BATCH_SCAN_STATE_STOPPED; - pAdapter->prev_batch_id = 0; - mutex_init(&pAdapter->hdd_batch_scan_lock); --#endif -- init_completion(&pAdapter->scan_info.scan_req_completion_event); -- init_completion(&pAdapter->scan_info.abortscan_event_var); - - vos_event_init(&pAdapter->scan_info.scan_finished_event); - pAdapter->scan_info.scan_pending_option = WEXT_SCAN_PENDING_GIVEUP; -@@ -9018,6 +8985,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, - pAdapter->wdev.iftype = NL80211_IFTYPE_P2P_CLIENT; - - pAdapter->device_mode = session_type; -+ hdd_initialize_adapter_common(pAdapter); - - status = hdd_init_station_mode( pAdapter ); - if( VOS_STATUS_SUCCESS != status ) -@@ -9089,6 +9057,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, - NL80211_IFTYPE_P2P_GO; - pAdapter->device_mode = session_type; - -+ hdd_initialize_adapter_common(pAdapter); - status = hdd_init_ap_mode(pAdapter); - if( VOS_STATUS_SUCCESS != status ) - goto err_free_netdev; -@@ -9163,6 +9132,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, - pAdapter->device_mode = session_type; - status = hdd_register_interface( pAdapter, rtnl_held ); - -+ hdd_initialize_adapter_common(pAdapter); - hdd_init_tx_rx( pAdapter ); - - //Stop the Interface TX queue. -@@ -11735,6 +11705,13 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) - init_completion(&pHddCtx->full_pwr_comp_var); - init_completion(&pHddCtx->standby_comp_var); - init_completion(&pHddCtx->req_bmps_comp_var); -+ init_completion(&pHddCtx->mc_sus_event_var); -+ init_completion(&pHddCtx->tx_sus_event_var); -+ init_completion(&pHddCtx->rx_sus_event_var); -+ init_completion(&pHddCtx->ready_to_suspend); -+#ifdef WLAN_FEATURE_EXTWOW_SUPPORT -+ init_completion(&pHddCtx->ready_to_extwow); -+#endif - - spin_lock_init(&pHddCtx->schedScan_lock); - -@@ -14494,6 +14471,45 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) - } - #endif - -+/** -+ * hdd_initialize_adapter_common() - initialize completion variables -+ * @adapter: pointer to hdd_adapter_t -+ * -+ * Return: none -+ */ -+void hdd_initialize_adapter_common(hdd_adapter_t *adapter) -+{ -+ if (NULL == adapter) { -+ hddLog(VOS_TRACE_LEVEL_ERROR, "%s: adapter is NULL ", __func__); -+ return; -+ } -+ init_completion(&adapter->session_open_comp_var); -+ init_completion(&adapter->session_close_comp_var); -+ init_completion(&adapter->disconnect_comp_var); -+ init_completion(&adapter->linkup_event_var); -+ init_completion(&adapter->cancel_rem_on_chan_var); -+ init_completion(&adapter->rem_on_chan_ready_event); -+ init_completion(&adapter->offchannel_tx_event); -+ init_completion(&adapter->tx_action_cnf_event); -+#ifdef FEATURE_WLAN_TDLS -+ init_completion(&adapter->tdls_add_station_comp); -+ init_completion(&adapter->tdls_del_station_comp); -+ init_completion(&adapter->tdls_mgmt_comp); -+ init_completion(&adapter->tdls_link_establish_req_comp); -+#endif -+ init_completion(&adapter->ula_complete); -+ init_completion(&adapter->change_country_code); -+ init_completion(&adapter->scan_info.scan_req_completion_event); -+ init_completion(&adapter->scan_info.abortscan_event_var); -+ -+#ifdef FEATURE_WLAN_BATCH_SCAN -+ init_completion(&adapter->hdd_set_batch_scan_req_var); -+ init_completion(&adapter->hdd_get_batch_scan_req_var); -+#endif -+ -+ return; -+} -+ - //Register the module init/exit functions - module_init(hdd_module_init); - module_exit(hdd_module_exit); diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch deleted file mode 100644 index 4d55231dd..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch +++ /dev/null @@ -1,76 +0,0 @@ -From: Alex Gonzalez -Date: Mon, 12 Dec 2016 16:19:48 +0100 -Subject: [PATCH] qcacld: Indicate disconnect event to upper layers. - -This is to avoid the following warning: - -------------[ cut here ]------------ -WARNING: CPU: 0 PID: 1120 at net/wireless/core.c:1140 cfg80211_netdev_notifier_call+0x3a0/0x574() -Modules linked in: wlan(O-) evbug [last unloaded: wlan] -CPU: 0 PID: 1120 Comm: rmmod Tainted: G O 4.1.15-95656-g4c5caa2cab98-dirty #11 -Hardware name: Freescale i.MX6 Ultralite (Device Tree) -[<80015ae4>] (unwind_backtrace) from [<8001269c>] (show_stack+0x10/0x14) -[<8001269c>] (show_stack) from [<80730464>] (dump_stack+0x84/0xc4) -[<80730464>] (dump_stack) from [<8002d220>] (warn_slowpath_common+0x80/0xb0) -[<8002d220>] (warn_slowpath_common) from [<8002d2ec>] (warn_slowpath_null+0x1c/0x24) -[<8002d2ec>] (warn_slowpath_null) from [<806bdad8>] (cfg80211_netdev_notifier_call+0x3a0/0x574) -[<806bdad8>] (cfg80211_netdev_notifier_call) from [<800462b8>] (notifier_call_chain+0x44/0x84) -[<800462b8>] (notifier_call_chain) from [<8004642c>] (raw_notifier_call_chain+0x18/0x20) -[<8004642c>] (raw_notifier_call_chain) from [<8057f8fc>] (rollback_registered_many+0x2a0/0x3a4) -[<8057f8fc>] (rollback_registered_many) from [<8057fa24>] (rollback_registered+0x24/0x38) -[<8057fa24>] (rollback_registered) from [<80581d24>] (unregister_netdevice_queue+0x54/0xb0) -[<80581d24>] (unregister_netdevice_queue) from [<80581d98>] (unregister_netdev+0x18/0x20) -[<80581d98>] (unregister_netdev) from [<7f02363c>] (hdd_close_all_adapters+0x7c/0xbc [wlan]) -[<7f02363c>] (hdd_close_all_adapters [wlan]) from [<7f025be4>] (hdd_wlan_exit+0x2e4/0x72c [wlan]) -[<7f025be4>] (hdd_wlan_exit [wlan]) from [<7f0260c8>] (__hdd_wlan_exit+0x9c/0xe4 [wlan]) -[<7f0260c8>] (__hdd_wlan_exit [wlan]) from [<7f1c3238>] (ath_hif_sdio_remove+0x54/0xfc [wlan]) -[<7f1c3238>] (ath_hif_sdio_remove [wlan]) from [<7f1c5de0>] (hifDeviceRemoved+0x7c/0x16c [wlan]) -[<7f1c5de0>] (hifDeviceRemoved [wlan]) from [<804e9c8c>] (sdio_bus_remove+0x30/0xf8) -[<804e9c8c>] (sdio_bus_remove) from [<8036f598>] (__device_release_driver+0x70/0xe4) -[<8036f598>] (__device_release_driver) from [<8036fd34>] (driver_detach+0xac/0xb0) -[<8036fd34>] (driver_detach) from [<8036f2f8>] (bus_remove_driver+0x4c/0xa0) -[<8036f2f8>] (bus_remove_driver) from [<7f1c53a8>] (HIFShutDownDevice+0xbc/0x17c [wlan]) -[<7f1c53a8>] (HIFShutDownDevice [wlan]) from [<7f1c36c4>] (hif_unregister_driver+0x28/0x48 [wlan]) -[<7f1c36c4>] (hif_unregister_driver [wlan]) from [<7f1d2fa8>] (hdd_module_exit+0x140/0x18c [wlan]) -[<7f1d2fa8>] (hdd_module_exit [wlan]) from [<8008ae18>] (SyS_delete_module+0x174/0x1b8) -[<8008ae18>] (SyS_delete_module) from [<8000f400>] (ret_fast_syscall+0x0/0x3c) ----[ end trace cb71790dd22e980e ]--- - -https://jira.digi.com/browse/DEL-3365 - -Signed-off-by: Alex Gonzalez ---- - CORE/HDD/src/wlan_hdd_cfg80211.c | 3 +++ - CORE/HDD/src/wlan_hdd_main.c | 5 +++++ - 2 files changed, 8 insertions(+) - -diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c -index 43543a9a473d..ae86c88fcfa5 100644 ---- a/CORE/HDD/src/wlan_hdd_cfg80211.c -+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c -@@ -11038,6 +11038,9 @@ disconnected: - FL("Set HDD connState to eConnectionState_NotConnected")); - pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; - -+ /* indicate disconnected event to nl80211 */ -+ cfg80211_disconnected(pAdapter->dev, WLAN_REASON_UNSPECIFIED, NULL, 0, -+ GFP_KERNEL); - return 0; - } - -diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c -index df5b1065d463..f057f8c177b1 100755 ---- a/CORE/HDD/src/wlan_hdd_main.c -+++ b/CORE/HDD/src/wlan_hdd_main.c -@@ -9536,6 +9536,11 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, - "%s: wait on disconnect_comp_var failed", - __func__); - } -+ else -+ { -+ cfg80211_disconnected(pAdapter->dev, WLAN_REASON_UNSPECIFIED, -+ NULL, 0, GFP_KERNEL); -+ } - } - else - { diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch deleted file mode 100644 index 7478b9ad3..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Alex Gonzalez -Date: Thu, 15 Dec 2016 13:31:12 +0100 -Subject: [PATCH] wdd_hdd_main: Print con_mode to clearly see if in FTM mode. - -We use FTM mode for RF testing. - -Signed-off-by: Alex Gonzalez ---- - CORE/HDD/src/wlan_hdd_main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c -index f057f8c177b1..d83602740b94 100755 ---- a/CORE/HDD/src/wlan_hdd_main.c -+++ b/CORE/HDD/src/wlan_hdd_main.c -@@ -12607,8 +12607,8 @@ static int hdd_driver_init( void) - #ifdef HDD_TRACE_RECORD - MTRACE(hddTraceInit()); - #endif -- pr_info("%s: loading driver v%s\n", WLAN_MODULE_NAME, -- QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR); -+ pr_info("%s: loading driver v%s in mode %d\n", WLAN_MODULE_NAME, -+ QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR, con_mode); - - do { - diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch deleted file mode 100644 index cb1d3be24..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Alex Gonzalez -Date: Mon, 9 Jan 2017 16:51:17 +0100 -Subject: [PATCH] Makefile: Pass BUILD_DEBUG_VERSION to kbuild system. - -https://jira.digi.com/browse/DEL-3392 - -Signed-off-by: Alex Gonzalez ---- - Makefile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Makefile b/Makefile -index c05b00f26c57..25cec85a0c1e 100644 ---- a/Makefile -+++ b/Makefile -@@ -16,6 +16,7 @@ KBUILD_OPTIONS += CONFIG_QCA_WIFI_ISOC=0 - KBUILD_OPTIONS += CONFIG_QCA_WIFI_2_0=1 - KBUILD_OPTIONS += $(WLAN_SELECT) - KBUILD_OPTIONS += WLAN_OPEN_SOURCE=$(WLAN_OPEN_SOURCE) -+KBUILD_OPTIONS += BUILD_DEBUG_VERSION=$(BUILD_DEBUG_VERSION) - KBUILD_OPTIONS += $(KBUILD_EXTRA) # Extra config if any - - all: diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-cosmetic-change-log-level.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-cosmetic-change-log-level.patch deleted file mode 100644 index 2b2c6c8fb..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-cosmetic-change-log-level.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Pedro Perez de Heredia -Date: Mon, 13 Feb 2017 09:43:50 +0100 -Subject: [PATCH] kernel-module-qualcomm: cosmetic change log level for anoying - driver messages - -Signed-off-by: Pedro Perez de Heredia ---- - CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c | 4 ++-- - CORE/SVC/src/logging/wlan_logging_sock_svc.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -index 1a1e51e..ee2af05 100644 ---- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -+++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c -@@ -1202,7 +1202,7 @@ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Powe - clock = device->host->f_max; - } - -- printk(KERN_ERR "%s: Dumping clocks (%d,%d)\n", __func__, func->card->cis.max_dtr, device->host->f_max); -+ pr_info("%s: Dumping clocks (%d,%d)\n", __func__, func->card->cis.max_dtr, device->host->f_max); - - /* - // We don't need to set the clock explicitly on 8064/ADP platforms. -@@ -1513,7 +1513,7 @@ static A_STATUS hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func) - sdio_release_host(func); - return A_ERROR; - } -- printk(KERN_ERR"AR6000: Set async interrupt delay clock as %d.\n", asyncintdelay); -+ pr_info("AR6000: Set async interrupt delay clock as %d.\n", asyncintdelay); - } - - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) -diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c -index 0253215..379d878 100644 ---- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c -+++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c -@@ -431,13 +431,13 @@ static int wlan_logging_thread(void *Arg) - || gwlan_logging.exit)); - - if (ret_wait_status == -ERESTARTSYS) { -- pr_err("%s: wait_event_interruptible returned -ERESTARTSYS", -+ pr_info("%s: wait_event_interruptible returned -ERESTARTSYS", - __func__); - break; - } - - if (gwlan_logging.exit) { -- pr_err("%s: Exiting the thread\n", __func__); -+ pr_info("%s: Exiting the thread\n", __func__); - break; - } - diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0022-fix-issue-with-_scan_callback.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0022-fix-issue-with-_scan_callback.patch deleted file mode 100644 index 6f1f6fb51..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0022-fix-issue-with-_scan_callback.patch +++ /dev/null @@ -1,102 +0,0 @@ -From: Pedro Perez de Heredia -Date: Mon, 13 Feb 2017 10:28:35 +0100 -Subject: [PATCH] kernel-module-qualcomm: fix issue with _scan_callback at - module unload - -Protect the invocation of the _scan_done() callback function with the -global lock to avoid that it is called while the module is being unloaded -and the data structures have been freed. - -https://jira.digi.com/browse/DEL-3607 -https://jira.digi.com/browse/DEL-3393 - -Signed-off-by: Pedro Perez de Heredia ---- - CORE/SME/src/csr/csrApiScan.c | 43 +++++++++++++++++++++++++++++-------------- - 1 file changed, 29 insertions(+), 14 deletions(-) - -diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c -index 83a74cb..2f90cce 100644 ---- a/CORE/SME/src/csr/csrApiScan.c -+++ b/CORE/SME/src/csr/csrApiScan.c -@@ -6420,13 +6420,20 @@ eHalStatus csrScanFreeRequest(tpAniSirGlobal pMac, tCsrScanRequest *pReq) - - void csrScanCallCallback(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatus scanStatus) - { -- if(pCommand->u.scanCmd.callback) -+ eHalStatus status; -+ -+ status = sme_AcquireGlobalLock( &pMac->sme ); -+ if ( HAL_STATUS_SUCCESS( status ) ) - { -- pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext, -- pCommand->sessionId, -- pCommand->u.scanCmd.scanID, scanStatus); -- } else { -- smsLog( pMac, LOG2, "%s:%d - Callback NULL!!!", __func__, __LINE__); -+ if(pCommand->u.scanCmd.callback) -+ { -+ pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext, -+ pCommand->sessionId, -+ pCommand->u.scanCmd.scanID, scanStatus); -+ } else { -+ smsLog( pMac, LOG2, "%s:%d - Callback NULL!!!", __func__, __LINE__); -+ } -+ sme_ReleaseGlobalLock( &pMac->sme ); - } - } - -@@ -7126,6 +7133,7 @@ tANI_BOOLEAN csrScanRemoveFreshScanCommand(tpAniSirGlobal pMac, tANI_U8 sessionI - tSmeCmd *pCommand; - tDblLinkList localList; - tDblLinkList *pCmdList; -+ eHalStatus status; - - vos_mem_zero(&localList, sizeof(tDblLinkList)); - if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) -@@ -7178,15 +7186,21 @@ tANI_BOOLEAN csrScanRemoveFreshScanCommand(tpAniSirGlobal pMac, tANI_U8 sessionI - while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) - { - pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link); -- if (pCommand->u.scanCmd.callback) -+ -+ status = sme_AcquireGlobalLock( &pMac->sme ); -+ if ( HAL_STATUS_SUCCESS( status ) ) - { -- /* User scan request is pending, -+ if (pCommand->u.scanCmd.callback) -+ { -+ /* User scan request is pending, - * send response with status eCSR_SCAN_ABORT*/ -- pCommand->u.scanCmd.callback(pMac, -- pCommand->u.scanCmd.pContext, -- sessionId, -- pCommand->u.scanCmd.scanID, -- eCSR_SCAN_ABORT); -+ pCommand->u.scanCmd.callback(pMac, -+ pCommand->u.scanCmd.pContext, -+ sessionId, -+ pCommand->u.scanCmd.scanID, -+ eCSR_SCAN_ABORT); -+ } -+ sme_ReleaseGlobalLock( &pMac->sme ); - } - csrReleaseCommandScan( pMac, pCommand ); - } -@@ -8015,7 +8029,6 @@ eHalStatus csrProcessSetBGScanParam(tpAniSirGlobal pMac, tSmeCmd *pCommand) - return (status); - } - -- - eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId, - eCsrAbortReason reason) - { -@@ -8035,6 +8048,8 @@ eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId, - { - - pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); -+ pCommand->u.scanCmd.callback = NULL; -+ pCommand->u.scanCmd.pContext = NULL; - csrAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE); - } - csrLLUnlock(&pMac->scan.scanCmdPendingList); From 57365612daf455dd26e41d69c795b76c0442a4ce Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 23 May 2017 12:04:03 +0200 Subject: [PATCH 25/95] bluetooth-init: cosmetic, boot message in one line Avoid splitting the boot script message in two different lines: Starting bluetooth hardware: [OK] done. Signed-off-by: Javier Viguera --- .../bluez/bluez5-5.41/ccimx6ul/bluetooth-init | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init index 2219ab7a6..925d4933f 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6ul/bluetooth-init @@ -69,10 +69,8 @@ bluetooth_init() { HCIATTACH_LOG="/var/log/hciattach.log" killproc hciattach powercycle_gpio "${BT_EN_QCA_GPIO_NR}" - if hciattach ttyBt qca ${BT_RATE:-3000000} -t30 ${BT_FLOW:-flow} unused ${BT_MACADDR} >${HCIATTACH_LOG} 2>&1; then - echo "[OK]" - else - echo "[FAIL]" + if ! hciattach ttyBt qca ${BT_RATE:-3000000} -t30 ${BT_FLOW:-flow} unused ${BT_MACADDR} >${HCIATTACH_LOG} 2>&1; then + BT_ERROR="FAIL (hciattach)" fi } From efba5b5e7cc386b903c201219d7e13f018f3219b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 26 May 2017 17:03:16 +0200 Subject: [PATCH 26/95] image_types class: fix build error due to missing images dependencies A couple of commits in poky.git broke the dependence from our boot and recovery images to the trustfence and recovery initramfs images: http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=morty&id=6c3d10ea62ad282a764da83aa701f92c6d3db6cb http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=morty&id=99c6c878ee122a04f23ef49ea653208ca1c7aa77 This commit fixes the dependencies again, so when you build those images, it builds first the required initramfs images. https://jira.digi.com/browse/DEL-4320 Signed-off-by: Javier Viguera --- meta-digi-arm/classes/image_types_digi.bbclass | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index 1bcb23d25..334ac0e79 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -122,9 +122,9 @@ do_image_boot_ubifs[imgsuffix] = "." # # This is needed because otherwise the IMAGE_DEPENDS_ is not used and the build fails. # -IMAGE_TYPEDEP_boot = " \ - ${@bb.utils.contains('IMAGE_FSTYPES', 'boot.ubifs', 'boot.ubifs', '', d)} \ - ${@bb.utils.contains('IMAGE_FSTYPES', 'boot.vfat', 'boot.vfat', '', d)} \ +IMAGE_DEPENDS_boot = " \ + ${@bb.utils.contains('IMAGE_FSTYPES', 'boot.ubifs', '${IMAGE_DEPENDS_boot.ubifs}', '', d)} \ + ${@bb.utils.contains('IMAGE_FSTYPES', 'boot.vfat', '${IMAGE_DEPENDS_boot.vfat}', '', d)} \ " ################################################################################ @@ -198,9 +198,9 @@ do_image_recovery_ubifs[imgsuffix] = "." # # This is needed because otherwise the IMAGE_DEPENDS_ is not used and the build fails. # -IMAGE_TYPEDEP_recovery = " \ - ${@bb.utils.contains('IMAGE_FSTYPES', 'recovery.ubifs', 'recovery.ubifs', '', d)} \ - ${@bb.utils.contains('IMAGE_FSTYPES', 'recovery.vfat', 'recovery.vfat boot.vfat', '', d)} \ +IMAGE_DEPENDS_recovery = " \ + ${@bb.utils.contains('IMAGE_FSTYPES', 'recovery.ubifs', '${IMAGE_DEPENDS_recovery.ubifs}', '', d)} \ + ${@bb.utils.contains('IMAGE_FSTYPES', 'recovery.vfat', '${IMAGE_DEPENDS_recovery.vfat}', '', d)} \ " ################################################################################ From a1e84ca437c89f4b2ad2fcaf01aacc5bc9bf289e Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Tue, 30 May 2017 09:08:47 +0200 Subject: [PATCH 27/95] meta-digi-arm: add support for CC6 variant 0x14 This is a Consumer dual-core 1GHz, 4GB eMMC, 1GB DDR3, 0/+70C variant without bluetooth, no wireless, no kinetis. https://jira.digi.com/browse/DEL-4280 Signed-off-by: Arturo Buzarra --- .../recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/boot.txt | 2 ++ .../u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/boot.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/boot.txt index f86ceb43e..8a3c60f95 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/boot.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/boot.txt @@ -39,6 +39,8 @@ else setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb elif test "${module_variant}" = "0x13"; then setenv fdt_file uImage-imx6dl-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x14"; then + setenv fdt_file uImage-imx6q-ccimx6sbc.dtb else echo "------ Using default fdt_file" fi diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt index e30726d19..94c49ff4e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt @@ -23,7 +23,7 @@ fi if test -n "${module_variant}"; then if test "${module_variant}" = "0x12"; then setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6qsbc2GB.imx; - elif test "${module_variant}" = "0x02" || test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05" || test "${module_variant}" = "0x11"; then + elif test "${module_variant}" = "0x02" || test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05" || test "${module_variant}" = "0x11" || test "${module_variant}" = "0x14"; then setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6qsbc.imx; elif test "${module_variant}" = "0x03" || test "${module_variant}" = "0x0e" || test "${module_variant}" = "0x0f"; then setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6qsbc512MB.imx; From c9b11f0ded902c2f4cebaa453d010d1062b52ce6 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Mon, 29 May 2017 17:45:10 +0200 Subject: [PATCH 28/95] dey-examples: adc: fix help output When not enough arguments are given (this includes using only the '-h' argument for help), show the complete help. Signed-off-by: Diaz de Grenu, Jose --- .../recipes-digi/dey-examples/files/adc_sample/adc_sample.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c index 1dc8ebbab..6848db0d2 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c @@ -196,7 +196,7 @@ int main(int argc, char **argv) int ret, opt, i; if (argc <= 2) { - show_usage(0); + show_usage(1); return EXIT_FAILURE; } From eafffc0cce0e03326e78a26e3c121051707d4b90 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 26 May 2017 18:57:37 +0200 Subject: [PATCH 29/95] ccimx6ul_defconfig: sync defconfig with kernel This commit adds the required configuration to run Greengrass Core: * Overlay filesystem support * Cgroups: * Freezer cgroup subsystem * Device controller for cgroups * Cpuset support * Simple CPU accounting cgroup subsystem * Memory Resource Controller for Control Groups * Enable perf_event per-cpu per-container group (cgroup) monitoring * CPU scheduler * Block IO controller * Namespaces support * UTS namespace * IPC namespace * User namespace * PID Namespaces * Network namespace * POSIX Message Queues * Support multiple instances of devpts * Enable seccomp to safely compute untrusted bytecode https://jira.digi.com/browse/DEL-4301 Signed-off-by: Tatiana Leon --- .../linux/linux-dey-4.1/ccimx6ul/defconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig index 165bec2c8..f12d867c8 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig @@ -1,11 +1,26 @@ CONFIG_KERNEL_LZO=y CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_CGROUPS=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_MEMCG=y +CONFIG_MEMCG_SWAP=y +CONFIG_MEMCG_KMEM=y +CONFIG_CGROUP_PERF=y +CONFIG_CGROUP_SCHED=y +CONFIG_CFS_BANDWIDTH=y +CONFIG_RT_GROUP_SCHED=y +CONFIG_BLK_CGROUP=y +CONFIG_NAMESPACES=y +CONFIG_USER_NS=y CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y # CONFIG_RD_LZMA is not set @@ -32,6 +47,7 @@ CONFIG_PREEMPT=y CONFIG_AEABI=y CONFIG_HIGHMEM=y CONFIG_CMA=y +CONFIG_SECCOMP=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y @@ -155,6 +171,7 @@ CONFIG_TOUCHSCREEN_IMX6UL_TSC=y CONFIG_INPUT_MISC=y CONFIG_INPUT_MCA_CC6UL_PWRKEY=y # CONFIG_SERIO_SERPORT is not set +CONFIG_DEVPTS_MULTIPLE_INSTANCES=y # CONFIG_LEGACY_PTYS is not set # CONFIG_DEVKMEM is not set CONFIG_SERIAL_IMX=y @@ -293,6 +310,7 @@ CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y CONFIG_AUTOFS4_FS=y +CONFIG_OVERLAY_FS=y CONFIG_VFAT_FS=y CONFIG_TMPFS=y CONFIG_UBIFS_FS=y From 180649013d7f202156bc8e8c5e6b30c2164da15f Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Fri, 26 May 2017 20:39:10 +0200 Subject: [PATCH 30/95] ccimx6sbc_defconfig: sync defconfig with kernel This commit adds the required configuration to run Greengrass Core: * Overlay filesystem support * Cgroups: * Freezer cgroup subsystem * Device controller for cgroups * Cpuset support * Simple CPU accounting cgroup subsystem * Memory Resource Controller for Control Groups * Enable perf_event per-cpu per-container group (cgroup) monitoring * CPU scheduler * Block IO controller * Namespaces support * UTS namespace * IPC namespace * User namespace * PID Namespaces * Network namespace * POSIX Message Queues * Support multiple instances of devpts * Enable seccomp to safely compute untrusted bytecode https://jira.digi.com/browse/DEL-4301 Signed-off-by: Tatiana Leon --- .../linux/linux-dey-4.1/ccimx6sbc/defconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig index c64729045..3f9599a91 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig @@ -1,6 +1,7 @@ # CONFIG_LOCALVERSION_AUTO is not set CONFIG_KERNEL_LZO=y CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y CONFIG_FHANDLE=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y @@ -8,6 +9,20 @@ CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_CGROUPS=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_MEMCG=y +CONFIG_MEMCG_SWAP=y +CONFIG_MEMCG_KMEM=y +CONFIG_CGROUP_PERF=y +CONFIG_CGROUP_SCHED=y +CONFIG_CFS_BANDWIDTH=y +CONFIG_RT_GROUP_SCHED=y +CONFIG_BLK_CGROUP=y +CONFIG_NAMESPACES=y +CONFIG_USER_NS=y CONFIG_BLK_DEV_INITRD=y CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y @@ -35,6 +50,7 @@ CONFIG_PREEMPT_VOLUNTARY=y CONFIG_AEABI=y CONFIG_HIGHMEM=y CONFIG_CMA=y +CONFIG_SECCOMP=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_CPU_FREQ=y @@ -150,6 +166,7 @@ CONFIG_INPUT_MISC=y CONFIG_INPUT_MMA8450=y CONFIG_INPUT_DA9063_ONKEY=y CONFIG_INPUT_ISL29023=y +CONFIG_DEVPTS_MULTIPLE_INSTANCES=y # CONFIG_LEGACY_PTYS is not set # CONFIG_DEVKMEM is not set CONFIG_SERIAL_IMX=y @@ -283,6 +300,7 @@ CONFIG_PWM_IMX=y CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y +CONFIG_OVERLAY_FS=y CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_TMPFS=y From 2b5017956be5d81251f2932e2fe0cf2d3ac3f970 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 29 May 2017 17:43:34 +0200 Subject: [PATCH 31/95] u-boot-fw-utils: added support for dynamic env location Signed-off-by: Hector Palacios https://jira.digi.com/browse/DUB-741 --- ...actorize-function-to-get-device-type.patch | 68 +++++++ ...pport-to-set-dynamic-location-of-env.patch | 166 ++++++++++++++++++ .../u-boot/u-boot-fw-utils_%.bbappend | 2 + 3 files changed, 236 insertions(+) create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-tools-env-factorize-function-to-get-device-type.patch create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0005-tools-env-add-support-to-set-dynamic-location-of-env.patch diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-tools-env-factorize-function-to-get-device-type.patch b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-tools-env-factorize-function-to-get-device-type.patch new file mode 100644 index 000000000..48aeb0745 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-tools-env-factorize-function-to-get-device-type.patch @@ -0,0 +1,68 @@ +From: Hector Palacios +Date: Mon, 29 May 2017 11:41:23 +0200 +Subject: [PATCH 1/2] tools: env: factorize function to get device type + +This function may be reused to determine the device type in other helper +functions. + +Signed-off-by: Hector Palacios + +https://jira.digi.com/browse/DUB-741 +--- + tools/env/fw_env.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c +index 1c337b4727a9..08ba0fd1111f 100644 +--- a/tools/env/fw_env.c ++++ b/tools/env/fw_env.c +@@ -1134,7 +1134,7 @@ static int flash_write (int fd_current, int fd_target, int dev_target) + return 0; + } + +-static int flash_read (int fd) ++static int get_type(int dev, int fd) + { + struct mtd_info_user mtdinfo; + struct stat st; +@@ -1151,7 +1151,7 @@ static int flash_read (int fd) + rc = ioctl(fd, MEMGETINFO, &mtdinfo); + if (rc < 0) { + fprintf(stderr, "Cannot get MTD information for %s\n", +- DEVNAME(dev_current)); ++ DEVNAME(dev)); + return -1; + } + if (mtdinfo.type != MTD_NORFLASH && +@@ -1159,7 +1159,7 @@ static int flash_read (int fd) + mtdinfo.type != MTD_DATAFLASH && + mtdinfo.type != MTD_UBIVOLUME) { + fprintf (stderr, "Unsupported flash type %u on %s\n", +- mtdinfo.type, DEVNAME(dev_current)); ++ mtdinfo.type, DEVNAME(dev)); + return -1; + } + } else { +@@ -1167,10 +1167,20 @@ static int flash_read (int fd) + mtdinfo.type = MTD_ABSENT; + } + +- DEVTYPE(dev_current) = mtdinfo.type; ++ DEVTYPE(dev) = mtdinfo.type; ++ return 0; ++} ++ ++static int flash_read (int fd) ++{ ++ int rc; ++ ++ rc = get_type(dev_current, fd); ++ if (rc < 0) ++ return -1; + + rc = flash_read_buf(dev_current, fd, environment.image, CUR_ENVSIZE, +- DEVOFFSET (dev_current), mtdinfo.type); ++ DEVOFFSET(dev_current), DEVTYPE(dev_current)); + if (rc != CUR_ENVSIZE) + return -1; + diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0005-tools-env-add-support-to-set-dynamic-location-of-env.patch b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0005-tools-env-add-support-to-set-dynamic-location-of-env.patch new file mode 100644 index 000000000..0742e56ac --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0005-tools-env-add-support-to-set-dynamic-location-of-env.patch @@ -0,0 +1,166 @@ +From: Hector Palacios +Date: Mon, 29 May 2017 12:10:10 +0200 +Subject: [PATCH 2/2] tools: env: add support to set dynamic location of + environment copies + +A mechanism was added in U-Boot to set the location of environment copies +dynamically in an shared area. If the config file sets both copies to the +same offset, a function will be called to set the offset of each copy to +the first two good NAND sectors within the specified area. + +The config file should contain the sector size and the number of sectors +of the area, like in this example: + + # Device name Offset Size Erase-size No.Blocks + /dev/mtd1 0x0 0x20000 0x20000 8 + /dev/mtd1 0x0 0x20000 0x20000 8 + +Signed-off-by: Hector Palacios + +https://jira.digi.com/browse/DUB-741 +--- + tools/env/fw_env.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 96 insertions(+), 7 deletions(-) + +diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c +index 08ba0fd1111f..c1a4d89f62c0 100644 +--- a/tools/env/fw_env.c ++++ b/tools/env/fw_env.c +@@ -122,6 +122,8 @@ static int env_aes_cbc_crypt(char *data, const int enc); + static int caam_encryption_flag; + + static int HaveRedundEnv = 0; ++static int have_dynamic_env; ++static off_t top_of_range; /* end of the last block we may use */ + + static unsigned char active_flag = 1; + /* obsolete_flag must be 0 to efficiently set it on NOR flash without erasing */ +@@ -790,7 +792,6 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count, + 0 on NOR */ + size_t processed = 0; /* progress counter */ + size_t readlen = count; /* current read length */ +- off_t top_of_range; /* end of the last block we may use */ + off_t block_seek; /* offset inside the current block to the start + of the data */ + loff_t blockstart; /* running start of the current block - +@@ -809,12 +810,22 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count, + */ + blocklen = DEVESIZE (dev); + +- /* +- * To calculate the top of the range, we have to use the +- * global DEVOFFSET (dev), which can be different from offset +- */ +- top_of_range = ((DEVOFFSET(dev) / blocklen) + +- ENVSECTORS (dev)) * blocklen; ++ if (!have_dynamic_env) { ++ /* ++ * To calculate the top of the range, we have to use the ++ * global DEVOFFSET (dev), which can be different from ++ * offset ++ */ ++ top_of_range = ((DEVOFFSET(dev) / blocklen) + ++ ENVSECTORS(dev)) * blocklen; ++ } ++ ++ if (offset >= top_of_range) { ++ /* End of range is reached */ ++ fprintf(stderr, ++ "Too few good blocks within range\n"); ++ return -1; ++ } + + /* Limit to one block for the first read */ + if (readlen > blocklen - block_seek) +@@ -1208,6 +1219,72 @@ static int sysfs_mmcboot_set_protection(const char *device, int value) + return 0; + } + ++static int set_dynamic_location(void) ++{ ++ int fd, i, nsectors, type; ++ loff_t offset, blocksize; ++ int dev = 0; ++ int copies = 1; ++ int rc = 0; ++ ++ if (HaveRedundEnv) ++ copies++; ++ ++ fd = open(DEVNAME(dev), O_RDONLY); ++ if (fd < 0) { ++ fprintf(stderr, "Can't open %s: %s\n", DEVNAME(dev), ++ strerror(errno)); ++ rc = -1; ++ goto error; ++ } ++ ++ rc = get_type(dev, fd); ++ if (rc < 0) { ++ fprintf(stderr, "could not get type\n", DEVNAME(dev), ++ strerror(errno)); ++ rc = -1; ++ goto error; ++ } ++ ++ /* Set initial block to start looking for environment */ ++ offset = DEVOFFSET(dev); ++ /* Use variables for common values */ ++ blocksize = DEVESIZE(dev); ++ type = DEVTYPE(dev); ++ /* Look for the number of sectors specified for the primary copy */ ++ nsectors = ENVSECTORS(dev); ++ ++ for (i = 0; i < nsectors && copies; i++) { ++ rc = flash_bad_block(fd, type, &offset); ++ if (rc < 0) { ++ rc = -1; ++ goto error; ++ } else if (!rc) { ++ /* ++ * Set first good block as primary (no matter if it is ++ * the other copy. After all, the 'current' copy is ++ * determined by the active flag. ++ */ ++ DEVOFFSET(dev) = offset; ++ copies--; ++ dev++; ++ } ++ offset += blocksize; ++ } ++ ++ while (copies) { ++ /* No good sectors available. Set offset out of bounds */ ++ DEVOFFSET(dev) = offset; ++ copies--; ++ dev++; ++ } ++ rc = 0; ++ ++error: ++ close(fd); ++ return rc; ++} ++ + static int flash_io (int mode) + { + int fd_current, fd_target, rc, dev_target; +@@ -1341,6 +1418,18 @@ int fw_env_open(void) + environment.data = single->data; + } + ++ /* ++ * Trigger dynamic location of environment if redundant copy has the ++ * same offset than primary copy. ++ */ ++ if (HaveRedundEnv && (DEVOFFSET(0) == DEVOFFSET(1))) { ++ have_dynamic_env = 1; ++ top_of_range = DEVOFFSET(0) + (ENVSECTORS(0) * DEVESIZE(0)); ++ ++ if (set_dynamic_location() < 0) ++ return -1; ++ } ++ + dev_current = 0; + if (flash_io (O_RDONLY)) + return -1; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend index ef7fbfc26..0f5236f84 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend @@ -10,6 +10,8 @@ UBOOT_FW_UTILS_PATCHES = " \ file://0001-tools-env-implement-support-for-environment-encrypti.patch \ file://0002-Implement-U-Boot-environment-access-functions.patch \ file://0003-fw_env-add-support-to-unlock-emmc-boot-partition.patch \ + file://0004-tools-env-factorize-function-to-get-device-type.patch \ + file://0005-tools-env-add-support-to-set-dynamic-location-of-env.patch \ " # Patches from 'meta-swupdate' touch the same files than ours, so we need to From d3baa9b2b1c21414f88cfda8b8efcb28515ed8dd Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 31 May 2017 14:12:38 +0200 Subject: [PATCH 32/95] base-files: add sysctl.conf to the list of config files So it's not overwritten by package managers by default. Signed-off-by: Javier Viguera --- .../recipes-core/base-files/base-files_3.0.14.bbappend | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend b/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend index 669a22313..609e18220 100644 --- a/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend +++ b/meta-digi-dey/recipes-core/base-files/base-files_3.0.14.bbappend @@ -16,3 +16,5 @@ do_install_append_ccimx6() { install -d ${D}${sysconfdir}/${IMAGE_PKGTYPE}-postinsts install -m 0755 ${WORKDIR}/resize-ext4fs.sh ${D}${sysconfdir}/${IMAGE_PKGTYPE}-postinsts/ } + +CONFFILES_${PN} += "${sysconfdir}/sysctl.conf" From 5d955b86afdb5d849967e9151b9261b43ba68e11 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 1 Jun 2017 20:09:39 +0200 Subject: [PATCH 33/95] init-ifupdown: fix script when '/etc/resolv.conf' is a file The readlink command on a real file was expanding to nothing and then the '/etc/resolv.conf' file was not being updated with the nameservers. With this change we only run the 'readlink' link command after checking that the file is actually a symbolic link. Signed-off-by: Javier Viguera --- .../recipes-core/init-ifupdown/init-ifupdown-1.0/resolv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv index ecc0b4070..b11f148c9 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv @@ -18,7 +18,10 @@ # Only for static method [ "${METHOD}" != "static" ] && exit 0 -RESOLVCONF="$(readlink /etc/resolv.conf)" +RESOLVCONF="/etc/resolv.conf" + +# For symlinks reset to the destination file +[ -h "${RESOLVCONF}" ] && RESOLVCONF="$(readlink ${RESOLVCONF})" NAMESERVERS="" for NS in ${IF_DNS_NAMESERVER} ${IF_DNS_NAMESERVERS}; do From b75959afd99dec433a7719f5c5235ab26e6220f9 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 2 Jun 2017 12:07:12 +0200 Subject: [PATCH 34/95] meta-digi-dey: add new recipe for AWS Greengrass core https://jira.digi.com/browse/DEL-4302 Signed-off-by: Javier Viguera --- ...ve-bashisms-in-launcher-shell-script.patch | 83 ++++++++++ .../greengrass/greengrass_0.9.0.bb | 152 ++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch create mode 100644 meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch b/meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch new file mode 100644 index 000000000..fd722576a --- /dev/null +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch @@ -0,0 +1,83 @@ +From: Javier Viguera +Date: Wed, 31 May 2017 13:52:30 +0200 +Subject: [PATCH] greengrassd: remove bashisms in launcher shell script + +So it runs properly in other Posix shells (like the one in Busybox) + +Signed-off-by: Javier Viguera +--- + greengrassd | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/greengrassd b/greengrassd +index c312d23dda3c..1d4b3ad6dd22 100755 +--- a/greengrassd ++++ b/greengrassd +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/bin/sh + + ##########Environment Requirement for Greengrass Daemon########## + # by default, the daemon assumes it's going to be launched from a directory +@@ -35,19 +35,19 @@ setup() { + mkdir -p $GGC_ROOT_FS + + # Mask greengrass directory for containers +- mknod $GGC_ROOT_FS/greengrass c 1 3 &>/dev/null || true ++ mknod $GGC_ROOT_FS/greengrass c 1 3 >/dev/null 2>&1 || true + + } + + validatePlatformSecurity() { + +- if [[ -f $FS_SETTINGS/protected_hardlinks && +- -f $FS_SETTINGS/protected_symlinks ]]; then ++ if [ -f $FS_SETTINGS/protected_hardlinks ] && ++ [ -f $FS_SETTINGS/protected_symlinks ]; then + + PROT_HARDLINK_VAL=$(cat $FS_SETTINGS/protected_hardlinks) + PROT_SOFTLINK_VAL=$(cat $FS_SETTINGS/protected_symlinks) + +- if [[ "$PROT_HARDLINK_VAL" -ne 1 || "$PROT_SOFTLINK_VAL" -ne 1 ]]; then ++ if [ "$PROT_HARDLINK_VAL" -ne 1 ] || [ "$PROT_SOFTLINK_VAL" -ne 1 ]; then + echo "Insecure configuration detected: No hardlink/softlink protection" | tee -a $CRASH_LOG + exit 1 + fi +@@ -124,7 +124,7 @@ validateEnvironment() { + + start() { + setup +- if [[ $INSECURE -ne 1 ]]; then ++ if [ "${INSECURE}" != "1" ]; then + validatePlatformSecurity + fi + +@@ -169,7 +169,7 @@ stop() { + break + fi + done; +- echo -e "\nStopped greengrass daemon" ++ printf "\nStopped greengrass daemon\n" + rm $PID_FILE + else + echo "Unable to kill the process with pid: $PID" +@@ -186,16 +186,16 @@ usage() { + echo "" + echo "Usage: $0 [FLAGS] {start|stop|restart}" + echo "" +- echo -e "[FLAGS]: -i, --insecure \t Run GGC in insecure mode, (highly discouraged!)" ++ printf "[FLAGS]: -i, --insecure \t Run GGC in insecure mode, (highly discouraged!)\n" + echo "" + exit 1 + } + +-if [[ $# -eq 0 ]]; then ++if [ $# -eq 0 ]; then + usage + fi + +-while [[ $# -gt 0 ]] ++while [ $# -gt 0 ] + do + key="$1" + case $key in diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb new file mode 100644 index 000000000..486c4ed35 --- /dev/null +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb @@ -0,0 +1,152 @@ +# Copyright (C) 2017, Digi International Inc. + +SUMMARY = "AWS IoT Greengrass core" +HOMEPAGE = "https://aws.amazon.com/greengrass/" +# +# The package includes different licenses: +# +# [Apache-2.0] +# LICENSE/github_aws_aws_sdk_go_License.txt +# LICENSE/github_coreos_go_systemd_License.txt +# LICENSE/github_docker_docker_License.txt +# LICENSE/github_docker_go_units_License.txt +# LICENSE/github_go_ini_ini_License.txt +# LICENSE/github_jmespath_go_jmespath_License.txt +# LICENSE/github_opencontainers_runc_License.txt +# LICENSE/github_opencontainers_runtime_spec_License.txt +# LICENSE/github_pquerna_ffjson_License.txt +# LICENSE/github_vishvananda_netlink_License.txt +# [BSD-2-Clause] +# LICENSE/github_godbus_dbus_License.txt +# LICENSE/github_huin_gobinarytest_License.txt +# LICENSE/github_seccomp_libseccomp_golang_License.txt +# LICENSE/github_syndtr_gocapability_License.txt +# [BSD-3-Clause] +# LICENSE/github_golang_protobuf_License.txt +# LICENSE/github_jeffallen_mqtt_License.txt +# LICENSE/Golang_License.txt +# [MIT] +# LICENSE/github_huin_mqtt_License.txt +# LICENSE/github_mattn_go_sqlite3_License.txt +# LICENSE/github_nu7hatch_gouuid_License.txt +# LICENSE/github_Sirupsen_logrus_License.txt +# LICENSE/github_urfave_cli_License.txt +# LICENSE/github_yosssi_gmq_License.txt +# [Proprietary] +# LICENSE/GG-BetaMaterials-License.txt +# +LICENSE = "Apache-2.0 | BSD-2-Clause | BSD-3-Clause | MIT | Proprietary" +LIC_FILES_CHKSUM = " \ + file://LICENSE/GG-BetaMaterials-License.txt;md5=a33101714f905fe97db6fe085c1271ef \ + file://LICENSE/github_aws_aws_sdk_go_License.txt;md5=d273d63619c9aeaf15cdaf76422c4f87 \ + file://LICENSE/github_coreos_go_systemd_License.txt;md5=715f3348ed8b9bf4fac3b08133384a4d \ + file://LICENSE/github_docker_docker_License.txt;md5=bba4ee48af378e39b452d742d29c710b \ + file://LICENSE/github_docker_go_units_License.txt;md5=bb99db20f1c48c2c4952c27c72855e36 \ + file://LICENSE/github_godbus_dbus_License.txt;md5=b03a62440372a9acf9692ad365932c87 \ + file://LICENSE/github_go_ini_ini_License.txt;md5=715f3348ed8b9bf4fac3b08133384a4d \ + file://LICENSE/github_golang_protobuf_License.txt;md5=16fe162f7848190010b6ec7bfaac030a \ + file://LICENSE/github_huin_gobinarytest_License.txt;md5=f2b3138d9d314bccf5297dea7e3e6d14 \ + file://LICENSE/github_huin_mqtt_License.txt;md5=12fd125064676697934b7d8c09bed0e8 \ + file://LICENSE/github_jeffallen_mqtt_License.txt;md5=b7269d52765d477e10f319c19d8a9d33 \ + file://LICENSE/github_jmespath_go_jmespath_License.txt;md5=640d33f0070c9dc3a194d2ed7db02974 \ + file://LICENSE/github_mattn_go_sqlite3_License.txt;md5=948f36a2300ac729e60416063190f664 \ + file://LICENSE/github_nu7hatch_gouuid_License.txt;md5=6b18748dcc29fda05fa5aaef44d517fd \ + file://LICENSE/github_opencontainers_runc_License.txt;md5=587c01b2dcc5dc3b4bed51b918c64731 \ + file://LICENSE/github_opencontainers_runtime_spec_License.txt;md5=ef95ed297310c3d09ba16c06d5e161a5 \ + file://LICENSE/github_pquerna_ffjson_License.txt;md5=d273d63619c9aeaf15cdaf76422c4f87 \ + file://LICENSE/github_seccomp_libseccomp_golang_License.txt;md5=9205c4c469bfb9d3a63f346539ee445b \ + file://LICENSE/github_Sirupsen_logrus_License.txt;md5=29baae91637760ae68feb57ca93e5a0a \ + file://LICENSE/github_syndtr_gocapability_License.txt;md5=321f58fa53a0b1bb9a887f14660d436b \ + file://LICENSE/github_urfave_cli_License.txt;md5=f1f14a2449300559aed90bedc36a71ed \ + file://LICENSE/github_vishvananda_netlink_License.txt;md5=c95fd0efd62139c155e956a448df8fd6 \ + file://LICENSE/github_yosssi_gmq_License.txt;md5=2509f45544da1ecce869ce2de1aa44dd \ + file://LICENSE/Golang_License.txt;md5=3d7ed06383c65a3161b36c6a0b0b98f5 \ +" + +SRC_URI = " \ + http:///not/exist/greengrass-linux-armv6l-${PV}-release.tar.gz \ + file://0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch \ +" +SRC_URI[md5sum] = "eb7e6dbdfe00e51db8b7ffbd2284ae59" +SRC_URI[sha256sum] = "24da4016345eeeb6a86067619d385015139437fbd16dba9a91461758692f933f" + +GG_TARBALL_LOCAL_PATH ?= "" + +# The tarball is only available for downloading after registration, so provide +# a PREMIRROR to a local directory that can be configured in the project's +# local.conf file using GG_TARBALL_LOCAL_PATH variable. +python() { + gg_tarball_local_path = d.getVar('GG_TARBALL_LOCAL_PATH', True) + if gg_tarball_local_path: + premirrors = d.getVar('PREMIRRORS', True) + d.setVar('PREMIRRORS', "http:///not/exist/greengrass.* file://%s \\n %s" % (gg_tarball_local_path, premirrors)) +} + +S = "${WORKDIR}/${BPN}" + +inherit useradd + +GG_USESYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', 'no', d)}" + +# Disable tasks not needed for the binary package +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + install -d ${D}/opt/${BPN} + tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - -C ${S} . \ + | tar --no-same-owner -xpf - -C ${D}/opt/${BPN} + + # Configure whether to use systemd or not + sed -i -e "/useSystemd/{s,\[yes|no],${GG_USESYSTEMD},g}" ${D}/opt/${BPN}/configuration/config.json +} + +pkg_postinst_${PN}() { + # Enable protection for hardlinks and symlinks + if ! grep -qs 'protected_.*links' $D${sysconfdir}/sysctl.conf; then + cat >> $D${sysconfdir}/sysctl.conf <<-_EOF_ + # Greengrass: protect hardlinks/symlinks + fs.protected_hardlinks = 1 + fs.protected_symlinks = 1 + _EOF_ + fi + + # Customize '/etc/fstab' + if [ -f "$D${sysconfdir}/fstab" ]; then + # Disable TMPFS /var/volatile + sed -i -e '\#^tmpfs[[:blank:]]\+/var/volatile#s,^,#,g' $D${sysconfdir}/fstab + + # Mount a cgroup hierarchy with all available subsystems + if ! grep -qs '^cgroup' $D${sysconfdir}/fstab; then + cat >> $D${sysconfdir}/fstab <<-_EOF_ + # Greengrass: mount cgroups + cgroup /sys/fs/cgroup cgroup defaults 0 0 + _EOF_ + fi + fi + + # Disable '/etc/resolv.conf' symlink + if [ -f "$D${sysconfdir}/default/volatiles/00_core" ]; then + sed -i -e '/resolv.conf/d' $D${sysconfdir}/default/volatiles/00_core + cat >> $D${sysconfdir}/default/volatiles/00_core <<-_EOF_ + # Greengrass: create a real (no symlink) resolv.conf + f root root 0644 /etc/resolv.conf none + _EOF_ + fi +} + +FILES_${PN} = "/opt/${BPN}" + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "-r ggc_group" +USERADD_PARAM_${PN} = "-r -M -N -g ggc_group -s /bin/false ggc_user" + +# +# Disable failing QA checks: +# +# Binary was already stripped +# No GNU_HASH in the elf binary +# +INSANE_SKIP_${PN} += "already-stripped ldflags" + +RDEPENDS_${PN} += "ca-certificates python-core sqlite3" From 3ff2da409691a946951ebe1755948ff7e93136a9 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Thu, 1 Jun 2017 10:29:39 +0200 Subject: [PATCH 35/95] layer.conf: add custom-licenses folder Signed-off-by: Diaz de Grenu, Jose --- meta-digi-dey/conf/layer.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-dey/conf/layer.conf b/meta-digi-dey/conf/layer.conf index f0737ec43..421d4d2f6 100644 --- a/meta-digi-dey/conf/layer.conf +++ b/meta-digi-dey/conf/layer.conf @@ -21,6 +21,9 @@ LAYERDEPENDS_digi-dey += "openembedded-layer networking-layer webserver qt5-laye DIGI_EULA_FILE = "${LAYERDIR}/DIGI_EULA" DIGI_OPEN_EULA_FILE = "${LAYERDIR}/DIGI_OPEN_EULA" +# Additional license directories +LICENSE_PATH += "${LAYERDIR}/custom-licenses" + # Digi mirror for packages vanished upstream DIGI_MIRROR ?= "ftp://ftp1.digi.com/support/digiembeddedyocto/mirror/" MIRRORS += "\ From ff93cd2b28dde5b87f1126a811d3de25af2afa18 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Fri, 26 May 2017 12:55:16 +0200 Subject: [PATCH 36/95] recipes-digi: add cryptoauthlib This library adds support to use the Atmel CryptoAuth device available in the ConnectCore 6UL. https://jira.digi.com/browse/DEL-4284 Signed-off-by: Diaz de Grenu, Jose --- .../conf/machine/include/ccimx6ul.inc | 2 +- .../ATMEL_CRYPTOAUTHLIB_LICENSE | 27 +++++++++++++++++ .../cryptoauthlib/cryptoauthlib_git.bb | 30 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE create mode 100644 meta-digi-dey/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb diff --git a/meta-digi-arm/conf/machine/include/ccimx6ul.inc b/meta-digi-arm/conf/machine/include/ccimx6ul.inc index a75fcb089..de42135e9 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6ul.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6ul.inc @@ -29,7 +29,7 @@ MACHINE_EXTRA_RDEPENDS += " \ u-boot-fw-utils \ " MACHINE_EXTRA_RRECOMMENDS += "${MACHINE_FIRMWARE} ${WIRELESS_MODULE}" -MACHINE_EXTRA_RRECOMMENDS += "imx-alsa-plugins cryptodev-module" +MACHINE_EXTRA_RRECOMMENDS += "imx-alsa-plugins cryptodev-module cryptoauthlib" MACHINE_FEATURES += "wifi bluetooth" diff --git a/meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE b/meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE new file mode 100644 index 000000000..cc9ab017b --- /dev/null +++ b/meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE @@ -0,0 +1,27 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. The name of Atmel may not be used to endorse or promote products derived + from this software without specific prior written permission. + +4. This software may only be redistributed and used in connection with an + Atmel integrated circuit. + +THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/meta-digi-dey/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb b/meta-digi-dey/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb new file mode 100644 index 000000000..9e2e7c12c --- /dev/null +++ b/meta-digi-dey/recipes-digi/cryptoauthlib/cryptoauthlib_git.bb @@ -0,0 +1,30 @@ +# Copyright (C) 2017, Digi International Inc. + +SUMMARY = "Atmel CryptoAuthentication Library" +SECTION = "libs" +LICENSE = "ATMEL_CRYPTOAUTHLIB_LICENSE" +LIC_FILES_CHKSUM = "file://lib/atca_cfgs.h;beginline=8;endline=40;md5=073d05cb7a4312aaff0af9186e4fa93e" + +SRCBRANCH = "master" +SRCREV = "${AUTOREV}" + +GIT_URI ?= "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_MTK_GIT}linux/atmel-cryptoauth-openssl-engine.git;protocol=ssh', '${DIGI_GITHUB_GIT}/atmel-cryptoauth-openssl-engine.git', d)}" + +SRC_URI = "${GIT_URI};branch=${SRCBRANCH}" + +S = "${WORKDIR}/git/engine_atecc/cryptoauthlib" + +I2C_BUS = "" +I2C_BUS_ccimx6ul = "0" + +I2C_SPEED = "" +I2C_SPEED_ccimx6ul = "100000" + +CFLAGS += "-DATCA_HAL_I2C_BUS=${I2C_BUS} -DATCA_HAL_I2C_SPEED=${I2C_SPEED}" + +do_install() { + oe_runmake DESTDIR=${D} install +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(ccimx6ul)" \ No newline at end of file From c2f71b96462c8e4ea585c05514d5add86911afd8 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 6 Jun 2017 17:17:16 +0200 Subject: [PATCH 37/95] AWS Greengrass: install the package under '/greengrass' folder That's the default assumed by the GG daemon: $ daemon --help -gg-home string home directory of greengrass (default "/greengrass") As of this version GG daemon may not work properly otherwise. Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb index 486c4ed35..f777cb555 100644 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb @@ -93,12 +93,12 @@ do_configure[noexec] = "1" do_compile[noexec] = "1" do_install() { - install -d ${D}/opt/${BPN} + install -d ${D}/${BPN} tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - -C ${S} . \ - | tar --no-same-owner -xpf - -C ${D}/opt/${BPN} + | tar --no-same-owner -xpf - -C ${D}/${BPN} # Configure whether to use systemd or not - sed -i -e "/useSystemd/{s,\[yes|no],${GG_USESYSTEMD},g}" ${D}/opt/${BPN}/configuration/config.json + sed -i -e "/useSystemd/{s,\[yes|no],${GG_USESYSTEMD},g}" ${D}/${BPN}/configuration/config.json } pkg_postinst_${PN}() { @@ -135,7 +135,7 @@ pkg_postinst_${PN}() { fi } -FILES_${PN} = "/opt/${BPN}" +FILES_${PN} = "/${BPN}" USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "-r ggc_group" From 95c511d100aadceb29b7c3ab6a9e07c44685c83a Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 6 Jun 2017 17:20:02 +0200 Subject: [PATCH 38/95] AWS Greengrass: add python dependences for lambda_runtime.py Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb index f777cb555..e728cd4ed 100644 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb @@ -149,4 +149,4 @@ USERADD_PARAM_${PN} = "-r -M -N -g ggc_group -s /bin/false ggc_user" # INSANE_SKIP_${PN} += "already-stripped ldflags" -RDEPENDS_${PN} += "ca-certificates python-core sqlite3" +RDEPENDS_${PN} += "ca-certificates python-argparse python-json python-numbers sqlite3" From f59d27e5a8d029c1ff7b61ebb73bbfa90f5c34e5 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 6 Jun 2017 18:39:33 +0200 Subject: [PATCH 39/95] AWS Greengrass: wait some time to check GG daemon status on launch GG daemon may die due to misconfigurations, but this takes a bit of time, so wait a bit to check whether the daemon is still alive. Signed-off-by: Javier Viguera --- ...-some-time-to-check-GG-daemon-status.patch | 35 +++++++++++++++++++ .../greengrass/greengrass_0.9.0.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch b/meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch new file mode 100644 index 000000000..3b0d074ae --- /dev/null +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch @@ -0,0 +1,35 @@ +From: Javier Viguera +Date: Tue, 6 Jun 2017 18:34:10 +0200 +Subject: [PATCH] greengrassd: wait some time to check GG daemon status after + launch + +GG daemon may die due to misconfigurations, but this takes a bit of +time, so wait a bit to check whether the daemon is still alive. + +Signed-off-by: Javier Viguera +--- + greengrassd | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/greengrassd b/greengrassd +index 1d4b3ad6dd22..50c922bca3ae 100755 +--- a/greengrassd ++++ b/greengrassd +@@ -134,13 +134,16 @@ start() { + if nohup $COMMAND >/dev/null 2>$CRASH_LOG < /dev/null & + then + pid=$! ++ # Give GG daemon some time to initialize before checking ++ # whether it's still alive. ++ sleep .5 + if [ -e "/proc/$pid" ] + then + echo "PID: $pid" + echo "$pid" > $PID_FILE + echo "Greengrass daemon started" + else +- echo "Greengrass daemon $pid crashed after start" ++ echo "Greengrass daemon $pid crashed after start: check ${CRASH_LOG}" + exit 1 + fi + else diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb index e728cd4ed..18bce39e4 100644 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb @@ -66,6 +66,7 @@ LIC_FILES_CHKSUM = " \ SRC_URI = " \ http:///not/exist/greengrass-linux-armv6l-${PV}-release.tar.gz \ file://0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch \ + file://0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch \ " SRC_URI[md5sum] = "eb7e6dbdfe00e51db8b7ffbd2284ae59" SRC_URI[sha256sum] = "24da4016345eeeb6a86067619d385015139437fbd16dba9a91461758692f933f" From 8e8e7f8982f062a863209c749dbdc6a45a15a402 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 6 Jun 2017 19:35:03 +0200 Subject: [PATCH 40/95] AWS Greengrass: add daemon launcher wrapper bootscript Signed-off-by: Javier Viguera --- .../greengrass/greengrass/greengrass-init | 31 +++++++++++++++++++ .../greengrass/greengrass_0.9.0.bb | 13 ++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 meta-digi-dey/recipes-aws/greengrass/greengrass/greengrass-init diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass/greengrass-init b/meta-digi-dey/recipes-aws/greengrass/greengrass/greengrass-init new file mode 100644 index 000000000..8af4aafde --- /dev/null +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass/greengrass-init @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Copyright (c) 2017, Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# Description: Wrapper bootscript for AWS Greengrass core +# + +GG_INSTALL_DIR="##GG_INSTALL_DIR##" +GG_LAUNCHER="${GG_INSTALL_DIR}/greengrassd" + +case "${1}" in + start | stop | restart) + ${GG_LAUNCHER} ${1} + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb index 18bce39e4..459073004 100644 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb @@ -65,6 +65,7 @@ LIC_FILES_CHKSUM = " \ SRC_URI = " \ http:///not/exist/greengrass-linux-armv6l-${PV}-release.tar.gz \ + file://greengrass-init \ file://0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch \ file://0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch \ " @@ -85,7 +86,7 @@ python() { S = "${WORKDIR}/${BPN}" -inherit useradd +inherit update-rc.d useradd GG_USESYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', 'no', d)}" @@ -98,6 +99,11 @@ do_install() { tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - -C ${S} . \ | tar --no-same-owner -xpf - -C ${D}/${BPN} + # Install wrapper bootscript to launch Greengrass core on boot + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/greengrass-init ${D}${sysconfdir}/init.d/greengrass + sed -i -e "s,##GG_INSTALL_DIR##,/${BPN},g" ${D}${sysconfdir}/init.d/greengrass + # Configure whether to use systemd or not sed -i -e "/useSystemd/{s,\[yes|no],${GG_USESYSTEMD},g}" ${D}/${BPN}/configuration/config.json } @@ -136,7 +142,10 @@ pkg_postinst_${PN}() { fi } -FILES_${PN} = "/${BPN}" +FILES_${PN} = "/${BPN} ${sysconfdir}" + +INITSCRIPT_NAME = "greengrass" +INITSCRIPT_PARAMS = "defaults 80 20" USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "-r ggc_group" From a8f0024403f76ea39280f98e3ffeddb2a6ab7f42 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 7 Jun 2017 20:49:58 +0200 Subject: [PATCH 41/95] AWS Greengrass: update to version 1.0.0 Signed-off-by: Javier Viguera --- ...ve-bashisms-in-launcher-shell-script.patch | 69 +++++-- ...-some-time-to-check-GG-daemon-status.patch | 35 ---- .../greengrass/greengrass_0.9.0.bb | 162 ---------------- .../greengrass/greengrass_1.0.0.bb | 176 ++++++++++++++++++ 4 files changed, 226 insertions(+), 216 deletions(-) delete mode 100644 meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch delete mode 100644 meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb create mode 100644 meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch b/meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch index fd722576a..1a6f0046d 100644 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass/0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch @@ -1,16 +1,16 @@ From: Javier Viguera -Date: Wed, 31 May 2017 13:52:30 +0200 +Date: Wed, 7 Jun 2017 20:44:56 +0200 Subject: [PATCH] greengrassd: remove bashisms in launcher shell script So it runs properly in other Posix shells (like the one in Busybox) Signed-off-by: Javier Viguera --- - greengrassd | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) + greengrassd | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/greengrassd b/greengrassd -index c312d23dda3c..1d4b3ad6dd22 100755 +index cadaa6b0101e..e24422af2f3d 100755 --- a/greengrassd +++ b/greengrassd @@ -1,4 +1,4 @@ @@ -19,7 +19,7 @@ index c312d23dda3c..1d4b3ad6dd22 100755 ##########Environment Requirement for Greengrass Daemon########## # by default, the daemon assumes it's going to be launched from a directory -@@ -35,19 +35,19 @@ setup() { +@@ -38,19 +38,19 @@ setup() { mkdir -p $GGC_ROOT_FS # Mask greengrass directory for containers @@ -40,10 +40,10 @@ index c312d23dda3c..1d4b3ad6dd22 100755 - if [[ "$PROT_HARDLINK_VAL" -ne 1 || "$PROT_SOFTLINK_VAL" -ne 1 ]]; then + if [ "$PROT_HARDLINK_VAL" -ne 1 ] || [ "$PROT_SOFTLINK_VAL" -ne 1 ]; then - echo "Insecure configuration detected: No hardlink/softlink protection" | tee -a $CRASH_LOG + echo "AWS Greengrass detected insecure OS configuration: No hardlink/softlink protection enabled." | tee -a $CRASH_LOG exit 1 fi -@@ -124,7 +124,7 @@ validateEnvironment() { +@@ -127,7 +127,7 @@ validateEnvironment() { start() { setup @@ -52,21 +52,52 @@ index c312d23dda3c..1d4b3ad6dd22 100755 validatePlatformSecurity fi -@@ -169,7 +169,7 @@ stop() { - break - fi - done; -- echo -e "\nStopped greengrass daemon" -+ printf "\nStopped greengrass daemon\n" - rm $PID_FILE - else - echo "Unable to kill the process with pid: $PID" -@@ -186,16 +186,16 @@ usage() { +@@ -139,7 +139,7 @@ start() { + then + pid=$! + # sleep 5 seconds to wait for daemon to start or exit +- for i in {1..5}; do ++ for i in $(seq 1 5); do + echo -n "." + sleep 1 + done +@@ -147,10 +147,10 @@ start() { + if [ -e "/proc/$pid" ] + then + echo "$pid" > $PID_FILE +- echo -e "\e[0;32mGreengrass daemon started with PID: $pid\e[0m" ++ printf "\e[0;32mGreengrass daemon started with PID: $pid\e[0m\n" + else + echo "Greengrass daemon $pid failed to start" +- echo -e "\e[0;31m$(cat $CRASH_LOG)\e[0m" ++ printf "\e[0;31m$(cat $CRASH_LOG)\e[0m\n" + exit 1 + fi + else +@@ -179,7 +179,7 @@ stop() { + # If the pid no longer exists, we're done, remove the pid file and exit. Otherwise, just increment the loop counter + if [ ! -e "/proc/$PID" ]; then + rm $PID_FILE +- echo -e "\nStopped greengrass daemon, exiting with success" ++ printf "\nStopped greengrass daemon, exiting with success\n" + break + else + total_sleep_seconds=$(($total_sleep_seconds+1)) +@@ -194,7 +194,7 @@ stop() { + + if [ $total_sleep_seconds -ge $MAX_DAEMON_KILL_WAIT_SECONDS ]; then + # If we are here, we never exited in the previous loop and the pid still exists. Exit with failure. +- echo -e "\nProcess with pid $PID still alive after timeout of $MAX_DAEMON_KILL_WAIT_SECONDS seconds. Unable to kill process, exiting with failure." ++ printf "\nProcess with pid $PID still alive after timeout of $MAX_DAEMON_KILL_WAIT_SECONDS seconds. Unable to kill process, exiting with failure.\n" + exit 1 + fi + fi +@@ -204,16 +204,16 @@ usage() { echo "" echo "Usage: $0 [FLAGS] {start|stop|restart}" echo "" -- echo -e "[FLAGS]: -i, --insecure \t Run GGC in insecure mode, (highly discouraged!)" -+ printf "[FLAGS]: -i, --insecure \t Run GGC in insecure mode, (highly discouraged!)\n" +- echo -e "[FLAGS]: -i, --insecure \t Run GGC in insecure mode without hardlink/softlink protection, (highly discouraged for production use)" ++ printf "[FLAGS]: -i, --insecure \t Run GGC in insecure mode without hardlink/softlink protection, (highly discouraged for production use)\n" echo "" exit 1 } diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch b/meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch deleted file mode 100644 index 3b0d074ae..000000000 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass/0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Javier Viguera -Date: Tue, 6 Jun 2017 18:34:10 +0200 -Subject: [PATCH] greengrassd: wait some time to check GG daemon status after - launch - -GG daemon may die due to misconfigurations, but this takes a bit of -time, so wait a bit to check whether the daemon is still alive. - -Signed-off-by: Javier Viguera ---- - greengrassd | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/greengrassd b/greengrassd -index 1d4b3ad6dd22..50c922bca3ae 100755 ---- a/greengrassd -+++ b/greengrassd -@@ -134,13 +134,16 @@ start() { - if nohup $COMMAND >/dev/null 2>$CRASH_LOG < /dev/null & - then - pid=$! -+ # Give GG daemon some time to initialize before checking -+ # whether it's still alive. -+ sleep .5 - if [ -e "/proc/$pid" ] - then - echo "PID: $pid" - echo "$pid" > $PID_FILE - echo "Greengrass daemon started" - else -- echo "Greengrass daemon $pid crashed after start" -+ echo "Greengrass daemon $pid crashed after start: check ${CRASH_LOG}" - exit 1 - fi - else diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb deleted file mode 100644 index 459073004..000000000 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass_0.9.0.bb +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright (C) 2017, Digi International Inc. - -SUMMARY = "AWS IoT Greengrass core" -HOMEPAGE = "https://aws.amazon.com/greengrass/" -# -# The package includes different licenses: -# -# [Apache-2.0] -# LICENSE/github_aws_aws_sdk_go_License.txt -# LICENSE/github_coreos_go_systemd_License.txt -# LICENSE/github_docker_docker_License.txt -# LICENSE/github_docker_go_units_License.txt -# LICENSE/github_go_ini_ini_License.txt -# LICENSE/github_jmespath_go_jmespath_License.txt -# LICENSE/github_opencontainers_runc_License.txt -# LICENSE/github_opencontainers_runtime_spec_License.txt -# LICENSE/github_pquerna_ffjson_License.txt -# LICENSE/github_vishvananda_netlink_License.txt -# [BSD-2-Clause] -# LICENSE/github_godbus_dbus_License.txt -# LICENSE/github_huin_gobinarytest_License.txt -# LICENSE/github_seccomp_libseccomp_golang_License.txt -# LICENSE/github_syndtr_gocapability_License.txt -# [BSD-3-Clause] -# LICENSE/github_golang_protobuf_License.txt -# LICENSE/github_jeffallen_mqtt_License.txt -# LICENSE/Golang_License.txt -# [MIT] -# LICENSE/github_huin_mqtt_License.txt -# LICENSE/github_mattn_go_sqlite3_License.txt -# LICENSE/github_nu7hatch_gouuid_License.txt -# LICENSE/github_Sirupsen_logrus_License.txt -# LICENSE/github_urfave_cli_License.txt -# LICENSE/github_yosssi_gmq_License.txt -# [Proprietary] -# LICENSE/GG-BetaMaterials-License.txt -# -LICENSE = "Apache-2.0 | BSD-2-Clause | BSD-3-Clause | MIT | Proprietary" -LIC_FILES_CHKSUM = " \ - file://LICENSE/GG-BetaMaterials-License.txt;md5=a33101714f905fe97db6fe085c1271ef \ - file://LICENSE/github_aws_aws_sdk_go_License.txt;md5=d273d63619c9aeaf15cdaf76422c4f87 \ - file://LICENSE/github_coreos_go_systemd_License.txt;md5=715f3348ed8b9bf4fac3b08133384a4d \ - file://LICENSE/github_docker_docker_License.txt;md5=bba4ee48af378e39b452d742d29c710b \ - file://LICENSE/github_docker_go_units_License.txt;md5=bb99db20f1c48c2c4952c27c72855e36 \ - file://LICENSE/github_godbus_dbus_License.txt;md5=b03a62440372a9acf9692ad365932c87 \ - file://LICENSE/github_go_ini_ini_License.txt;md5=715f3348ed8b9bf4fac3b08133384a4d \ - file://LICENSE/github_golang_protobuf_License.txt;md5=16fe162f7848190010b6ec7bfaac030a \ - file://LICENSE/github_huin_gobinarytest_License.txt;md5=f2b3138d9d314bccf5297dea7e3e6d14 \ - file://LICENSE/github_huin_mqtt_License.txt;md5=12fd125064676697934b7d8c09bed0e8 \ - file://LICENSE/github_jeffallen_mqtt_License.txt;md5=b7269d52765d477e10f319c19d8a9d33 \ - file://LICENSE/github_jmespath_go_jmespath_License.txt;md5=640d33f0070c9dc3a194d2ed7db02974 \ - file://LICENSE/github_mattn_go_sqlite3_License.txt;md5=948f36a2300ac729e60416063190f664 \ - file://LICENSE/github_nu7hatch_gouuid_License.txt;md5=6b18748dcc29fda05fa5aaef44d517fd \ - file://LICENSE/github_opencontainers_runc_License.txt;md5=587c01b2dcc5dc3b4bed51b918c64731 \ - file://LICENSE/github_opencontainers_runtime_spec_License.txt;md5=ef95ed297310c3d09ba16c06d5e161a5 \ - file://LICENSE/github_pquerna_ffjson_License.txt;md5=d273d63619c9aeaf15cdaf76422c4f87 \ - file://LICENSE/github_seccomp_libseccomp_golang_License.txt;md5=9205c4c469bfb9d3a63f346539ee445b \ - file://LICENSE/github_Sirupsen_logrus_License.txt;md5=29baae91637760ae68feb57ca93e5a0a \ - file://LICENSE/github_syndtr_gocapability_License.txt;md5=321f58fa53a0b1bb9a887f14660d436b \ - file://LICENSE/github_urfave_cli_License.txt;md5=f1f14a2449300559aed90bedc36a71ed \ - file://LICENSE/github_vishvananda_netlink_License.txt;md5=c95fd0efd62139c155e956a448df8fd6 \ - file://LICENSE/github_yosssi_gmq_License.txt;md5=2509f45544da1ecce869ce2de1aa44dd \ - file://LICENSE/Golang_License.txt;md5=3d7ed06383c65a3161b36c6a0b0b98f5 \ -" - -SRC_URI = " \ - http:///not/exist/greengrass-linux-armv6l-${PV}-release.tar.gz \ - file://greengrass-init \ - file://0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch \ - file://0002-greengrassd-wait-some-time-to-check-GG-daemon-status.patch \ -" -SRC_URI[md5sum] = "eb7e6dbdfe00e51db8b7ffbd2284ae59" -SRC_URI[sha256sum] = "24da4016345eeeb6a86067619d385015139437fbd16dba9a91461758692f933f" - -GG_TARBALL_LOCAL_PATH ?= "" - -# The tarball is only available for downloading after registration, so provide -# a PREMIRROR to a local directory that can be configured in the project's -# local.conf file using GG_TARBALL_LOCAL_PATH variable. -python() { - gg_tarball_local_path = d.getVar('GG_TARBALL_LOCAL_PATH', True) - if gg_tarball_local_path: - premirrors = d.getVar('PREMIRRORS', True) - d.setVar('PREMIRRORS', "http:///not/exist/greengrass.* file://%s \\n %s" % (gg_tarball_local_path, premirrors)) -} - -S = "${WORKDIR}/${BPN}" - -inherit update-rc.d useradd - -GG_USESYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', 'no', d)}" - -# Disable tasks not needed for the binary package -do_configure[noexec] = "1" -do_compile[noexec] = "1" - -do_install() { - install -d ${D}/${BPN} - tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - -C ${S} . \ - | tar --no-same-owner -xpf - -C ${D}/${BPN} - - # Install wrapper bootscript to launch Greengrass core on boot - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/greengrass-init ${D}${sysconfdir}/init.d/greengrass - sed -i -e "s,##GG_INSTALL_DIR##,/${BPN},g" ${D}${sysconfdir}/init.d/greengrass - - # Configure whether to use systemd or not - sed -i -e "/useSystemd/{s,\[yes|no],${GG_USESYSTEMD},g}" ${D}/${BPN}/configuration/config.json -} - -pkg_postinst_${PN}() { - # Enable protection for hardlinks and symlinks - if ! grep -qs 'protected_.*links' $D${sysconfdir}/sysctl.conf; then - cat >> $D${sysconfdir}/sysctl.conf <<-_EOF_ - # Greengrass: protect hardlinks/symlinks - fs.protected_hardlinks = 1 - fs.protected_symlinks = 1 - _EOF_ - fi - - # Customize '/etc/fstab' - if [ -f "$D${sysconfdir}/fstab" ]; then - # Disable TMPFS /var/volatile - sed -i -e '\#^tmpfs[[:blank:]]\+/var/volatile#s,^,#,g' $D${sysconfdir}/fstab - - # Mount a cgroup hierarchy with all available subsystems - if ! grep -qs '^cgroup' $D${sysconfdir}/fstab; then - cat >> $D${sysconfdir}/fstab <<-_EOF_ - # Greengrass: mount cgroups - cgroup /sys/fs/cgroup cgroup defaults 0 0 - _EOF_ - fi - fi - - # Disable '/etc/resolv.conf' symlink - if [ -f "$D${sysconfdir}/default/volatiles/00_core" ]; then - sed -i -e '/resolv.conf/d' $D${sysconfdir}/default/volatiles/00_core - cat >> $D${sysconfdir}/default/volatiles/00_core <<-_EOF_ - # Greengrass: create a real (no symlink) resolv.conf - f root root 0644 /etc/resolv.conf none - _EOF_ - fi -} - -FILES_${PN} = "/${BPN} ${sysconfdir}" - -INITSCRIPT_NAME = "greengrass" -INITSCRIPT_PARAMS = "defaults 80 20" - -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "-r ggc_group" -USERADD_PARAM_${PN} = "-r -M -N -g ggc_group -s /bin/false ggc_user" - -# -# Disable failing QA checks: -# -# Binary was already stripped -# No GNU_HASH in the elf binary -# -INSANE_SKIP_${PN} += "already-stripped ldflags" - -RDEPENDS_${PN} += "ca-certificates python-argparse python-json python-numbers sqlite3" diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb new file mode 100644 index 000000000..c73977241 --- /dev/null +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb @@ -0,0 +1,176 @@ +# Copyright (C) 2017, Digi International Inc. + +SUMMARY = "AWS IoT Greengrass core" +HOMEPAGE = "https://aws.amazon.com/greengrass/" +# +# The package includes different licenses: +# +# [Apache-2.0] +# LICENSE/attributions/github_aws_aws_sdk_go_License.txt +# LICENSE/attributions/github_coreos_go_systemd_License.txt +# LICENSE/attributions/github_docker_docker_License.txt +# LICENSE/attributions/github_docker_go_units_License.txt +# LICENSE/attributions/github_go_ini_ini_License.txt +# LICENSE/attributions/github_jmespath_go_jmespath_License.txt +# LICENSE/attributions/github_opencontainers_runc_License.txt +# LICENSE/attributions/github_opencontainers_runtime_spec_License.txt +# LICENSE/attributions/github_pquerna_ffjson_License.txt +# LICENSE/attributions/github_vishvananda_netlink_License.txt +# [BSD-2-Clause] +# LICENSE/attributions/github_godbus_dbus_License.txt +# LICENSE/attributions/github_huin_gobinarytest_License.txt +# LICENSE/attributions/github_seccomp_libseccomp_golang_License.txt +# LICENSE/attributions/github_syndtr_gocapability_License.txt +# [BSD-3-Clause] +# LICENSE/attributions/github_golang_protobuf_License.txt +# LICENSE/attributions/github_jeffallen_mqtt_License.txt +# LICENSE/attributions/Golang_License.txt +# [MIT] +# LICENSE/attributions/github_huin_mqtt_License.txt +# LICENSE/attributions/github_mattn_go_sqlite3_License.txt +# LICENSE/attributions/github_nu7hatch_gouuid_License.txt +# LICENSE/attributions/github_Sirupsen_logrus_License.txt +# LICENSE/attributions/github_urfave_cli_License.txt +# LICENSE/attributions/github_yosssi_gmq_License.txt +# [PD] +# LICENSE/attributions/sqlite_org_License.txt +# [Proprietary] +# LICENSE/Greengrass AWS SW License (IoT additiona) vr6.txt +# +LICENSE = "Apache-2.0 | BSD-2-Clause | BSD-3-Clause | MIT | PD | Proprietary" +LIC_FILES_CHKSUM = " \ + file://LICENSE/attributions/github_aws_aws_sdk_go_License.txt;md5=d273d63619c9aeaf15cdaf76422c4f87 \ + file://LICENSE/attributions/github_coreos_go_systemd_License.txt;md5=715f3348ed8b9bf4fac3b08133384a4d \ + file://LICENSE/attributions/github_docker_docker_License.txt;md5=bba4ee48af378e39b452d742d29c710b \ + file://LICENSE/attributions/github_docker_go_units_License.txt;md5=bb99db20f1c48c2c4952c27c72855e36 \ + file://LICENSE/attributions/github_godbus_dbus_License.txt;md5=b03a62440372a9acf9692ad365932c87 \ + file://LICENSE/attributions/github_go_ini_ini_License.txt;md5=715f3348ed8b9bf4fac3b08133384a4d \ + file://LICENSE/attributions/github_golang_protobuf_License.txt;md5=16fe162f7848190010b6ec7bfaac030a \ + file://LICENSE/attributions/github_huin_gobinarytest_License.txt;md5=f2b3138d9d314bccf5297dea7e3e6d14 \ + file://LICENSE/attributions/github_huin_mqtt_License.txt;md5=12fd125064676697934b7d8c09bed0e8 \ + file://LICENSE/attributions/github_jeffallen_mqtt_License.txt;md5=b7269d52765d477e10f319c19d8a9d33 \ + file://LICENSE/attributions/github_jmespath_go_jmespath_License.txt;md5=640d33f0070c9dc3a194d2ed7db02974 \ + file://LICENSE/attributions/github_mattn_go_sqlite3_License.txt;md5=948f36a2300ac729e60416063190f664 \ + file://LICENSE/attributions/github_nu7hatch_gouuid_License.txt;md5=6b18748dcc29fda05fa5aaef44d517fd \ + file://LICENSE/attributions/github_opencontainers_runc_License.txt;md5=587c01b2dcc5dc3b4bed51b918c64731 \ + file://LICENSE/attributions/github_opencontainers_runtime_spec_License.txt;md5=ef95ed297310c3d09ba16c06d5e161a5 \ + file://LICENSE/attributions/github_pquerna_ffjson_License.txt;md5=d273d63619c9aeaf15cdaf76422c4f87 \ + file://LICENSE/attributions/github_seccomp_libseccomp_golang_License.txt;md5=9205c4c469bfb9d3a63f346539ee445b \ + file://LICENSE/attributions/github_Sirupsen_logrus_License.txt;md5=29baae91637760ae68feb57ca93e5a0a \ + file://LICENSE/attributions/github_syndtr_gocapability_License.txt;md5=321f58fa53a0b1bb9a887f14660d436b \ + file://LICENSE/attributions/github_urfave_cli_License.txt;md5=f1f14a2449300559aed90bedc36a71ed \ + file://LICENSE/attributions/github_vishvananda_netlink_License.txt;md5=c95fd0efd62139c155e956a448df8fd6 \ + file://LICENSE/attributions/github_yosssi_gmq_License.txt;md5=2509f45544da1ecce869ce2de1aa44dd \ + file://LICENSE/attributions/Golang_License.txt;md5=3d7ed06383c65a3161b36c6a0b0b98f5 \ + file://LICENSE/attributions/sqlite_org_License.txt;md5=380e2694a297aa32879ca2ae9c6c029b \ +" + +# Bitbake does not support spaces in filenames, but GG License does have spaces, +# so workaround the problem by renaming the file before using it. +GG_LIC_FILENAME = "Greengrass AWS SW License (IoT additiona) vr6.txt" +GG_LIC_FILENAME_NOSPACES = "${@d.getVar('GG_LIC_FILENAME', True).replace(' ','_')}" +LIC_FILES_CHKSUM += "file://LICENSE/${GG_LIC_FILENAME_NOSPACES};md5=7df5bf535d02b2f83c260250fe330b6c" + +SRC_URI = " \ + http:///not/exist/greengrass-linux-armv7l-${PV}.tar.gz \ + file://greengrass-init \ + file://0001-greengrassd-remove-bashisms-in-launcher-shell-script.patch \ +" +SRC_URI[md5sum] = "893cf23f3e645d6cfe6975ea55b8b458" +SRC_URI[sha256sum] = "aa71facd21e515f6e98d4aaec873bb9bf9490552df3466ed57c0aef5cc8bef4a" + +GG_TARBALL_LOCAL_PATH ?= "" + +# The tarball is only available for downloading after registration, so provide +# a PREMIRROR to a local directory that can be configured in the project's +# local.conf file using GG_TARBALL_LOCAL_PATH variable. +python() { + gg_tarball_local_path = d.getVar('GG_TARBALL_LOCAL_PATH', True) + if gg_tarball_local_path: + premirrors = d.getVar('PREMIRRORS', True) + d.setVar('PREMIRRORS', "http:///not/exist/greengrass.* file://%s \\n %s" % (gg_tarball_local_path, premirrors)) +} + +S = "${WORKDIR}/${BPN}" + +inherit update-rc.d useradd + +GG_USESYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', 'no', d)}" + +# Rename GG license file +do_unpack[postfuncs] += "rename_license" +rename_license() { + cd ${S}/LICENSE + mv "${GG_LIC_FILENAME}" "${GG_LIC_FILENAME_NOSPACES}" +} + +# Disable tasks not needed for the binary package +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + install -d ${D}/${BPN} + tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - -C ${S} . \ + | tar --no-same-owner -xpf - -C ${D}/${BPN} + + # Install wrapper bootscript to launch Greengrass core on boot + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/greengrass-init ${D}${sysconfdir}/init.d/greengrass + sed -i -e "s,##GG_INSTALL_DIR##,/${BPN},g" ${D}${sysconfdir}/init.d/greengrass + + # Configure whether to use systemd or not + sed -i -e "/useSystemd/{s,\[yes|no],${GG_USESYSTEMD},g}" ${D}/${BPN}/configuration/config.json +} + +pkg_postinst_${PN}() { + # Enable protection for hardlinks and symlinks + if ! grep -qs 'protected_.*links' $D${sysconfdir}/sysctl.conf; then + cat >> $D${sysconfdir}/sysctl.conf <<-_EOF_ + # Greengrass: protect hardlinks/symlinks + fs.protected_hardlinks = 1 + fs.protected_symlinks = 1 + _EOF_ + fi + + # Customize '/etc/fstab' + if [ -f "$D${sysconfdir}/fstab" ]; then + # Disable TMPFS /var/volatile + sed -i -e '\#^tmpfs[[:blank:]]\+/var/volatile#s,^,#,g' $D${sysconfdir}/fstab + + # Mount a cgroup hierarchy with all available subsystems + if ! grep -qs '^cgroup' $D${sysconfdir}/fstab; then + cat >> $D${sysconfdir}/fstab <<-_EOF_ + # Greengrass: mount cgroups + cgroup /sys/fs/cgroup cgroup defaults 0 0 + _EOF_ + fi + fi + + # Disable '/etc/resolv.conf' symlink + if [ -f "$D${sysconfdir}/default/volatiles/00_core" ]; then + sed -i -e '/resolv.conf/d' $D${sysconfdir}/default/volatiles/00_core + cat >> $D${sysconfdir}/default/volatiles/00_core <<-_EOF_ + # Greengrass: create a real (no symlink) resolv.conf + f root root 0644 /etc/resolv.conf none + _EOF_ + fi +} + +FILES_${PN} = "/${BPN} ${sysconfdir}" + +INITSCRIPT_NAME = "greengrass" +INITSCRIPT_PARAMS = "defaults 80 20" + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "-r ggc_group" +USERADD_PARAM_${PN} = "-r -M -N -g ggc_group -s /bin/false ggc_user" + +# +# Disable failing QA checks: +# +# Binary was already stripped +# No GNU_HASH in the elf binary +# +INSANE_SKIP_${PN} += "already-stripped ldflags" + +RDEPENDS_${PN} += "ca-certificates python-argparse python-json python-numbers sqlite3" From f5cdab182c23f6b9aa754635efab781baa50cec9 Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Wed, 7 Jun 2017 21:15:17 +0200 Subject: [PATCH 42/95] dey-examples: tamper: use string intead of magic number for acking the event This will only work if the kernel has the latest driver for MCA tamper. Signed-off-by: Sebastian Pastor --- .../dey-examples/files/tamper_sample/tamper_sample.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c index d3e2dc17d..d63f9df7e 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c @@ -97,7 +97,7 @@ static void tamper_event_ack(mca_tamper_t *tdata) } /* Finally, acknowledge the event */ - ret = write_sysfs_int("tamper_events", tamper_sysfs_dir, 2); + ret = write_sysfs_string("tamper_events", tamper_sysfs_dir, "ack"); if (ret < 0) { fprintf(stdout, "Failed to acknowledge tamper%d event\n", tdata->iface); From f853e3a3dfe60b7e3ac715d20e9c6dc8ff27bcbf Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Thu, 8 Jun 2017 20:36:03 +0200 Subject: [PATCH 43/95] mca_tool: update checksums for build 1.7 Signed-off-by: Sebastian Pastor --- .../recipes-digi/mca/{mca-tool_1.6.bb => mca-tool_1.7.bb} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename meta-digi-arm/recipes-digi/mca/{mca-tool_1.6.bb => mca-tool_1.7.bb} (70%) diff --git a/meta-digi-arm/recipes-digi/mca/mca-tool_1.6.bb b/meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb similarity index 70% rename from meta-digi-arm/recipes-digi/mca/mca-tool_1.6.bb rename to meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb index 86ed5c3e1..fcba45079 100644 --- a/meta-digi-arm/recipes-digi/mca/mca-tool_1.6.bb +++ b/meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb @@ -7,8 +7,8 @@ LICENSE = "CLOSED" PKGNAME = "mca_tool" SRC_URI = "${DIGI_PKG_SRC}/${PKGNAME}-${PV}.tar.gz" -SRC_URI[md5sum] = "20992b6b30904ee4d75d196c957077e0" -SRC_URI[sha256sum] = "49458475dd5df11f0c4f4593ffc930fbcdaa457120f73ab18587d711eb9036f6" +SRC_URI[md5sum] = "b4159e354a530f1cabc4c98cbd30c2e5" +SRC_URI[sha256sum] = "e412e6c815731560e7e32fd2ae86b0ee946735c2ba3e146be30dd07c90518330" S = "${WORKDIR}/${PKGNAME}-${PV}" From 2653fe006379e75f7de1bc552717c1292377ded1 Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Thu, 8 Jun 2017 22:27:33 +0200 Subject: [PATCH 44/95] dey-examples: adc_cmp_sample: show_usage() to always output the long help Signed-off-by: Sebastian Pastor --- .../files/adc_cmp_sample/adc_cmp_sample.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c index 3e533ccb8..fa3e2073c 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c @@ -27,10 +27,6 @@ #define BUFFER_LEN 20 -#define USAGE \ - "Usage:\n" \ - "adc_cmp_sample -c channel -l THRESH_LOW [options]\n\n" - #define FULL_USAGE \ "Usage:\n" \ "adc_cmp_sample -c channel [options]\n\n" \ @@ -50,9 +46,9 @@ typedef struct cmp { bool raw; } cmp_t; -static void show_usage(int full) +static void show_usage() { - fprintf(stdout, "%s", full ? FULL_USAGE : USAGE); + fprintf(stdout, "%s", FULL_USAGE); } static int read_adc_sample_sysfs(cmp_t *cmp, long int *val) @@ -340,7 +336,7 @@ int main(int argc, char **argv) struct iio_event_data event; if (argc <= 3) { - show_usage(0); + show_usage(); return EXIT_FAILURE; } @@ -377,10 +373,10 @@ int main(int argc, char **argv) cmp.raw = false; break; case '?': - show_usage(1); + show_usage(); return EXIT_SUCCESS; default: - show_usage(0); + show_usage(); return EXIT_FAILURE; } } From 1872ef5f063e82170820360557f61e4327515900 Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Thu, 8 Jun 2017 22:29:02 +0200 Subject: [PATCH 45/95] dey-examples: adc_cmp_sample: remove sample_rate argument This argument now is only valid for the behavior of the comparator in sleep mode, so it no longer makes sense in this application. Signed-off-by: Sebastian Pastor --- .../files/adc_cmp_sample/adc_cmp_sample.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c index fa3e2073c..bf83f2ec2 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c @@ -35,7 +35,6 @@ " -h : Threshold_high higher limit of the comparator window\n" \ " -l : Threshold_low lower limit of the comparator window\n" \ " -e : edges enabled: 'rising', 'falling' or 'both'\n" \ - " -s : sample_rate how often to sample the input, in 100 ms units.\n"\ " -v : use V for output and thresholds instead of raw values.\n"\ " -? : help\n\n" @@ -264,7 +263,7 @@ exit: } static int configure_comparator(cmp_t *cmp, uint16_t th_l, uint16_t th_h, - uint16_t srate, char *edge) + char *edge) { char *path; char buffer[BUFFER_LEN]; @@ -296,11 +295,6 @@ static int configure_comparator(cmp_t *cmp, uint16_t th_l, uint16_t th_h, if (ret < 0) goto exit; - /* Configure Sample rate */ - sprintf(path, "%s/in_voltage%u_cmp_rate", - cmp->sysfs_dir, cmp->channel); - sprintf(buffer, "%d", srate); - ret = write_in_path(path, buffer); if (ret < 0) goto exit; @@ -326,7 +320,6 @@ int main(int argc, char **argv) char *chrdev_path = NULL; char *edge = NULL; int dev_num; - unsigned int sample_rate = 1; double threshold_low = 0; double threshold_high = 0xFFFF; cmp_t cmp = { @@ -340,7 +333,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - while ((opt = getopt(argc, argv, "c:h:l:s:e:v?")) > 0) { + while ((opt = getopt(argc, argv, "c:h:l:e:v?")) > 0) { switch (opt) { case 'c': cmp.channel = strtoul(optarg, NULL, 10); @@ -351,9 +344,6 @@ int main(int argc, char **argv) case 'l': threshold_low = atof(optarg); break; - case 's': - sample_rate = strtoul(optarg, NULL, 10); - break; case 'e': if (!strcmp(optarg, "rising") && !strcmp(optarg, "falling") && @@ -420,8 +410,7 @@ int main(int argc, char **argv) threshold_low = threshold_low * 1000 / cmp.voltage_scale; } - ret = configure_comparator(&cmp, threshold_low, threshold_high, - sample_rate, edge); + ret = configure_comparator(&cmp, threshold_low, threshold_high, edge); if (ret < 0) goto exit; From b0b0becc7a12157d3d9e0a2677f3625debfb880f Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Wed, 14 Jun 2017 17:22:22 +0200 Subject: [PATCH 46/95] aws-iot-sdk: move awsiotsdk-c and awsiotsdk-demo recipes This commit moves awsiotsdk-c recipe into 'recipes-aws' and awsiotsdk-demo into 'recipes-digi/dey-examples'. https://jira.digi.com/browse/DEL-4339 Signed-off-by: Tatiana Leon --- .../awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile | 0 .../awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib | 0 .../awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template | 0 .../awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc | 0 .../awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 0 .../{awsiotsdk-c => dey-examples}/awsiotsdk-demo_git.bb | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename meta-digi-dey/{recipes-digi => recipes-aws}/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile (100%) rename meta-digi-dey/{recipes-digi => recipes-aws}/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib (100%) rename meta-digi-dey/{recipes-digi => recipes-aws}/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template (100%) rename meta-digi-dey/{recipes-digi => recipes-aws}/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc (100%) rename meta-digi-dey/{recipes-digi => recipes-aws}/awsiotsdk-c/awsiotsdk-c_2.1.1.bb (100%) rename meta-digi-dey/recipes-digi/{awsiotsdk-c => dey-examples}/awsiotsdk-demo_git.bb (100%) diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile similarity index 100% rename from meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile rename to meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib similarity index 100% rename from meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib rename to meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.lib diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template similarity index 100% rename from meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template rename to meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/aws_iot_config.h.template diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc similarity index 100% rename from meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc rename to meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/awsiotsdk.pc diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb similarity index 100% rename from meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c_2.1.1.bb rename to meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-demo_git.bb b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb similarity index 100% rename from meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-demo_git.bb rename to meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb From ab909175f080d643bd8df342e2d9504eaef77066 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 13 Jun 2017 11:13:00 +0200 Subject: [PATCH 47/95] aws-iot-sdk: remove the samples provided by Amazon We have our own AWS IoT Device SDK demo application. https://jira.digi.com/browse/DEL-4339 Signed-off-by: Tatiana Leon --- .../awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile | 12 +- .../awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 14 +- ...modify-provided-samples-to-work-in-o.patch | 149 ------------------ .../awsiotsdk-c-2.1.1/Makefile.app | 67 -------- 4 files changed, 2 insertions(+), 240 deletions(-) delete mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch delete mode 100644 meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app diff --git a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile index 94be98239..6373338b7 100644 --- a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile +++ b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile @@ -17,20 +17,10 @@ # # *************************************************************************** -SAMPLES_SUBDIR := samples/linux - -EXAMPLES := $(SAMPLES_SUBDIR)/shadow_sample \ - $(SAMPLES_SUBDIR)/shadow_sample_console_echo \ - $(SAMPLES_SUBDIR)/subscribe_publish_sample - -SUBDIRS := src $(EXAMPLES) +SUBDIRS := src all: $(SUBDIRS) -$(SAMPLES_SUBDIR)/shadow_sample: src -$(SAMPLES_SUBDIR)/shadow_sample_console_echo: src -$(SAMPLES_SUBDIR)/subscribe_publish_sample: src - .PHONY: $(SUBDIRS) $(SUBDIRS): $(MAKE) -C $@ diff --git a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb index 47d97b281..82f0caddb 100644 --- a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb +++ b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb @@ -10,11 +10,9 @@ DEPENDS = "mbedtls" SRC_URI = " \ https://github.com/aws/aws-iot-device-sdk-embedded-C/archive/v${PV}.tar.gz \ - file://0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch \ file://aws_iot_config.h.template \ file://awsiotsdk.pc \ file://Makefile \ - file://Makefile.app \ file://Makefile.lib \ " @@ -48,17 +46,9 @@ do_configure() { sed -i -e "s,##AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL##,${AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL},g" "${S}/include/aws_iot_config.h" sed -i -e "s,##AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL##,${AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL},g" "${S}/include/aws_iot_config.h" - # Remove the examples header files. - rm -f ${S}/samples/linux/shadow_sample/aws_iot_config.h - rm -f ${S}/samples/linux/shadow_sample_console_echo/aws_iot_config.h - rm -f ${S}/samples/linux/subscribe_publish_sample/aws_iot_config.h - # Copy the Makefiles. cp -f ${WORKDIR}/Makefile ${S} cp -f ${WORKDIR}/Makefile.lib ${S}/src/Makefile - cp -f ${WORKDIR}/Makefile.app ${S}/samples/linux/shadow_sample/Makefile - cp -f ${WORKDIR}/Makefile.app ${S}/samples/linux/shadow_sample_console_echo/Makefile - cp -f ${WORKDIR}/Makefile.app ${S}/samples/linux/subscribe_publish_sample/Makefile } do_install() { @@ -89,13 +79,11 @@ do_install() { install -m 0644 ${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME} ${D}${sysconfdir}/ssl/certs/ } -PACKAGES =+ "${PN}-cert ${PN}-examples" +PACKAGES =+ "${PN}-cert" FILES_${PN}-cert = "${sysconfdir}/ssl/certs/" -FILES_${PN}-examples = "${bindir}" RDEPENDS_${PN} = "${PN}-cert" -RDEPENDS_${PN}-examples = "${PN}-cert" ALLOW_EMPTY_${PN} = "1" diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch deleted file mode 100644 index 8cf616baf..000000000 --- a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/0001-aws-iot-samples-modify-provided-samples-to-work-in-o.patch +++ /dev/null @@ -1,149 +0,0 @@ -From: Tatiana Leon -Date: Wed, 3 May 2017 18:12:52 +0200 -Subject: [PATCH] aws-iot-samples: modify provided samples to work in our - platforms - -Signed-off-by: Tatiana Leon ---- - samples/linux/shadow_sample/shadow_sample.c | 20 ++++++++++---------- - .../shadow_sample_console_echo/shadow_console_echo.c | 20 ++++++++++---------- - .../subscribe_publish_sample.c | 12 ++++++------ - 3 files changed, 26 insertions(+), 26 deletions(-) - -diff --git a/samples/linux/shadow_sample/shadow_sample.c b/samples/linux/shadow_sample/shadow_sample.c -index 9a0b270..fc73a2d 100644 ---- a/samples/linux/shadow_sample/shadow_sample.c -+++ b/samples/linux/shadow_sample/shadow_sample.c -@@ -59,7 +59,7 @@ - - #define MAX_LENGTH_OF_UPDATE_JSON_BUFFER 200 - --static char certDirectory[PATH_MAX + 1] = "../../../certs"; -+static char certDirectory[PATH_MAX + 1] = ""; - static char HostAddress[255] = AWS_IOT_MQTT_HOST; - static uint32_t port = AWS_IOT_MQTT_PORT; - static uint8_t numPubs = 5; -@@ -164,27 +164,27 @@ int main(int argc, char **argv) { - char rootCA[PATH_MAX + 1]; - char clientCRT[PATH_MAX + 1]; - char clientKey[PATH_MAX + 1]; -- char CurrentWD[PATH_MAX + 1]; - - IOT_INFO("\nAWS IoT SDK Version %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG); - -- getcwd(CurrentWD, sizeof(CurrentWD)); -- snprintf(rootCA, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_ROOT_CA_FILENAME); -- snprintf(clientCRT, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_CERTIFICATE_FILENAME); -- snprintf(clientKey, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); -+ parseInputArgsForConnectParams(argc, argv); -+ -+ if (certDirectory[0] == '\0') -+ snprintf(certDirectory, PATH_MAX + 1, "%s", "/etc/ssl/certs"); -+ snprintf(rootCA, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_ROOT_CA_FILENAME); -+ snprintf(clientCRT, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_CERTIFICATE_FILENAME); -+ snprintf(clientKey, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); - - IOT_DEBUG("rootCA %s", rootCA); - IOT_DEBUG("clientCRT %s", clientCRT); - IOT_DEBUG("clientKey %s", clientKey); - -- parseInputArgsForConnectParams(argc, argv); -- - // initialize the mqtt client - AWS_IoT_Client mqttClient; - - ShadowInitParameters_t sp = ShadowInitParametersDefault; -- sp.pHost = AWS_IOT_MQTT_HOST; -- sp.port = AWS_IOT_MQTT_PORT; -+ sp.pHost = HostAddress; -+ sp.port = port; - sp.pClientCRT = clientCRT; - sp.pClientKey = clientKey; - sp.pRootCA = rootCA; -diff --git a/samples/linux/shadow_sample_console_echo/shadow_console_echo.c b/samples/linux/shadow_sample_console_echo/shadow_console_echo.c -index 1c491fb..e333094 100644 ---- a/samples/linux/shadow_sample_console_echo/shadow_console_echo.c -+++ b/samples/linux/shadow_sample_console_echo/shadow_console_echo.c -@@ -53,7 +53,7 @@ - * @note Ensure the buffer sizes in aws_iot_config.h are big enough to receive the delta message. The delta message will also contain the metadata with the timestamps - */ - --char certDirectory[PATH_MAX + 1] = "../../../certs"; -+char certDirectory[PATH_MAX + 1] = ""; - char HostAddress[255] = AWS_IOT_MQTT_HOST; - uint32_t port = AWS_IOT_MQTT_PORT; - bool messageArrivedOnDelta = false; -@@ -80,27 +80,27 @@ int main(int argc, char** argv) { - char rootCA[PATH_MAX + 1]; - char clientCRT[PATH_MAX + 1]; - char clientKey[PATH_MAX + 1]; -- char CurrentWD[PATH_MAX + 1]; - - IOT_INFO("\nAWS IoT SDK Version %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG); - -- getcwd(CurrentWD, sizeof(CurrentWD)); -- snprintf(rootCA, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_ROOT_CA_FILENAME); -- snprintf(clientCRT, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_CERTIFICATE_FILENAME); -- snprintf(clientKey, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); -+ parseInputArgsForConnectParams(argc, argv); -+ -+ if (certDirectory[0] == '\0') -+ snprintf(certDirectory, PATH_MAX + 1, "%s", "/etc/ssl/certs"); -+ snprintf(rootCA, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_ROOT_CA_FILENAME); -+ snprintf(clientCRT, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_CERTIFICATE_FILENAME); -+ snprintf(clientKey, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); - - IOT_DEBUG("rootCA %s", rootCA); - IOT_DEBUG("clientCRT %s", clientCRT); - IOT_DEBUG("clientKey %s", clientKey); - -- parseInputArgsForConnectParams(argc, argv); -- - // initialize the mqtt client - AWS_IoT_Client mqttClient; - - ShadowInitParameters_t sp = ShadowInitParametersDefault; -- sp.pHost = AWS_IOT_MQTT_HOST; -- sp.port = AWS_IOT_MQTT_PORT; -+ sp.pHost = HostAddress; -+ sp.port = port; - sp.pClientCRT = clientCRT; - sp.pClientKey = clientKey; - sp.pRootCA = rootCA; -diff --git a/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c b/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c -index 4f92645..d0fef05 100644 ---- a/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c -+++ b/samples/linux/subscribe_publish_sample/subscribe_publish_sample.c -@@ -40,7 +40,7 @@ - /** - * @brief Default cert location - */ --char certDirectory[PATH_MAX + 1] = "../../../certs"; -+char certDirectory[PATH_MAX + 1] = ""; - - /** - * @brief Default MQTT HOST URL is pulled from the aws_iot_config.h -@@ -132,7 +132,6 @@ int main(int argc, char **argv) { - char rootCA[PATH_MAX + 1]; - char clientCRT[PATH_MAX + 1]; - char clientKey[PATH_MAX + 1]; -- char CurrentWD[PATH_MAX + 1]; - char cPayload[100]; - - int32_t i = 0; -@@ -150,10 +149,11 @@ int main(int argc, char **argv) { - - IOT_INFO("\nAWS IoT SDK Version %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG); - -- getcwd(CurrentWD, sizeof(CurrentWD)); -- snprintf(rootCA, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_ROOT_CA_FILENAME); -- snprintf(clientCRT, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_CERTIFICATE_FILENAME); -- snprintf(clientKey, PATH_MAX + 1, "%s/%s/%s", CurrentWD, certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); -+ if (certDirectory[0] == '\0') -+ snprintf(certDirectory, PATH_MAX + 1, "%s", "/etc/ssl/certs"); -+ snprintf(rootCA, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_ROOT_CA_FILENAME); -+ snprintf(clientCRT, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_CERTIFICATE_FILENAME); -+ snprintf(clientKey, PATH_MAX + 1, "%s/%s", certDirectory, AWS_IOT_PRIVATE_KEY_FILENAME); - - IOT_DEBUG("rootCA %s", rootCA); - IOT_DEBUG("clientCRT %s", clientCRT); diff --git a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app b/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app deleted file mode 100644 index e8bea6506..000000000 --- a/meta-digi-dey/recipes-digi/awsiotsdk-c/awsiotsdk-c-2.1.1/Makefile.app +++ /dev/null @@ -1,67 +0,0 @@ -# *************************************************************************** -# Copyright (c) 2017 Digi International Inc. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -# PERFORMANCE OF THIS SOFTWARE. -# -# Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 -# -# *************************************************************************** -# Use GNU C Compiler. -CC ?= gcc - -# Generated Executable Name. -EXECUTABLE = $(notdir $(CURDIR)) - -# Location of Source Code. -SRC = . - -#IoT client directory. -IOT_CLIENT_DIR = ../../.. - -PLATFORM_DIR = $(IOT_CLIENT_DIR)/platform/linux/mbedtls -PLATFORM_COMMON_DIR = $(IOT_CLIENT_DIR)/platform/linux/common - -CFLAGS += -I $(SRC) -CFLAGS += -I $(IOT_CLIENT_DIR)/include -CFLAGS += -I $(IOT_CLIENT_DIR)/external_libs/jsmn -CFLAGS += -I $(PLATFORM_COMMON_DIR) -CFLAGS += -I $(PLATFORM_DIR) -CFLAGS += -Wall -g -CFLAGS += $(LOG_FLAGS) - -# Libraries to Link -LIBS += $(shell PKG_CONFIG_PATH=../../..:$${PKG_CONFIG_PATH} pkg-config --libs --static awsiotsdk) - -# Linking Flags. -LDFLAGS += -L$(IOT_CLIENT_DIR)/src $(DFLAGS) - -# Target output to generate. -SRCS = $(wildcard $(SRC)/*.c) - -OBJS = $(SRCS:.c=.o) - -.PHONY: all -all: $(EXECUTABLE) - -$(EXECUTABLE): $(OBJS) - $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ - -.PHONY: install -install: $(EXECUTABLE) - install -d $(DESTDIR)/usr/bin - install -m 0755 $< $(DESTDIR)/usr/bin/ - -.PHONY: clean -clean: - rm -f $(EXECUTABLE) $(OBJS) - From 78843e5cba0ee617b2582b06973b6fae5f15d5cb Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 13 Jun 2017 11:19:54 +0200 Subject: [PATCH 48/95] aws-iot-sdk: remove certificates dependency Only copy the certificates to the image if they are provided and exists. https://jira.digi.com/browse/DEL-4339 Signed-off-by: Tatiana Leon --- .../awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 35 ++++--------------- .../dey-examples/awsiotsdk-demo_git.bb | 2 -- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb index 82f0caddb..ed73c4ac6 100644 --- a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb +++ b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb @@ -54,36 +54,15 @@ do_configure() { do_install() { oe_runmake DESTDIR=${D} install - # Check if certificate variables are defined and files exist. - if [ -z "${AWS_IOT_CERTS_DIR}" ]; then - bberror "Undefined variable AWS_IOT_CERTS_DIR. Define it in your project 'local.conf'." - return -1 - elif [ ! -d "${AWS_IOT_CERTS_DIR}" ]; then - bberror "Unable to find defined AWS_IOT_CERTS_DIR ('${AWS_IOT_CERTS_DIR}')." - return -1 - elif [ ! -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ]; then - bberror "Unable to find defined AWS_IOT_ROOT_CA_FILENAME ('${AWS_IOT_ROOT_CA_FILENAME}') in '${AWS_IOT_CERTS_DIR}'." - return -1 - elif [ ! -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ]; then - bberror "Unable to find defined AWS_IOT_CERTIFICATE_FILENAME ('${AWS_IOT_CERTIFICATE_FILENAME}') in '${AWS_IOT_CERTS_DIR}'." - return -1 - elif [ ! -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ]; then - bberror "Unable to find defined AWS_IOT_PRIVATE_KEY_FILENAME ('${AWS_IOT_PRIVATE_KEY_FILENAME}') in '${AWS_IOT_CERTS_DIR}'." - return -1 + # Install certificates only if they exist. + if [ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ] && \ + [ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ] && \ + [ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ]; then + install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ${D}${sysconfdir}/ssl/certs/ + install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ${D}${sysconfdir}/ssl/certs/ + install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ${D}${sysconfdir}/ssl/certs/ fi - - # Install certificates. - install -d ${D}${sysconfdir}/ssl/certs - install -m 0644 ${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME} ${D}${sysconfdir}/ssl/certs/ - install -m 0644 ${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME} ${D}${sysconfdir}/ssl/certs/ - install -m 0644 ${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME} ${D}${sysconfdir}/ssl/certs/ } -PACKAGES =+ "${PN}-cert" - -FILES_${PN}-cert = "${sysconfdir}/ssl/certs/" - -RDEPENDS_${PN} = "${PN}-cert" - ALLOW_EMPTY_${PN} = "1" diff --git a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb index 156f6eed8..16674b4e0 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb @@ -45,7 +45,5 @@ do_install() { oe_runmake DESTDIR=${D} install } -RDEPENDS_${PN} = "awsiotsdk-c-cert" - PACKAGE_ARCH = "${MACHINE_ARCH}" From 0e93ab73d5e8f9433efcf35ef4679aaf0ed6ba37 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Tue, 13 Jun 2017 11:02:02 +0200 Subject: [PATCH 49/95] awsiotsdk-demo: use ISC license for AWS IoT device SDK demo Signed-off-by: Tatiana Leon --- meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb index 16674b4e0..e1707a96d 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb @@ -3,8 +3,8 @@ SUMMARY = "AWS IoT device SDK Demo" DESCRIPTION = "Demo application for AWS IoT device SDK" SECTION = "base" -LICENSE = "MPL-2.0" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d" DEPENDS = "awsiotsdk-c confuse" From e6f072384d1362a33cada63b085528b384182854 Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Tue, 13 Jun 2017 22:35:10 +0200 Subject: [PATCH 50/95] dey-examples: tamper: check tamper_events before waiting for events If the event is already signaled, read the timestamp, log and ack the event, perform actions and exit. If it is already acknowledged, then do nothing. Signed-off-by: Sebastian Pastor --- .../files/tamper_sample/tamper_sample.c | 62 ++++++++++++++++--- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c index d63f9df7e..834ed4895 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/tamper_sample/tamper_sample.c @@ -86,11 +86,10 @@ static void tamper_event_actions(mca_tamper_t *tdata) static void tamper_event_ack(mca_tamper_t *tdata) { int ret; - char *tamper_sysfs_dir; + char tamper_sysfs_dir[sizeof("/sys/bus/iio/devices/iio:deviceX")]; - ret = asprintf(&tamper_sysfs_dir, - "/sys/bus/iio/devices/iio:device%d", - tdata->dev_num); + ret = sprintf(tamper_sysfs_dir, + "/sys/bus/iio/devices/iio:device%d", tdata->dev_num); if (ret < 0) { fprintf(stdout, "Failed to build event ack file name\n"); return; @@ -98,15 +97,14 @@ static void tamper_event_ack(mca_tamper_t *tdata) /* Finally, acknowledge the event */ ret = write_sysfs_string("tamper_events", tamper_sysfs_dir, "ack"); - if (ret < 0) { + if (ret < 0) fprintf(stdout, "Failed to acknowledge tamper%d event\n", tdata->iface); - } } -static void process_tamper_event(mca_tamper_t *tdata) +static void process_tamper_event(mca_tamper_t *tdata, bool check_event) { - if (!event_is_tamper(&tdata->event)) { + if (check_event && !event_is_tamper(&tdata->event)) { fprintf(stdout, "Unknown event: time: %lld, id: %llx\n", tdata->event.timestamp, tdata->event.id); return; @@ -117,6 +115,48 @@ static void process_tamper_event(mca_tamper_t *tdata) tamper_event_ack(tdata); } +static int check_tamper_event(mca_tamper_t *tdata) +{ + int ret; + char tamper_sysfs_dir[sizeof("/sys/bus/iio/devices/iio:deviceX")]; + char str[50]; + + ret = sprintf(tamper_sysfs_dir, + "/sys/bus/iio/devices/iio:device%d", tdata->dev_num); + if (ret < 0) { + fprintf(stdout, "Failed to build event file name\n"); + return -1; + } + + ret = read_sysfs_string("tamper_events", tamper_sysfs_dir, str); + if (ret < 0) { + fprintf(stdout, "Failed to read tamper%d event\n", + tdata->iface); + return -1; + } + + if (!strncmp(str, "none", strlen("none"))) { + /* Continue to wait for tamper event to happen */ + return 0; + } else if (!strncmp(str, "signaled+acked", strlen("signaled+acked"))) { + fprintf(stdout, "Tamper event already acknowledged, not taking actions\n"); + return 1; + } else if (!strncmp(str, "signaled", strlen("signaled"))) { + tdata->event.timestamp = read_sysfs_posint("timestamp", + tamper_sysfs_dir); + if (tdata->event.timestamp < 0) + fprintf(stdout, "Failed to read timestamp for tamper%d!\n", + tdata->iface); + + fprintf(stdout, "Tamper event was already signaled.\n"); + process_tamper_event(tdata, false); + return 1; + } + + fprintf(stdout, "Unkown status for tamper%d: '%s'\n", tdata->iface, str); + return -1; +} + int main(int argc, char **argv) { mca_tamper_t *tdata = &tamper_data; @@ -169,6 +209,10 @@ int main(int argc, char **argv) goto error_ret2; } + ret = check_tamper_event(tdata); + if (ret) + goto error_ret3; + fd = open(tdata->chrdev_name, 0); if (fd < 0) { fprintf(stdout, "Failed to open %s\n", tdata->chrdev_name); @@ -201,7 +245,7 @@ int main(int argc, char **argv) } } - process_tamper_event(tdata); + process_tamper_event(tdata, true); } close(tdata->event_fd); From 84f63905ac9481faf8fc8793a8d8342fa164c923 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 15 Jun 2017 12:51:38 +0200 Subject: [PATCH 51/95] aws-iot-sdk: minor fixes * Create the certificates directory before copying files into it. * Give the downloaded tarball a meaningful name (otherwise tarballs downloaded from GitHub don't have a proper name (only the version) and may collide with other packages with the same version. * Allow to create certs package if certs are available at build time. Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 7 ++++++- .../recipes-digi/dey-examples/awsiotsdk-demo_git.bb | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb index ed73c4ac6..b651683e3 100644 --- a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb +++ b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb @@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=acc7a1bf87c055789657b148939e4b40" DEPENDS = "mbedtls" SRC_URI = " \ - https://github.com/aws/aws-iot-device-sdk-embedded-C/archive/v${PV}.tar.gz \ + https://github.com/aws/aws-iot-device-sdk-embedded-C/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \ file://aws_iot_config.h.template \ file://awsiotsdk.pc \ file://Makefile \ @@ -58,11 +58,16 @@ do_install() { if [ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ] && \ [ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ] && \ [ -f "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ]; then + install -d ${D}${sysconfdir}/ssl/certs install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_ROOT_CA_FILENAME}" ${D}${sysconfdir}/ssl/certs/ install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_CERTIFICATE_FILENAME}" ${D}${sysconfdir}/ssl/certs/ install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_IOT_PRIVATE_KEY_FILENAME}" ${D}${sysconfdir}/ssl/certs/ fi } +PACKAGES =+ "${PN}-cert" + +FILES_${PN}-cert = "${sysconfdir}/ssl/certs/" + ALLOW_EMPTY_${PN} = "1" diff --git a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb index e1707a96d..5d339e33e 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb @@ -45,5 +45,7 @@ do_install() { oe_runmake DESTDIR=${D} install } +RRECOMMENDS_${PN} += "awsiotsdk-c-cert" + PACKAGE_ARCH = "${MACHINE_ARCH}" From 91698844c065a59a77b1c506267e8aa22066480c Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 15 Jun 2017 12:53:39 +0200 Subject: [PATCH 52/95] dey-image-aws: new image including Amazon Web Services https://jira.digi.com/browse/DEL-4304 Signed-off-by: Javier Viguera --- .../recipes-core/images/dey-image-aws.bb | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meta-digi-dey/recipes-core/images/dey-image-aws.bb diff --git a/meta-digi-dey/recipes-core/images/dey-image-aws.bb b/meta-digi-dey/recipes-core/images/dey-image-aws.bb new file mode 100644 index 000000000..088863a28 --- /dev/null +++ b/meta-digi-dey/recipes-core/images/dey-image-aws.bb @@ -0,0 +1,34 @@ +# Copyright (C) 2017, Digi International Inc. + +DESCRIPTION = "DEY image including Amazon Web Services packages" +LICENSE = "MIT" + +AWS_PACKAGES ?= " \ + awsiotsdk-demo \ + greengrass \ +" + +IMAGE_INSTALL = " \ + packagegroup-dey-core \ + ${AWS_PACKAGES} \ + ${CORE_IMAGE_EXTRA_INSTALL} \ + ${ROOTFS_PKGMANAGE_BOOTSTRAP} \ +" + +IMAGE_FEATURES += " \ + dey-network \ + package-management \ + ssh-server-dropbear \ + ${@bb.utils.contains('MACHINE_FEATURES', 'bluetooth', 'dey-bluetooth', '', d)} \ + ${@bb.utils.contains('MACHINE_FEATURES', 'wifi', 'dey-wireless', '', d)} \ +" + +IMAGE_LINGUAS = "" + +inherit core-image +inherit dey-image + +IMAGE_ROOTFS_SIZE = "8192" + +# Do not install udev-cache +BAD_RECOMMENDATIONS += "udev-cache" From ce709e3cfc51ea0daf6a28ad37bba7373e99bd01 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Thu, 15 Jun 2017 10:01:49 +0200 Subject: [PATCH 53/95] dey-examples: upgrade spidev_test application This commit updates the spidev_test application from Linux kernel upstream at /tools/spi/spidev_test.c adding support to new features commit: 9006a7b3220e7293ef8bc1ac9bba6c54411051c1 https://jira.digi.com/browse/DEL-4358 Signed-off-by: Arturo Buzarra --- .../files/spidev_test/spidev_test.c | 331 ++++++++++++++++-- 1 file changed, 302 insertions(+), 29 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/spidev_test/spidev_test.c b/meta-digi-dey/recipes-digi/dey-examples/files/spidev_test/spidev_test.c index 44eaa3173..8c590cd11 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/spidev_test/spidev_test.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/spidev_test/spidev_test.c @@ -15,9 +15,13 @@ #include #include #include +#include #include #include +#include #include +#include +#include #include #include @@ -30,62 +34,163 @@ static void pabort(const char *s) } static const char *device = "/dev/spidev1.1"; -static uint8_t mode; +static uint32_t mode; static uint8_t bits = 8; +static char *input_file; +static char *output_file; static uint32_t speed = 500000; static uint16_t delay; +static int verbose; +static int transfer_size; +static int iterations; +static int interval = 5; /* interval in seconds for showing transfer rate */ -static void transfer(int fd) +uint8_t default_tx[] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x95, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x0D, +}; + +uint8_t default_rx[ARRAY_SIZE(default_tx)] = {0, }; +char *input_tx; + +static void hex_dump(const void *src, size_t length, size_t line_size, + char *prefix) +{ + int i = 0; + const unsigned char *address = src; + const unsigned char *line = address; + unsigned char c; + + printf("%s | ", prefix); + while (length-- > 0) { + printf("%02X ", *address++); + if (!(++i % line_size) || (length == 0 && i % line_size)) { + if (length == 0) { + while (i++ % line_size) + printf("__ "); + } + printf(" | "); /* right close */ + while (line < address) { + c = *line++; + printf("%c", (c < 33 || c == 255) ? 0x2E : c); + } + printf("\n"); + if (length > 0) + printf("%s | ", prefix); + } + } +} + +/* + * Unescape - process hexadecimal escape character + * converts shell input "\x23" -> 0x23 + */ +static int unescape(char *_dst, char *_src, size_t len) +{ + int ret = 0; + int match; + char *src = _src; + char *dst = _dst; + unsigned int ch; + + while (*src) { + if (*src == '\\' && *(src+1) == 'x') { + match = sscanf(src + 2, "%2x", &ch); + if (!match) + pabort("malformed input string"); + + src += 4; + *dst++ = (unsigned char)ch; + } else { + *dst++ = *src++; + } + ret++; + } + return ret; +} + +static void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len) { int ret; - uint8_t tx[] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x95, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD, - 0xF0, 0x0D, - }; - uint8_t rx[ARRAY_SIZE(tx)] = {0, }; + int out_fd; struct spi_ioc_transfer tr = { .tx_buf = (unsigned long)tx, .rx_buf = (unsigned long)rx, - .len = ARRAY_SIZE(tx), + .len = len, .delay_usecs = delay, .speed_hz = speed, .bits_per_word = bits, }; + if (mode & SPI_TX_QUAD) + tr.tx_nbits = 4; + else if (mode & SPI_TX_DUAL) + tr.tx_nbits = 2; + if (mode & SPI_RX_QUAD) + tr.rx_nbits = 4; + else if (mode & SPI_RX_DUAL) + tr.rx_nbits = 2; + if (!(mode & SPI_LOOP)) { + if (mode & (SPI_TX_QUAD | SPI_TX_DUAL)) + tr.rx_buf = 0; + else if (mode & (SPI_RX_QUAD | SPI_RX_DUAL)) + tr.tx_buf = 0; + } + ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr); - if (ret < 0) + if (ret < 1) pabort("can't send spi message"); - for (ret = 0; ret < ARRAY_SIZE(tx); ret++) { - if (!(ret % 6)) - puts(""); - printf("%.2X ", rx[ret]); + if (verbose) + hex_dump(tx, len, 32, "TX"); + + if (output_file) { + out_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (out_fd < 0) + pabort("could not open output file"); + + ret = write(out_fd, rx, len); + if (ret != len) + pabort("not all bytes written to output file"); + + close(out_fd); } - puts(""); + + if (verbose) + hex_dump(rx, len, 32, "RX"); } -void print_usage(const char *prog) +static void print_usage(const char *prog) { - printf("Usage: %s [-DsbdlHOLC3]\n", prog); + printf("Usage: %s [-DsbdlHOLC3vpNR24SI]\n", prog); puts(" -D --device device to use (default /dev/spidev1.1)\n" " -s --speed max speed (Hz)\n" " -d --delay delay (usec)\n" - " -b --bpw bits per word \n" + " -b --bpw bits per word\n" + " -i --input input data from a file (e.g. \"test.bin\")\n" + " -o --output output data to a file (e.g. \"results.bin\")\n" " -l --loop loopback\n" " -H --cpha clock phase\n" " -O --cpol clock polarity\n" " -L --lsb least significant bit first\n" " -C --cs-high chip select active high\n" - " -3 --3wire SI/SO signals shared\n"); + " -3 --3wire SI/SO signals shared\n" + " -v --verbose Verbose (show tx buffer)\n" + " -p Send data (e.g. \"1234\\xde\\xad\")\n" + " -N --no-cs no chip select\n" + " -R --ready slave pulls low to pause\n" + " -2 --dual dual transfer\n" + " -4 --quad quad transfer\n" + " -S --size transfer size\n" + " -I --iter iterations\n"); exit(1); } -void parse_opts(int argc, char *argv[]) +static void parse_opts(int argc, char *argv[]) { while (1) { static const struct option lopts[] = { @@ -93,6 +198,8 @@ void parse_opts(int argc, char *argv[]) { "speed", 1, 0, 's' }, { "delay", 1, 0, 'd' }, { "bpw", 1, 0, 'b' }, + { "input", 1, 0, 'i' }, + { "output", 1, 0, 'o' }, { "loop", 0, 0, 'l' }, { "cpha", 0, 0, 'H' }, { "cpol", 0, 0, 'O' }, @@ -101,11 +208,17 @@ void parse_opts(int argc, char *argv[]) { "3wire", 0, 0, '3' }, { "no-cs", 0, 0, 'N' }, { "ready", 0, 0, 'R' }, + { "dual", 0, 0, '2' }, + { "verbose", 0, 0, 'v' }, + { "quad", 0, 0, '4' }, + { "size", 1, 0, 'S' }, + { "iter", 1, 0, 'I' }, { NULL, 0, 0, 0 }, }; int c; - c = getopt_long(argc, argv, "D:s:d:b:lHOLC3NR", lopts, NULL); + c = getopt_long(argc, argv, "D:s:d:b:i:o:lHOLC3NR24p:vS:I:", + lopts, NULL); if (c == -1) break; @@ -123,6 +236,12 @@ void parse_opts(int argc, char *argv[]) case 'b': bits = atoi(optarg); break; + case 'i': + input_file = optarg; + break; + case 'o': + output_file = optarg; + break; case 'l': mode |= SPI_LOOP; break; @@ -144,14 +263,142 @@ void parse_opts(int argc, char *argv[]) case 'N': mode |= SPI_NO_CS; break; + case 'v': + verbose = 1; + break; case 'R': mode |= SPI_READY; break; + case 'p': + input_tx = optarg; + break; + case '2': + mode |= SPI_TX_DUAL; + break; + case '4': + mode |= SPI_TX_QUAD; + break; + case 'S': + transfer_size = atoi(optarg); + break; + case 'I': + iterations = atoi(optarg); + break; default: print_usage(argv[0]); break; } } + if (mode & SPI_LOOP) { + if (mode & SPI_TX_DUAL) + mode |= SPI_RX_DUAL; + if (mode & SPI_TX_QUAD) + mode |= SPI_RX_QUAD; + } +} + +static void transfer_escaped_string(int fd, char *str) +{ + size_t size = strlen(str); + uint8_t *tx; + uint8_t *rx; + + tx = malloc(size); + if (!tx) + pabort("can't allocate tx buffer"); + + rx = malloc(size); + if (!rx) + pabort("can't allocate rx buffer"); + + size = unescape((char *)tx, str, size); + transfer(fd, tx, rx, size); + free(rx); + free(tx); +} + +static void transfer_file(int fd, char *filename) +{ + ssize_t bytes; + struct stat sb; + int tx_fd; + uint8_t *tx; + uint8_t *rx; + + if (stat(filename, &sb) == -1) + pabort("can't stat input file"); + + tx_fd = open(filename, O_RDONLY); + if (tx_fd < 0) + pabort("can't open input file"); + + tx = malloc(sb.st_size); + if (!tx) + pabort("can't allocate tx buffer"); + + rx = malloc(sb.st_size); + if (!rx) + pabort("can't allocate rx buffer"); + + bytes = read(tx_fd, tx, sb.st_size); + if (bytes != sb.st_size) + pabort("failed to read input file"); + + transfer(fd, tx, rx, sb.st_size); + free(rx); + free(tx); + close(tx_fd); +} + +static uint64_t _read_count; +static uint64_t _write_count; + +static void show_transfer_rate(void) +{ + static uint64_t prev_read_count, prev_write_count; + double rx_rate, tx_rate; + + rx_rate = ((_read_count - prev_read_count) * 8) / (interval*1000.0); + tx_rate = ((_write_count - prev_write_count) * 8) / (interval*1000.0); + + printf("rate: tx %.1fkbps, rx %.1fkbps\n", rx_rate, tx_rate); + + prev_read_count = _read_count; + prev_write_count = _write_count; +} + +static void transfer_buf(int fd, int len) +{ + uint8_t *tx; + uint8_t *rx; + int i; + + tx = malloc(len); + if (!tx) + pabort("can't allocate tx buffer"); + for (i = 0; i < len; i++) + tx[i] = random(); + + rx = malloc(len); + if (!rx) + pabort("can't allocate rx buffer"); + + transfer(fd, tx, rx, len); + + _write_count += len; + _read_count += len; + + if (mode & SPI_LOOP) { + if (memcmp(tx, rx, len)) { + fprintf(stderr, "transfer error !\n"); + hex_dump(tx, len, 32, "TX"); + hex_dump(rx, len, 32, "RX"); + exit(1); + } + } + + free(rx); + free(tx); } int main(int argc, char *argv[]) @@ -168,11 +415,11 @@ int main(int argc, char *argv[]) /* * spi mode */ - ret = ioctl(fd, SPI_IOC_WR_MODE, &mode); + ret = ioctl(fd, SPI_IOC_WR_MODE32, &mode); if (ret == -1) pabort("can't set spi mode"); - ret = ioctl(fd, SPI_IOC_RD_MODE, &mode); + ret = ioctl(fd, SPI_IOC_RD_MODE32, &mode); if (ret == -1) pabort("can't get spi mode"); @@ -198,11 +445,37 @@ int main(int argc, char *argv[]) if (ret == -1) pabort("can't get max speed hz"); - printf("spi mode: %d\n", mode); + printf("spi mode: 0x%x\n", mode); printf("bits per word: %d\n", bits); printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000); - transfer(fd); + if (input_tx && input_file) + pabort("only one of -p and --input may be selected"); + + if (input_tx) + transfer_escaped_string(fd, input_tx); + else if (input_file) + transfer_file(fd, input_file); + else if (transfer_size) { + struct timespec last_stat; + + clock_gettime(CLOCK_MONOTONIC, &last_stat); + + while (iterations-- > 0) { + struct timespec current; + + transfer_buf(fd, transfer_size); + + clock_gettime(CLOCK_MONOTONIC, ¤t); + if (current.tv_sec - last_stat.tv_sec > interval) { + show_transfer_rate(); + last_stat = current; + } + } + printf("total: tx %.1fKB, rx %.1fKB\n", + _write_count/1024.0, _read_count/1024.0); + } else + transfer(fd, default_tx, default_rx, sizeof(default_tx)); close(fd); From 3d4f6dffd0e693211637f749ba737d92abfe51ab Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 14 Jun 2017 09:21:05 +0200 Subject: [PATCH 54/95] digi-defaults.inc: add kernel v4.1 for CC6 in comment Signed-off-by: Hector Palacios --- meta-digi-arm/conf/machine/include/digi-defaults.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index 4decd8251..1780c8ec7 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -11,7 +11,7 @@ PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg" # Platform Linux U-Boot # ------------------------------------------------- # ccardimx28 3.10 2013.01 -# ccimx6 3.14 2015.04 +# ccimx6 4.1, 3.14 2015.04 # ccimx6ul 4.1 2015.04 # From 5126a6049b304726cd7b51cda40f7234094c4b0d Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 8 Jun 2017 13:56:33 +0200 Subject: [PATCH 55/95] u-boot-fw-utils: dynamically create fw_env.config for NAND-based platforms A mechanism was introduced in U-Boot to dynamically locate the environment copies within a NAND partition, skipping bad blocks and making full use of the partition blocks. To trigger this mechanism in Linux tools (fw_printenv/fw_setenv) the configuration file /etc/fw_env.config must have both copies entries pointing to the same offset. This commit substitutes the hardcoded configuration file for CC6UL with a stub and generates one on an RPM post-script basing on: - Supplied DEY variables (with default values per platform): - UBOOT_ENV_OFFSET: starting offset of the environment within the partition. - UBOOT_ENV_SIZE: size of each copy of the environment. - UBOOT_ENV_RANGE: size in the partition that the environment copies may occupy, starting from UBOOT_ENV_OFFSET. If undefined, the whole partition is used. - Calculated values: - NAND Erase block size - Number of blocks available for the environment copies Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-4256 --- meta-digi-arm/conf/machine/ccimx6ulsbc.conf | 9 ++++ .../conf/machine/ccimx6ulstarter.conf | 9 ++++ .../u-boot-fw-utils/ccimx6ul/fw_env.config | 8 ++-- .../u-boot/u-boot-fw-utils_%.bbappend | 43 ++++++++++++++++++- 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/meta-digi-arm/conf/machine/ccimx6ulsbc.conf b/meta-digi-arm/conf/machine/ccimx6ulsbc.conf index 224813415..33664cb87 100644 --- a/meta-digi-arm/conf/machine/ccimx6ulsbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6ulsbc.conf @@ -11,6 +11,15 @@ UBOOT_CONFIG ??= "ccimx6ulsbc1GB ccimx6ulsbc" UBOOT_CONFIG[ccimx6ulsbc1GB] = "ccimx6ulsbc1GB_defconfig" UBOOT_CONFIG[ccimx6ulsbc] = "ccimx6ulsbc_defconfig" +# U-Boot environment offset (within partition) +UBOOT_ENV_OFFSET ?= "0x0" +# U-Boot environment size +UBOOT_ENV_SIZE ?= "0x20000" +# U-Boot environment range: size (in hex) in the environment partition that +# the U-Boot environment can take up (if undefined, it will take up all the +# available space in the environment partition) +UBOOT_ENV_RANGE ?= "" + KERNEL_DEVICETREE ?= " \ imx6ul-ccimx6ulsbc.dtb \ imx6ul-ccimx6ulsbc-wb.dtb \ diff --git a/meta-digi-arm/conf/machine/ccimx6ulstarter.conf b/meta-digi-arm/conf/machine/ccimx6ulstarter.conf index 317b38ee5..f7b95048b 100644 --- a/meta-digi-arm/conf/machine/ccimx6ulstarter.conf +++ b/meta-digi-arm/conf/machine/ccimx6ulstarter.conf @@ -11,6 +11,15 @@ UBOOT_CONFIG ??= "ccimx6ulstarter1GB ccimx6ulstarter" UBOOT_CONFIG[ccimx6ulstarter1GB] = "ccimx6ulstarter1GB_defconfig" UBOOT_CONFIG[ccimx6ulstarter] = "ccimx6ulstarter_defconfig" +# U-Boot environment offset (within partition) +UBOOT_ENV_OFFSET ?= "0x0" +# U-Boot environment size +UBOOT_ENV_SIZE ?= "0x20000" +# U-Boot environment range: size (in hex) in the environment partition that +# the U-Boot environment can take up (if undefined, it will take up all the +# available space in the environment partition) +UBOOT_ENV_RANGE ?= "" + KERNEL_DEVICETREE ?= " \ imx6ul-ccimx6ulstarter.dtb \ imx6ul-ccimx6ulstarter-wb.dtb \ diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/ccimx6ul/fw_env.config b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/ccimx6ul/fw_env.config index be29acc2f..e31ceca4d 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/ccimx6ul/fw_env.config +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/ccimx6ul/fw_env.config @@ -1,7 +1,9 @@ # Configuration file for fw_(printenv/setenv) utility. # Up to two entries are valid, in this case the redundant # environment sector is assumed present. +# If both copies are set to the same offset, an automatic mechanism will +# determine the first good sectors where each copy lives, skipping bad blocks. -# Device name Offset Size -/dev/mtd1 0x0 0x20000 -/dev/mtd1 0x20000 0x20000 +# Device name Offset Size Erase-size No.Blocks +/dev/##MTDINDEX## ##ENV_OFFSET## ##ENV_SIZE## ##ERASEBLOCK## ##NBLOCKS## +/dev/##MTDINDEX## ##ENV_REDUND_OFFSET## ##ENV_SIZE## ##ERASEBLOCK## ##NBLOCKS## diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend index 0f5236f84..547138192 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend @@ -41,9 +41,50 @@ pkg_postinst_${PN}() { if [ x"$D" != "x" ]; then exit 1 fi + CONFIG_FILE="/etc/fw_env.config" MMCDEV="$(sed -ne 's,.*root=/dev/mmcblk\([0-9]\)p.*,\1,g;T;p' /proc/cmdline)" if [ -n "${MMCDEV}" ]; then - sed -i -e "s,^/dev/mmcblk[^[:blank:]]\+,/dev/mmcblk${MMCDEV},g" /etc/fw_env.config + sed -i -e "s,^/dev/mmcblk[^[:blank:]]\+,/dev/mmcblk${MMCDEV},g" ${CONFIG_FILE} + fi + + PARTTABLE="/proc/mtd" + MTDINDEX="$(sed -ne "s/\(^mtd[0-9]\+\):.*\.*/\1/g;T;p" ${PARTTABLE} 2>/dev/null)" + if [ -n "${MTDINDEX}" ]; then + # Initialize variables for fixed offset values + # (backwards compatible with old U-Boot) + ENV_OFFSET="${UBOOT_ENV_OFFSET}" + ENV_REDUND_OFFSET="${UBOOT_ENV_SIZE}" + ENV_SIZE="${UBOOT_ENV_SIZE}" + ERASEBLOCK="" + NBLOCKS="" + + if [ -f "/proc/device-tree/digi,uboot,dynamic-env" ]; then + # Update variables for dynamic environment + # - Both copies starting at the same offset + ENV_REDUND_OFFSET="${UBOOT_ENV_OFFSET}" + # - Calculated erase block size + ERASEBLOCK="$(grep "^${MTDINDEX}" ${PARTTABLE} | awk '{printf("0x%d",$3)}')" + # - Calculated number of blocks + MTDSIZE="$(grep "^${MTDINDEX}" ${PARTTABLE} | awk '{printf("0x%d",$2)}')" + NBLOCKS="$(((MTDSIZE - UBOOT_ENV_OFFSET) / ERASEBLOCK))" + # If a range was provided, calculate the number of + # blocks in the range and use that number, unless they + # exceed the total number of blocks available in the + # whole partition. + if [ -n "${UBOOT_ENV_RANGE}" ]; then + RANGE_BLOCKS="$((UBOOT_ENV_RANGE / ERASEBLOCK))" + [ "${RANGE_BLOCKS}" -lt "${NBLOCKS}" ] && NBLOCKS="${RANGE_BLOCKS}" + fi + fi + + # Substitute stub with configuration and calculated values + sed -i -e "s/##MTDINDEX##/${MTDINDEX}/g" \ + -e "s/##ENV_OFFSET##/${ENV_OFFSET}/g" \ + -e "s/##ENV_REDUND_OFFSET##/${ENV_REDUND_OFFSET}/g" \ + -e "s/##ENV_SIZE##/${ENV_SIZE}/g" \ + -e "s/##ERASEBLOCK##/${ERASEBLOCK}/g" \ + -e "s/##NBLOCKS##/${NBLOCKS}/g" \ + ${CONFIG_FILE} fi } From 459116583258a3a64f086e7780ccf43bb34b1fff Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 19 Jun 2017 15:57:58 +0200 Subject: [PATCH 56/95] memwatch: [cosmetic] print new line after printing 16 bytes The fix in 0ae172613ab52a20a0316ac3f6a21517fce5287b wrongly printed a new line after each value, wich resulted in the following output for a command like this, that reads two 32-bit words: root@ccimx6ulsbc:~# memwatch -r -l 8 -w -a 0x2008008 0x02008008: 0x0070e501 0x00000100 Instead, it should print a line feed after every 16 bytes. Signed-off-by: Hector Palacios --- meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c b/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c index 890b2800b..f532a3407 100644 --- a/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c +++ b/meta-digi-dey/recipes-digi/memwatch/memwatch/memwatch.c @@ -243,10 +243,11 @@ int main( int argc, char** argv ) } if( ( verbose < VERB_PRNT_ADDR ) && ( j % 16 == 0 ) ) { + if (j > 0) + printf("\n"); printf( "0x%08lx: ", address + j ); } print_hex_formated( rd_val, access ); - printf("\n"); } else { if( filename != NULL ) { if( ( ret = read( fd_file, &wr_val, access ) ) != access ) { @@ -263,6 +264,7 @@ int main( int argc, char** argv ) } virt_addr += access; } + printf("\n"); if( munmap( map_base, MAP_SIZE ) == -1 ) { fprintf( stderr, "Error unmapping memory\n" ); From 14a7d127f02aed34d13b409c7227c92b8d66bb74 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Mon, 29 May 2017 11:26:26 +0200 Subject: [PATCH 57/95] meta-digi-arm: Remove worldwide board data file. https://jira.digi.com/browse/DEL-4291 Signed-off-by: Alex Gonzalez --- .../firmware-qualcomm/firmware-qualcomm.bb | 2 -- .../firmware-qualcomm/bdwlan30_World.bin | Bin 8124 -> 0 bytes .../kernel-module-qualcomm/qualcomm-pre-up | 9 +++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/bdwlan30_World.bin diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb index 6bf486f38..5522fd5fe 100644 --- a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb +++ b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb @@ -14,7 +14,6 @@ FW_QCA6564-BT = " \ FW_QCA6564-WIFI = " \ file://bdwlan30_US.bin \ - file://bdwlan30_World.bin \ file://LICENCE.atheros_firmware \ file://otp30.bin \ file://qwlan30.bin \ @@ -42,7 +41,6 @@ do_install() { install -d ${D}${base_libdir}/firmware install -m 0644 \ bdwlan30_US.bin \ - bdwlan30_World.bin \ LICENCE.atheros_firmware \ otp30.bin \ qwlan30.bin \ diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/bdwlan30_World.bin b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/bdwlan30_World.bin deleted file mode 100644 index 65f13b87e849d341f50e13b29bb34c3f891480f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8124 zcmeHM3s6&M7QP_@NqB@nNOB>UaMfn zOs8Ev%(>^k|M#8mob%r#kl|fH;WvI1h&pP9D2)&Vse8diC}cyB0P+J%3WY_@0P#N= zpD&_Npgg%;{>|543tM6WAjr?};zh-;{TRL!s&7F?f*`6Z%|@MqyxG{kp?R$d3WQe4 zYtNG#q)~Gye!^TTS=?s?v^`@zxB*Im{2t%#ipX@|XJk+z%#RMe@(LXa13#n%LJ$i9 z@!q|AqYpcYfkAziKq}n2<-7e~BZER_Oia-3*B3%Uw@8q;{_+>o>W7^K@7J$^-1TqY zcBlL(E~3!@+U!NLmAiMztA?#-pJ0E)zQW!Sc{=h!z8T;+i6MdFK9Cg_3N5;AU5a$72vQJHH zwrFvIMnZ5}m?A>M)gxwc4N@p6k*;yiyUDu6J@0ftNC2ozmoQS8 zS>d^nx@e=Q%6%?Xs(M2!(QVyk8+Gn=O|N1EfXXycP-190OBGoFm!K7hUQ#Z#s2UCJ zM2~dj%s?(pz=#h{WoAdJdBrj1h(ThO)~T8e8;L&akZmX69i#^MhX!zH zF^sriDN`Pv&nt>4LyVG2DWPgHY$CQ=M{IkXQ?A2Qs((;GL|_zM6qFR29CW_%pyw2g=p3_5bw9kHj!S?+Q;cz~Bu?U)I-}U_k zn?0dh1?eD71~rK)rbbY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ni5h7TuGOb8q z(QGQ-Wty$NwC>ghNpy->m1xXr$g}FEjc=^^r0!~?C^}J`m1vOH=69{$V?4Fy{ko;~ z1u1w|bMCI3RWln41Sjlnxx0ahtXk;p?z>3rA6kVEK z#j~bAR9z`mc(d>3;L^y=5g{v?FPCVOD>7Phh70V5x6KPRLN*qiAyy}u(mV5Z>s~9pP;sMH z5}pEQqdKf1b4%_^g>xlWa92%yRH`TkGs@N}`ZPyMocNz>me#4`%A^fh+j3tmK5x2O zb)){;`Wr2xsAN$#Rw%1f^c7B)oW}oXxxNl%Cq-w8^Al^bI`YPKuYwv^En+xBqDeAk z)T^x8Bc;xYzglkAE5t>KRp}kdDc!G1KdHF3cB$z`^TY4?=j$KW2^cHeCr_OF@Z&*|c-(zoWoJ>K#nE9lh>Q!16a~l)qXes;pXyKN1U~k(>i$3OPoe97 E1J3n{LI3~& diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up index 89efc7e75..3c1cccdeb 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up @@ -78,8 +78,13 @@ case "${REGULATORY_DOMAIN}" in ${US_CODE}) logger -t qca6564 "Setting US wireless region";; ${WW_CODE}|${JP_CODE}) - logger -t qca6564 "Setting WW (world wide) wireless region" - BDATA_SOURCE="${FIRMWARE_DIR}/bdwlan30_World.bin";; + if [ -e "${FIRMWARE_DIR}/bdwlan30_World.bin" ]; then + logger -t qca6564 "Setting WW (world wide) wireless region" + BDATA_SOURCE="${FIRMWARE_DIR}/bdwlan30_World.bin" + else + logger -t qca6564 "[WARN] No WW (worldwide) board data file, using US" + fi + ;; "") logger -t qca6564 "[WARN] region code not found, using US";; *) From f439506eb88fa48669f0de9177d996505d25b0d8 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 22 Jun 2017 18:02:10 +0200 Subject: [PATCH 58/95] ccimx6ul/ccimx6: synchronize kernel defconfig Signed-off-by: Hector Palacios --- .../recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig | 3 +++ .../recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig | 3 +++ 2 files changed, 6 insertions(+) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig index 3f9599a91..3ffe94b7d 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6sbc/defconfig @@ -181,6 +181,9 @@ CONFIG_I2C_IMX=y CONFIG_SPI=y CONFIG_SPI_IMX=y CONFIG_SPI_SPIDEV=y +CONFIG_SPI_SLAVE=y +CONFIG_SPI_SLAVE_TIME=y +CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_DA9063=y CONFIG_POWER_SUPPLY=y diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig index f12d867c8..42dce6c8a 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig @@ -186,6 +186,9 @@ CONFIG_SPI=y CONFIG_SPI_GPIO=y CONFIG_SPI_IMX=y CONFIG_SPI_SPIDEV=y +CONFIG_SPI_SLAVE=y +CONFIG_SPI_SLAVE_TIME=y +CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_MCA_CC6UL=y CONFIG_POWER_SUPPLY=y From 4618c7620846f0ef25b43ba5a30174e54038cfb2 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Fri, 23 Jun 2017 10:43:49 +0200 Subject: [PATCH 59/95] recovery-initramfs: execute all post installation scripts In the recovery images we are using a custom init so we are not executing any post-installation that is required for a correct rootfs setup, so call all the post installation scripts from our custom init. The package installation could be ipk, rpm or deb, so call to the *postint folder. Given that the recovery rootfs is a ramdisk, there is no need to remove the post installation scripts. https://jira.digi.com/browse/DEL-4430 Signed-off-by: Isaac Hermida --- .../recovery/recovery-initramfs/recovery-initramfs-init | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 07bdf4439..5f70a0e3d 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -372,6 +372,9 @@ fi # Give some time for the devices to settle down sleep 2 +# Run all shell scripts in postinstall folder +run-parts /etc/*-postinsts + # Setup fw_printenv. mkdir -p /var/lock From 2a6c4d6e043d89ee76dd2bc25c7b1391bb4ce0ad Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Fri, 23 Jun 2017 21:17:39 +0200 Subject: [PATCH 60/95] trustfence-tool: update recipe to v2.1 Signed-off-by: Sebastian Pastor --- .../recipes-core/trustfence/trustfence-tool_2.0.bb | 12 ------------ .../recipes-core/trustfence/trustfence-tool_2.1.bb | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb create mode 100644 meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb diff --git a/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb b/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb deleted file mode 100644 index ad6b63fcb..000000000 --- a/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (C) 2016 Digi International. - -SUMMARY = "Trustfence command line tool" -SECTION = "console/tools" -LICENSE = "CLOSED" - -SRC_URI = "${DIGI_PKG_SRC}/${BP}.tar.gz" - -SRC_URI[md5sum] = "dfbe0f7a5c2d16c5abafae14eb33d592" -SRC_URI[sha256sum] = "e335fc7080fb35ad198319c06ec31c77d9d2fe63219b9adc1ffc1e686e1534ae" - -inherit bin_package diff --git a/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb b/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb new file mode 100644 index 000000000..9a7992844 --- /dev/null +++ b/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb @@ -0,0 +1,12 @@ +# Copyright (C) 2016, 2017 Digi International. + +SUMMARY = "Trustfence command line tool" +SECTION = "console/tools" +LICENSE = "CLOSED" + +SRC_URI = "${DIGI_PKG_SRC}/${BP}.tar.gz" + +SRC_URI[md5sum] = "b26c0b8a4fd819beba4d0af6b11bc603" +SRC_URI[sha256sum] = "7dc772e40e76d94ac297098c7fcfb19254994afb4c6ee30d23fb056a872e6543" + +inherit bin_package From 56b8cb8dd0fce66a5a621e68deb104a4c6385132 Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Mon, 26 Jun 2017 23:30:23 +0200 Subject: [PATCH 61/95] trustfence-tool: update recipe to v2.1 Signed-off-by: Sebastian Pastor --- meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb b/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb index 9a7992844..9db3d9c98 100644 --- a/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb +++ b/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.1.bb @@ -6,7 +6,7 @@ LICENSE = "CLOSED" SRC_URI = "${DIGI_PKG_SRC}/${BP}.tar.gz" -SRC_URI[md5sum] = "b26c0b8a4fd819beba4d0af6b11bc603" -SRC_URI[sha256sum] = "7dc772e40e76d94ac297098c7fcfb19254994afb4c6ee30d23fb056a872e6543" +SRC_URI[md5sum] = "31385122bed83d420f92efddd8975e99" +SRC_URI[sha256sum] = "e5e9157837be8e26141708e06a881ef872dd94aa06451668959845c4d4d19efc" inherit bin_package From 44df1f3a5fd5f75e34127485b3ec603a836925f8 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Thu, 22 Jun 2017 13:44:32 +0200 Subject: [PATCH 62/95] swu-images: add include file to reuse in swu update package recipes Signed-off-by: Tatiana Leon --- .../swu-images/core-image-base-swu.bb | 56 +---------------- .../swu-images/dey-image-qt-swu.bb | 56 +---------------- meta-digi-dey/recipes-digi/swu-images/swu.inc | 63 +++++++++++++++++++ 3 files changed, 66 insertions(+), 109 deletions(-) create mode 100644 meta-digi-dey/recipes-digi/swu-images/swu.inc diff --git a/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb b/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb index bd81b2b07..37082d2e9 100644 --- a/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb +++ b/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb @@ -1,57 +1,3 @@ # Copyright (C) 2016, 2017 Digi International Inc. -SUMMARY = "Generate update package for SWUpdate" -SECTION = "base" -LICENSE = "GPL-2.0" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" -SRC_URI = "file://sw-description" -SRC_URI_append_ccimx6 = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), 'file://preinstall_swu.sh', '')}" -SRC_URI_append_ccimx6ul = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '', 'file://preinstall_swu.sh')}" - -inherit swupdate - -IMAGE_DEPENDS = "core-image-base" - -SWUPDATE_IMAGES = "core-image-base" - -SOFTWARE_VERSION ?= "0.0.1" - -BOOTFS_EXT ?= ".boot.vfat" -BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" -ROOTFS_EXT ?= ".ext4" -ROOTFS_EXT_ccimx6ul ?= ".ubifs" - -BOOT_DEV_NAME ?= "/dev/mmcblk0p1" -BOOT_DEV_NAME_ccimx6ul ?= "linux" -ROOTFS_DEV_NAME ?= "/dev/mmcblk0p3" -ROOTFS_DEV_NAME_ccimx6ul ?= "rootfs" -ROOTFS_ENC_DEV = "/dev/mapper/cryptroot" -ROOTFS_ENC_DEV_ccimx6ul = "${ROOTFS_DEV_NAME}" -ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" -PREINST_SCRIPT_TEMPLATE = "scripts: ( { filename = \\"preinstall_swu.sh\\"; type = \\"preinstall\\"; sha256 = \\"@preinstall_swu.sh\\"; \\x7D );" -PREINST_SCRIPT_DESC = "" -PREINST_SCRIPT_DESC_ccimx6sbc = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${PREINST_SCRIPT_TEMPLATE}', '')}" -PREINST_SCRIPT_DESC_ccimx6ul = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '', '${PREINST_SCRIPT_TEMPLATE}')}" - -python () { - img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) - d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "core-image-base", img_fstypes) -} - -python do_swuimage_prepend() { - import glob - - if (d.getVar('TRUSTFENCE_SIGN', True) == "1"): - d.setVar('SWUPDATE_PRIVATE_KEY', glob.glob(d.getVar('SWUPDATE_PRIVATE_KEY_TEMPLATE', True))[0]) -} - -do_unpack[postfuncs] += "fill_description" - -fill_description() { - sed -i -e "s,##BOOTIMG_NAME##,core-image-base-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description" - sed -i -e "s,##BOOT_DEV##,${BOOT_DEV_NAME},g" "${WORKDIR}/sw-description" - sed -i -e "s,##ROOTIMG_NAME##,core-image-base-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" - sed -i -e "s,##ROOTFS_DEV##,${ROOTFS_DEV_NAME_FINAL},g" "${WORKDIR}/sw-description" - sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" - sed -i -e "s/##PREINSTALL_SCRIPT##/${PREINST_SCRIPT_DESC}/g" "${WORKDIR}/sw-description" -} +require swu.inc diff --git a/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb b/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb index e79e9cebb..e6c4ab755 100644 --- a/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb +++ b/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb @@ -1,57 +1,5 @@ # Copyright (C) 2016, 2017 Digi International Inc. -SUMMARY = "Generate update package for SWUpdate" -SECTION = "base" -LICENSE = "GPL-2.0" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" -SRC_URI = "file://sw-description" -SRC_URI_append_ccimx6 = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), 'file://preinstall_swu.sh', '')}" -SRC_URI_append_ccimx6ul = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '', 'file://preinstall_swu.sh')}" +require swu.inc -inherit swupdate - -IMAGE_DEPENDS = "dey-image-qt" - -SWUPDATE_IMAGES = "dey-image-qt-${GRAPHICAL_BACKEND}" - -SOFTWARE_VERSION ?= "0.0.1" - -BOOTFS_EXT ?= ".boot.vfat" -BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" -ROOTFS_EXT ?= ".ext4" -ROOTFS_EXT_ccimx6ul ?= ".ubifs" - -BOOT_DEV_NAME ?= "/dev/mmcblk0p1" -BOOT_DEV_NAME_ccimx6ul ?= "linux" -ROOTFS_DEV_NAME ?= "/dev/mmcblk0p3" -ROOTFS_DEV_NAME_ccimx6ul ?= "rootfs" -ROOTFS_ENC_DEV = "/dev/mapper/cryptroot" -ROOTFS_ENC_DEV_ccimx6ul = "${ROOTFS_DEV_NAME}" -ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" -PREINST_SCRIPT_TEMPLATE = "scripts: ( { filename = \\"preinstall_swu.sh\\"; type = \\"preinstall\\"; sha256 = \\"@preinstall_swu.sh\\"; \\x7D );" -PREINST_SCRIPT_DESC = "" -PREINST_SCRIPT_DESC_ccimx6sbc = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${PREINST_SCRIPT_TEMPLATE}', '')}" -PREINST_SCRIPT_DESC_ccimx6ul = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '', '${PREINST_SCRIPT_TEMPLATE}')}" - -python () { - img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) - d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "dey-image-qt-" + d.getVar('GRAPHICAL_BACKEND', True), img_fstypes) -} - -python do_swuimage_prepend() { - import glob - - if (d.getVar('TRUSTFENCE_SIGN', True) == "1"): - d.setVar('SWUPDATE_PRIVATE_KEY', glob.glob(d.getVar('SWUPDATE_PRIVATE_KEY_TEMPLATE', True))[0]) -} - -do_unpack[postfuncs] += "fill_description" - -fill_description() { - sed -i -e "s,##BOOTIMG_NAME##,dey-image-qt-${GRAPHICAL_BACKEND}-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description" - sed -i -e "s,##BOOT_DEV##,${BOOT_DEV_NAME},g" "${WORKDIR}/sw-description" - sed -i -e "s,##ROOTIMG_NAME##,dey-image-qt-${GRAPHICAL_BACKEND}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" - sed -i -e "s,##ROOTFS_DEV##,${ROOTFS_DEV_NAME_FINAL},g" "${WORKDIR}/sw-description" - sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" - sed -i -e "s/##PREINSTALL_SCRIPT##/${PREINST_SCRIPT_DESC}/g" "${WORKDIR}/sw-description" -} +IMG_NAME = "${@get_baseimg_pn(d)}-${GRAPHICAL_BACKEND}" diff --git a/meta-digi-dey/recipes-digi/swu-images/swu.inc b/meta-digi-dey/recipes-digi/swu-images/swu.inc new file mode 100644 index 000000000..d88e78df2 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/swu.inc @@ -0,0 +1,63 @@ +# Copyright (C) 2016, 2017 Digi International Inc. +SUMMARY = "Generate update package for SWUpdate" +SECTION = "base" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = "file://sw-description" +SRC_URI_append_ccimx6 = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), 'file://preinstall_swu.sh', '')}" +SRC_URI_append_ccimx6ul = " ${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '', 'file://preinstall_swu.sh')}" + +inherit swupdate + +IMAGE_DEPENDS = "${@get_baseimg_pn(d)}" + +IMG_NAME = "${IMAGE_DEPENDS}" + +SWUPDATE_IMAGES = "${IMG_NAME}" + +SOFTWARE_VERSION ?= "0.0.1" + +BOOTFS_EXT ?= ".boot.vfat" +BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" +ROOTFS_EXT ?= ".ext4" +ROOTFS_EXT_ccimx6ul ?= ".ubifs" + +BOOT_DEV_NAME ?= "/dev/mmcblk0p1" +BOOT_DEV_NAME_ccimx6ul ?= "linux" +ROOTFS_DEV_NAME ?= "/dev/mmcblk0p3" +ROOTFS_DEV_NAME_ccimx6ul ?= "rootfs" +ROOTFS_ENC_DEV = "/dev/mapper/cryptroot" +ROOTFS_ENC_DEV_ccimx6ul = "${ROOTFS_DEV_NAME}" +ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" +PREINST_SCRIPT_TEMPLATE = "scripts: ( { filename = \\"preinstall_swu.sh\\"; type = \\"preinstall\\"; sha256 = \\"@preinstall_swu.sh\\"; \\x7D );" +PREINST_SCRIPT_DESC = "" +PREINST_SCRIPT_DESC_ccimx6sbc = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${PREINST_SCRIPT_TEMPLATE}', '')}" +PREINST_SCRIPT_DESC_ccimx6ul = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '', '${PREINST_SCRIPT_TEMPLATE}')}" + +python () { + img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", d.getVar('IMG_NAME', True), img_fstypes) +} + +python do_swuimage_prepend() { + import glob + + if (d.getVar('TRUSTFENCE_SIGN', True) == "1"): + d.setVar('SWUPDATE_PRIVATE_KEY', glob.glob(d.getVar('SWUPDATE_PRIVATE_KEY_TEMPLATE', True))[0]) +} + +def get_baseimg_pn(d): + file_name = d.getVar('PN', True) + return file_name[:file_name.find("-swu")] + +do_unpack[postfuncs] += "fill_description" + +fill_description() { + sed -i -e "s,##BOOTIMG_NAME##,${IMG_NAME}-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##BOOT_DEV##,${BOOT_DEV_NAME},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTIMG_NAME##,${IMG_NAME}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTFS_DEV##,${ROOTFS_DEV_NAME_FINAL},g" "${WORKDIR}/sw-description" + sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" + sed -i -e "s/##PREINSTALL_SCRIPT##/${PREINST_SCRIPT_DESC}/g" "${WORKDIR}/sw-description" +} From e49bda97e0d7a6c248e38b182149705bd6a6dc3a Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Thu, 22 Jun 2017 14:03:18 +0200 Subject: [PATCH 63/95] swu-images: new swu update package including Amazon Web Services This recipe allows to generate the swu update package to be used with SWUpdate. The package can be generated using: bitbake dey-image-aws-swu https://jira.digi.com/browse/DEL-4304 Signed-off-by: Tatiana Leon --- meta-digi-dey/recipes-digi/swu-images/dey-image-aws-swu.bb | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/swu-images/dey-image-aws-swu.bb diff --git a/meta-digi-dey/recipes-digi/swu-images/dey-image-aws-swu.bb b/meta-digi-dey/recipes-digi/swu-images/dey-image-aws-swu.bb new file mode 100644 index 000000000..3483f5fe3 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/dey-image-aws-swu.bb @@ -0,0 +1,3 @@ +# Copyright (C) 2017 Digi International Inc. + +require swu.inc From 97c13c0d195f0b0980867dd19cc4db880fabc048 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Wed, 28 Jun 2017 09:50:53 +0200 Subject: [PATCH 64/95] dey-examples: add awsiotsdk-demo application Demo application to connect devices to AWS IoT using the AWS IoT device SDK for embedded C. Signed-off-by: Tatiana Leon --- .../recipes-digi/packagegroups/packagegroup-dey-examples.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb index 0167a33e3..77bbc682b 100644 --- a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb +++ b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2013 Digi International. +# Copyright (C) 2013-2017 Digi International. SUMMARY = "DEY examples packagegroup" @@ -24,6 +24,7 @@ RDEPENDS_${PN}_append_ccardimx28 = "\ " RDEPENDS_${PN}_append_ccimx6 = "\ + awsiotsdk-demo \ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-bt", "", d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-btconfig", "", d)} \ dey-examples-can \ @@ -34,6 +35,7 @@ RDEPENDS_${PN}_append_ccimx6 = "\ " RDEPENDS_${PN}_append_ccimx6ul = "\ + awsiotsdk-demo \ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-bt", "", d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-btconfig", "", d)} \ dey-examples-adc \ From f898cc19fb43f91aa7c644300b9ca1f2aa4c0779 Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Wed, 28 Jun 2017 09:55:29 +0200 Subject: [PATCH 65/95] meta-digi-dey: add awsiotsdk-c package This is the AWS IoT device SDK for embedded C library. Signed-off-by: Tatiana Leon --- .../recipes-core/packagegroups/packagegroup-dey-core.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index 34a0425bf..63bd88c4a 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -1,5 +1,5 @@ # -# Copyright (C) 2012 Digi International. +# Copyright (C) 2012-2017 Digi International. # SUMMARY = "Core packagegroup for DEY image" @@ -26,6 +26,7 @@ VIRTUAL-RUNTIME_passwd_manager ?= "shadow" VIRTUAL-RUNTIME_touchscreen ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'tslib-calibrate tslib-tests', d)}" RDEPENDS_${PN} = "\ + awsiotsdk-c \ base-files \ base-passwd \ busybox \ From 146db452151e799aed6c75bf1c08006ab685a9ea Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Wed, 28 Jun 2017 15:53:44 +0200 Subject: [PATCH 66/95] mca_tool: update checksums for build 1.7 Signed-off-by: Sebastian Pastor --- meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb b/meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb index fcba45079..7712c6270 100644 --- a/meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb +++ b/meta-digi-arm/recipes-digi/mca/mca-tool_1.7.bb @@ -7,8 +7,8 @@ LICENSE = "CLOSED" PKGNAME = "mca_tool" SRC_URI = "${DIGI_PKG_SRC}/${PKGNAME}-${PV}.tar.gz" -SRC_URI[md5sum] = "b4159e354a530f1cabc4c98cbd30c2e5" -SRC_URI[sha256sum] = "e412e6c815731560e7e32fd2ae86b0ee946735c2ba3e146be30dd07c90518330" +SRC_URI[md5sum] = "f44b2547333b2900477a8b89b58d08a1" +SRC_URI[sha256sum] = "9659f591438955eab27fda7092fe4ba1d6874c276a4bc6d70689f91dc4bdccd8" S = "${WORKDIR}/${PKGNAME}-${PV}" From a046ede89be7e8618f25797b54c4a7056f517108 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 29 Jun 2017 14:35:42 +0200 Subject: [PATCH 67/95] kernel-module-gpio: remove recipe Nothing is using this. It does not even compile with the kernel versions we support. Signed-off-by: Javier Viguera --- .../kernel-module-gpio/kernel-module-gpio.bb | 18 - .../kernel-module-gpio/COPYING | 340 ----------------- .../kernel-module-gpio/Makefile | 14 - .../kernel-module-gpio/gpio.c | 350 ------------------ .../kernel-module-gpio/gpio.h | 45 --- 5 files changed, 767 deletions(-) delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio.bb delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/COPYING delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/Makefile delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.c delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.h diff --git a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio.bb b/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio.bb deleted file mode 100644 index 7aa5a90f1..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio.bb +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2013 Digi International. - -SUMMARY = "Example GPIO kernel module." -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" - -inherit module - -PV = "2.1" - -SRC_URI = "\ - file://COPYING \ - file://gpio.c \ - file://gpio.h \ - file://Makefile \ -" - -S = "${WORKDIR}" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/COPYING b/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/COPYING deleted file mode 100644 index 6d45519c8..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/Makefile b/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/Makefile deleted file mode 100644 index eefc3d188..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -obj-m := gpio.o - -SRC := $(shell pwd) - -all: - $(MAKE) -C $(KERNEL_SRC) M=$(SRC) - -modules_install: - $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install - -clean: - rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c - rm -f Module.markers Module.symvers modules.order - rm -rf .tmp_versions Modules.symvers diff --git a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.c b/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.c deleted file mode 100644 index 9e0ecd6e4..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - * gpio.c - * - * Copyright (C)2006-2008 by Digi International Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "gpio.h" - -#define DRIVER_VERSION "2.1" -#define DRIVER_NAME "gpio" - -static int gpio_major = 240; /* set to 0 for dynamic allocation */ -static int gpio_minor = 0; -static int gpio_nr_devs; -static struct gpio_dev *gpio_device = NULL; - -static int gpio_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg ); -static unsigned int gpio_poll(struct file *file, poll_table *wait ); -static ssize_t gpio_write(struct file * file, const char * buf, - size_t count, loff_t * ppos ); -static ssize_t gpio_read(struct file * file, char * buf, - size_t count, loff_t * ppos ); -static int gpio_open(struct inode * inode, struct file * file ); -static int gpio_release_close(struct inode * inode, struct file * file ); - -static struct file_operations gpio_fops = { - .owner = THIS_MODULE, - .read = gpio_read, - .write = gpio_write, - .ioctl = gpio_ioctl, - .poll = gpio_poll, - .open = gpio_open, - .release = gpio_release_close, -}; - -struct gpio_conf { - int dev_id; /* minor */ - int irqnum; /* irq number assigned */ - - /* needed for irq-waiting */ - wait_queue_head_t wait_q; - int triggered; -}; - -struct gpio_dev { - struct cdev cdev; - struct gpio_conf *gpio; -}; - -static irqreturn_t gpio_irq_handler(int irq, void *dev_id) -{ - struct gpio_conf *gpio = dev_id; - - /* awake those processes waiting... */ - gpio->triggered = 1; - wake_up_interruptible(&gpio->wait_q); - - return IRQ_HANDLED; -} - -static int gpio_ioctl(struct inode *inode, - struct file *file, - unsigned int cmd, - unsigned long arg ) -{ - struct gpio_conf *gpio = (struct gpio_conf *)file->private_data; - unsigned long irqflags = 0; - int gpionum = MINOR(inode->i_rdev); - char __user *argp = (char __user *)arg; - int retval = 0, irqnum; - - if(_IOC_TYPE(cmd)!= GPIO_IOCTL_BASE )return -ENOTTY; - if(_IOC_NR(cmd)> GPIO_IOCTL_MAXNR )return -ENOTTY; - - if (gpionum != gpio->dev_id) - return -EINVAL; - - switch(cmd ){ - case GPIO_CONFIG_AS_INP: /* config as input */ - if(gpio->irqnum >= 0 ){ - free_irq(gpio->irqnum, gpio ); - gpio->irqnum = -1; - } - retval = gpio_direction_input((unsigned int)gpionum); - break; - - case GPIO_CONFIG_AS_OUT: /* config as output */ - if(gpio->irqnum >= 0 ){ - free_irq(gpio->irqnum, gpio ); - gpio->irqnum = -1; - } - retval = gpio_direction_output((unsigned int)gpionum, - gpio_get_value((unsigned int)gpionum)); - break; - - case GPIO_READ_PIN_VAL: /* read value of the selected pin */ - retval = gpio_get_value((unsigned int)gpionum); - gpio->triggered = 0; - if (copy_to_user(argp, &retval, sizeof(int))) - return -EINVAL; - break; - - case GPIO_WRITE_PIN_VAL: /* write value to the selected pin */ - gpio_set_value((unsigned int)gpionum, *argp); - break; - - case GPIO_CONFIG_AS_IRQ: /* Configure this pin as external interrupt line */ - if(gpio->irqnum >= 0 ) - break; - retval = gpio_direction_input((unsigned int)gpionum); - irqnum = gpio_to_irq(gpionum); - if (irqnum >= 0){ - gpio->irqnum = irqnum; - - init_waitqueue_head(&gpio->wait_q ); - gpio->triggered = 0; - - switch( (ext_irq_type_t)*argp ) { - case IRQ_HIGH: - irqflags = IRQ_TYPE_LEVEL_HIGH; - break; - case IRQ_LOW: - irqflags = IRQ_TYPE_LEVEL_LOW; - break; - case IRQ_RISING: - irqflags = IRQ_TYPE_EDGE_RISING; - break; - case IRQ_FALLING: - irqflags = IRQ_TYPE_EDGE_FALLING; - break; - default: - return -EINVAL; - } - - if((retval = request_irq(gpio->irqnum, gpio_irq_handler, - irqflags, DRIVER_NAME, gpio ))!= 0 ){ - printk(KERN_ERR "Unable to request irq %d, ret %d\n", gpio->irqnum, retval ); - gpio->irqnum = -1; - return retval; - } - } - break; -#if defined(CONFIG_MACH_CC9M2443JS) || defined(CONFIG_MACH_CCW9M2443JS) - case GPIO_CONFIG_PULLUPDOWN: /* Configure this pin pull up/down */ - gpio_set_pullupdown((unsigned int)gpionum, (int)arg); - break; -#endif - default: return -ENOTTY; - } /* switch(cmd )*/ - - return retval; -} - -static unsigned int gpio_poll(struct file *file, poll_table *wait ) -{ - unsigned int ret = 0; - struct gpio_conf *gpio = (struct gpio_conf *)file->private_data; - - poll_wait(file, &gpio->wait_q, wait); - - if (file->f_mode & FMODE_WRITE) - ret |= POLLOUT | POLLWRNORM; - if (gpio->triggered) - ret |= POLLOUT | POLLRDNORM; - - return ret; -} - -static ssize_t gpio_write(struct file * file, const char * buf, size_t count, - loff_t * ppos) -{ - struct gpio_conf *gpio = (struct gpio_conf *)file->private_data; - int gpionum = MINOR(file->f_dentry->d_inode->i_rdev); - char outval; - - if ((gpionum != gpio->dev_id)|| (count != sizeof(char))) - return -EINVAL; - - if (copy_from_user(&outval, buf, sizeof(char))) - return -EFAULT; - - gpio_set_value(gpionum, (unsigned int)outval); - - return sizeof(char); -} - -static ssize_t gpio_read(struct file * file, char * buf, size_t count, - loff_t * ppos) -{ - struct gpio_conf *gpio = (struct gpio_conf *)file->private_data; - int gpionum = MINOR(file->f_dentry->d_inode->i_rdev); - int ret; - - if ((gpionum != gpio->dev_id)|| (count != sizeof(char))) - return -EINVAL; - - /* Check if configured for interrupt operation... */ - if (gpio->irqnum >= 0){ - /* Wait for data */ - if (!(file->f_flags & O_NONBLOCK)){ - wait_event_interruptible(gpio->wait_q, gpio->triggered != 0); - if (signal_pending(current)) - return -ERESTARTSYS; - } - gpio->triggered = 0; - } - - ret = gpio_get_value((unsigned int)gpionum); - - if (copy_to_user(buf, (char *)&ret, sizeof(char))) - return -EFAULT; - - return sizeof(char); -} - -static int gpio_open(struct inode * inode, struct file * file) -{ - int gpionum = MINOR(inode->i_rdev); - int ret; - struct gpio_dev *dev = - container_of(inode->i_cdev, struct gpio_dev, cdev); - - if (gpionum != dev->gpio[gpionum].dev_id) - return -EINVAL; - - ret = gpio_request(gpionum, DRIVER_NAME); - if (ret < 0) - return ret; - - file->private_data = &dev->gpio[gpionum]; - - return 0; -} - -static int gpio_release_close(struct inode * inode, struct file * file) -{ - struct gpio_conf *gpio = (struct gpio_conf *)file->private_data; - int gpionum = MINOR(inode->i_rdev); - - if (gpionum != gpio->dev_id) - return -EINVAL; - - if (gpio->irqnum >= 0){ - free_irq(gpio->irqnum, gpio); - gpio->irqnum = -1; - } - - gpio_free(gpionum); - - return 0; -} - -static void gpio_exit(void) -{ - int i; - dev_t devno = MKDEV(gpio_major, gpio_minor); - - if (gpio_device){ - for (i = 0; i < gpio_nr_devs; i++){ - if (gpio_device->gpio[i].irqnum != -1) - free_irq(gpio_device->gpio[i].irqnum, - &gpio_device->gpio[i]); - cdev_del(&gpio_device->cdev); - } - kfree(gpio_device); - } - unregister_chrdev_region(devno, gpio_nr_devs); -} - -static int gpio_init(void) -{ - int ret, i; - dev_t dev; - - gpio_nr_devs = 256; - - if (gpio_major){ - dev = MKDEV(gpio_major, gpio_minor); - ret = register_chrdev_region(dev, gpio_nr_devs, DRIVER_NAME); - } else { - ret = alloc_chrdev_region(&dev, gpio_minor, - gpio_nr_devs, DRIVER_NAME); - gpio_major = MAJOR(dev); - } - - if (ret < 0){ - pr_err(DRIVER_NAME ": major %d already in use \n", gpio_major); - return ret; - } - - gpio_device = kzalloc(sizeof(*gpio_device), GFP_KERNEL); - if (!gpio_device){ - ret = -ENOMEM; - goto fail; - } - - gpio_device->gpio = - kzalloc(sizeof(*gpio_device->gpio)* gpio_nr_devs, GFP_KERNEL); - if (!gpio_device->gpio){ - ret = -ENOMEM; - goto fail; - } - - cdev_init(&gpio_device->cdev, &gpio_fops); - gpio_device->cdev.owner = THIS_MODULE; - gpio_device->cdev.ops = &gpio_fops; - if (cdev_add(&gpio_device->cdev, dev, gpio_nr_devs)){ - pr_err(DRIVER_NAME ": Error adding cdev\n"); - ret = -ENODEV; - goto fail; - } - - for (i = 0; i < gpio_nr_devs; i++){ - gpio_device->gpio[i].dev_id = i; - gpio_device->gpio[i].irqnum = -1; - } - - pr_info(DRIVER_NAME ": GPIO driver v%s\n", DRIVER_VERSION); - return 0; - -fail: - gpio_exit(); - return ret; -} - -MODULE_AUTHOR("Digi International Inc."); -MODULE_DESCRIPTION("GPIO driver for the user space"); -MODULE_LICENSE("GPL v2"); - -module_init(gpio_init); -module_exit(gpio_exit); diff --git a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.h b/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.h deleted file mode 100644 index ac0c77d64..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-gpio/kernel-module-gpio/gpio.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * gpio.h - * - * Copyright (C) 2006 by Digi International Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - */ - -#ifndef __DIGI_GPIO_H_ -#define __DIGI_GPIO_H_ - -typedef enum { - IRQ_HIGH, - IRQ_LOW, - IRQ_RISING, - IRQ_FALLING -}ext_irq_type_t; - -#define PULLUP 0x00 -#define PULLDOWN 0x02 -#define PULLUPDOWN_DISABLED 0x03 - -/* ioctl magic numbers */ -#define GPIO_IOCTL_BASE 'G' - -/* inputs */ -#define GPIO_CONFIG_AS_INP _IO (GPIO_IOCTL_BASE, 0) /* config this pin as input */ -#define GPIO_READ_PIN_VAL _IOR (GPIO_IOCTL_BASE, 1, int) /* read pin value */ - -/* outputs */ -#define GPIO_CONFIG_AS_OUT _IO (GPIO_IOCTL_BASE, 2) /* config this pin as output */ -#define GPIO_WRITE_PIN_VAL _IOW (GPIO_IOCTL_BASE, 3, int) /* sets the pin value */ - -/* irqs */ -#define GPIO_CONFIG_AS_IRQ _IOR (GPIO_IOCTL_BASE, 4, ext_irq_type_t) /* config this pin as interrupt */ - -/* pull up/down */ -#define GPIO_CONFIG_PULLUPDOWN _IOW (GPIO_IOCTL_BASE, 5, int) /* config this pin pull up/down resistor */ - -#define GPIO_IOCTL_MAXNR 5 - -#endif /* __DIGI_GPIO_H_ */ From a5a09bdefff811c7faa8046905ba58f4fb2e68aa Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 18 May 2017 12:30:34 +0200 Subject: [PATCH 68/95] firmware-qualcomm: Remove cfg.dat and qcom_cfg.ini These are now provided from the kernel-module-qualcomm recipe. Signed-off-by: Alex Gonzalez --- .../firmware-qualcomm/wlan/cfg.dat | Bin 10298 -> 0 bytes .../firmware-qualcomm/wlan/qcom_cfg.ini | 373 ------------------ 2 files changed, 373 deletions(-) delete mode 100644 meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/cfg.dat delete mode 100644 meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/cfg.dat b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/cfg.dat deleted file mode 100644 index 3860af48e898f0fd95ef031fc57e4b5eb619c8b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10298 zcmeI0349dQ9moHZon%8c>`N5!Hfst50hw@=AS#R(-~p~Do`@Qe)&PrwqN0u%m9`OA z5mAu}D&DuYwXKzCTg7_TYQ67UDZkbq&*p{6nr&^QR{P=UH~;tk@BjYq&70Xb z!_O&?B^)VohV&FE5)l`u%9|UC6l2S~i1dMv?#=z@IU=j@H^ul@Owk!_$?;E4o%r8l+@Y>Tfib9mHip&#^TZ3D0pl!gqX{X^nb z2QgU#JD(YoV_+8C2!j~^*qL!j&x}i5*0_UVI~W4nv$h>z$7an}Bu^4El=`q{BR=fZ zY}}o(yTGno=WgU0p7q=j*paY1{d>Tkuop3-u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ZeY8eg`FK7Ryg5**khkB9j0rsLk(_*dG?K9WjUf4d3%P;xy_8GO-#_M@jZyN=y=F(%-Y7}a} zsUE0P+4bA}--aHjbET0Tbn@n>99ejd6JA%oHfZ1LLEbvol{T1)b=u@VQm=4pHSbjfB4?VuVV|Lp9PvPzhBjqsNX&d>-E9hJ8k 1->16k 2->32k 3->64k 4->128k) -gVhtAmpduLenExponent=7 - -# Maximum MPDU length (VHT only. Valid values: 0->3895 octets, 1->7991 octets, 2->11454 octets) -gVhtMpduLen=2 - -# Maximum number of wow filters required -#gMaxWoWFilters=22 - -# WOW Enable/Disable. -# 0 - Disable both magic pattern match and pattern byte match. -# 1 - Enable magic pattern match on all interfaces. -# 2 - Enable pattern byte match on all interfaces. -# 3 - Enable both magic patter and pattern byte match on all interfaces. -# Default value of gEnableWoW is 3. -# gEnableWoW=0 - -#Enable or Disable p2p device address administered -isP2pDeviceAddrAdministrated=0 - -# Set Thermal Power limit -TxPower2g=10 -TxPower5g=10 - -#Enable VHT on 2.4Ghz -gEnableVhtFor24GHzBand=1 - -#Enable or Disable 5G early beacon termination -gEnable5gEBT=1 - -ssdp = 0 - -#Enable Hysteretic mode -gEnableHystereticMode=1 - -# Bus bandwidth compute timeout value in ms -gBusBandwidthComputeInterval=2000 - -# Regulatory Setting; 0=STRICT; 1=CUSTOM -gRegulatoryChangeCountry=1 - -# Enable/Disable RX full reorder offload -gReorderOffloadSupported=1 - -#Set SAP max peer to 16 which allows 10 WEP connection -gSoftApMaxPeers=16 - -# Whether userspace country code setting shld have priority -gCountryCodePriority=1 - -# Enable(1)/Disable(0) SIFS burst -gEnableSifsBurst=1 - -# Enable or Disable Multi-user MIMO -# 1=Enable (default), 0=Disable -gEnableMuBformee=1 - -# Inactivity time (in ms) to end TX Service Period while in IBSS power save mode -gIbssTxSpEndInactivityTime=10 - -END - -# Note: Configuration parser would not read anything past the END marker - From cc77b83644be482af80c4f66829e58856d42d706 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Wed, 28 Jun 2017 14:02:05 +0200 Subject: [PATCH 69/95] dey-examples-opengles: add LDFLAGS and clean target This avoids the following errors: ERROR: dey-examples-opengles-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary and when cleaning: ERROR: dey-examples-opengles-1.0-r0 do_configure: oe_runmake failed | make: *** No rule to make target 'clean'. Stop. Signed-off-by: Diaz de Grenu, Jose --- .../dey-examples-opengles/ccimx6/opengles/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-opengles/ccimx6/opengles/Makefile b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-opengles/ccimx6/opengles/Makefile index ea8c73bbc..96f8d2942 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-opengles/ccimx6/opengles/Makefile +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-opengles/ccimx6/opengles/Makefile @@ -15,13 +15,16 @@ endif all: $(BINARIES) -es11_example: fsl_egl.o fslutil.o glu3.o - $(CC) $(CFLAGS) $^ -lm -lEGL -lGLESv1_CM $(X11LIBS) $@.c -o $@ +es11_example: es11_example.o fsl_egl.o fslutil.o glu3.o + $(CC) $(LDFLAGS) $^ -lm -lEGL -lGLESv1_CM $(X11LIBS) -o $@ -es20_example: fsl_egl.o fslutil.o - $(CC) $(CFLAGS) $^ -lm -lEGL -lGLESv2 $(X11LIBS) $@.c -o $@ +es20_example: es20_example.o fsl_egl.o fslutil.o + $(CC) $(LDFLAGS) $^ -lm -lEGL -lGLESv2 $(X11LIBS) -o $@ install: $(BINARIES) -mkdir -p $(DEST_DIR)/opt/dey-examples-opengles install -m 0755 $^ $(DEST_DIR)/opt/dey-examples-opengles install -m 0644 texture.bmp $(DEST_DIR)/opt/dey-examples-opengles + +clean: + -rm -f *.o $(BINARIES) From 991a087e854291d73bf8ee82d131f2e95261d406 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 22 Jun 2017 12:09:27 +0200 Subject: [PATCH 70/95] awsiotsdk-c: rename bbclass to aws-iot Rename the class so it's not specific to the C version of the AWS IoT Device SDK, and can be used for anything related with AWS IOT (for example Greengrass). https://jira.digi.com/browse/DEL-4274 Signed-off-by: Javier Viguera --- meta-digi-dey/classes/{awsiotsdk-c.bbclass => aws-iot.bbclass} | 0 meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb | 2 +- meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename meta-digi-dey/classes/{awsiotsdk-c.bbclass => aws-iot.bbclass} (100%) diff --git a/meta-digi-dey/classes/awsiotsdk-c.bbclass b/meta-digi-dey/classes/aws-iot.bbclass similarity index 100% rename from meta-digi-dey/classes/awsiotsdk-c.bbclass rename to meta-digi-dey/classes/aws-iot.bbclass diff --git a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb index b651683e3..a76e64115 100644 --- a/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb +++ b/meta-digi-dey/recipes-aws/awsiotsdk-c/awsiotsdk-c_2.1.1.bb @@ -21,7 +21,7 @@ SRC_URI[sha256sum] = "74d434b3258654cea048b20eb52d4fc627f5c87e8727ce180a1d529e32 S = "${WORKDIR}/aws-iot-device-sdk-embedded-C-${PV}" -inherit awsiotsdk-c pkgconfig +inherit aws-iot pkgconfig EXTRA_OEMAKE += "'LOG_FLAGS=${@get_log_level(d)}'" diff --git a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb index 5d339e33e..26364cb58 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/awsiotsdk-demo_git.bb @@ -25,7 +25,7 @@ SRC_URI = "${CC_GIT_URI};branch=${SRCBRANCH}" S = "${WORKDIR}/git/awsiot-sample" -inherit awsiotsdk-c pkgconfig +inherit aws-iot pkgconfig EXTRA_OEMAKE += "'LOG_FLAGS=${@get_log_level(d)}'" From f397ee2289b273f50c80acd895fa39e6a1bd8c0c Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 26 Jun 2017 18:54:56 +0200 Subject: [PATCH 71/95] greengrass: add support to preconfigure the package If values are provided in the local.conf, the package will have the 'config.json' file preconfigured. https://jira.digi.com/browse/DEL-4274 Signed-off-by: Javier Viguera --- meta-digi-dey/classes/aws-iot.bbclass | 23 ++++++++++++++++ .../greengrass/greengrass_1.0.0.bb | 27 ++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/classes/aws-iot.bbclass b/meta-digi-dey/classes/aws-iot.bbclass index 1ec839042..259506024 100644 --- a/meta-digi-dey/classes/aws-iot.bbclass +++ b/meta-digi-dey/classes/aws-iot.bbclass @@ -85,3 +85,26 @@ def get_log_level(d): return log_flags +####################### +# AWS Greengrass Core # +####################### + +# +# Verisign root CA server certificate used to authenticate the AWS IoT server. +# +# https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem +# +AWS_GGCORE_ROOT_CA ?= "aws-root-ca.pem" + +# Greengrass core device certificate +AWS_GGCORE_CERTIFICATE ?= "gg-core.pem" + +# Greengrass core device private key +AWS_GGCORE_PRIVATE_KEY ?= "gg-core.key" + +# Greengrass core Thing ARN +AWS_GGCORE_THING_ARN ?= "" + +# AWS IoT endpoint (check your account) +# CLI: aws iot describe-endpoint +AWS_GGCORE_IOT_HOST ?= "" diff --git a/meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb b/meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb index c73977241..af6c86b35 100644 --- a/meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb +++ b/meta-digi-dey/recipes-aws/greengrass/greengrass_1.0.0.bb @@ -93,7 +93,7 @@ python() { S = "${WORKDIR}/${BPN}" -inherit update-rc.d useradd +inherit aws-iot update-rc.d useradd GG_USESYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', 'no', d)}" @@ -118,6 +118,29 @@ do_install() { install -m 0755 ${WORKDIR}/greengrass-init ${D}${sysconfdir}/init.d/greengrass sed -i -e "s,##GG_INSTALL_DIR##,/${BPN},g" ${D}${sysconfdir}/init.d/greengrass + # If certificates do exist, install them and update the config file + if [ -f "${AWS_IOT_CERTS_DIR}/${AWS_GGCORE_ROOT_CA}" ] && \ + [ -f "${AWS_IOT_CERTS_DIR}/${AWS_GGCORE_CERTIFICATE}" ] && \ + [ -f "${AWS_IOT_CERTS_DIR}/${AWS_GGCORE_PRIVATE_KEY}" ]; then + install -m 0644 "${AWS_IOT_CERTS_DIR}/${AWS_GGCORE_ROOT_CA}" \ + "${AWS_IOT_CERTS_DIR}/${AWS_GGCORE_CERTIFICATE}" \ + "${AWS_IOT_CERTS_DIR}/${AWS_GGCORE_PRIVATE_KEY}" \ + ${D}/${BPN}/configuration/certs/ + sed -i -e "s,\[ROOT_CA_PEM_HERE],${AWS_GGCORE_ROOT_CA},g" \ + -e "s,\[CLOUD_PEM_CRT_HERE],${AWS_GGCORE_CERTIFICATE},g" \ + -e "s,\[CLOUD_PEM_KEY_HERE],${AWS_GGCORE_PRIVATE_KEY},g" \ + ${D}/${BPN}/configuration/config.json + fi + + # Configure the rest of GG Core parameters + [ -n "${AWS_GGCORE_THING_ARN}" ] && sed -i -e "s,\[THING_ARN_HERE],${AWS_GGCORE_THING_ARN},g" ${D}/${BPN}/configuration/config.json + if [ -n "${AWS_GGCORE_IOT_HOST}" ]; then + AWS_GGCORE_HOST_PREFIX="$(echo ${AWS_GGCORE_IOT_HOST} | sed -e 's,\([^.]\+\)\.iot.*,\1,g')" + AWS_GGCORE_REGION="$(echo ${AWS_GGCORE_IOT_HOST} | sed -e 's,.*.iot\.\([^.]\+\)\..*,\1,g')" + [ -n "${AWS_GGCORE_HOST_PREFIX}" ] && sed -i -e "s,\[HOST_PREFIX_HERE],${AWS_GGCORE_HOST_PREFIX},g" ${D}/${BPN}/configuration/config.json + [ -n "${AWS_GGCORE_REGION}" ] && sed -i -e "s,\[AWS_REGION_HERE],${AWS_GGCORE_REGION},g" ${D}/${BPN}/configuration/config.json + fi + # Configure whether to use systemd or not sed -i -e "/useSystemd/{s,\[yes|no],${GG_USESYSTEMD},g}" ${D}/${BPN}/configuration/config.json } @@ -158,6 +181,8 @@ pkg_postinst_${PN}() { FILES_${PN} = "/${BPN} ${sysconfdir}" +CONFFILES_${PN} += "/${BPN}/configuration/config.json" + INITSCRIPT_NAME = "greengrass" INITSCRIPT_PARAMS = "defaults 80 20" From 0966b3d04ea38766c9251d143142a8656f0e2fac Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 28 Jun 2017 11:43:51 +0200 Subject: [PATCH 72/95] mkproject.sh: add meta-digi's scripts directory to the PATH This will allow to create user helper scripts that are available (in the PATH) when building DEY projects. Signed-off-by: Javier Viguera --- sdk/mkproject.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sdk/mkproject.sh b/sdk/mkproject.sh index 325c247fb..576e7cc7d 100755 --- a/sdk/mkproject.sh +++ b/sdk/mkproject.sh @@ -35,8 +35,15 @@ MKP_SETUP_ENVIRONMENT='#!/bin/bash if [ "${BASH_SOURCE}" = "${0}" ]; then printf "\\n[ERROR]: This script needs to be sourced\\n\\n" else + DEY_INSTALLDIR="%s" cd $(dirname ${BASH_SOURCE}) - . %s/sources/poky/oe-init-build-env . + . ${DEY_INSTALLDIR}/sources/poky/oe-init-build-env . + + # Add our own scripts directory to the PATH + PATH="$(echo $PATH | sed -e "s,:\?${DEY_INSTALLDIR}/sources/meta-digi/scripts,,g;s,^:,,g")" + export PATH="${DEY_INSTALLDIR}/sources/meta-digi/scripts:$PATH" + + unset DEY_INSTALLDIR fi ' @@ -123,6 +130,10 @@ do_mkproject() { source ${MKP_SCRIPTPATH}/sources/poky/oe-init-build-env . unset TEMPLATECONF + # Add our own scripts directory to the PATH + PATH="$(echo $PATH | sed -e "s,:\?${MKP_SCRIPTPATH}/sources/meta-digi/scripts,,g;s,^:,,g")" + export PATH="${MKP_SCRIPTPATH}/sources/meta-digi/scripts:$PATH" + # New project if [ -z "${MKP_OLD_PROJECT}" ]; then # Customize project From 66d650a8cf9c94efd38d97212ad08caa95ccce2f Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 29 Jun 2017 18:41:54 +0200 Subject: [PATCH 73/95] scripts: add dey-aws-tool script This script allows to create certificates (Root CA and Greengrass Core device) and also register a GG Core device Thing. It's expected to be used before building images with Greengrass core, so the certificates and the proper configuration can be done in the firmware. https://jira.digi.com/browse/DEL-4274 Signed-off-by: Javier Viguera --- scripts/dey-aws-tool.sh | 141 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100755 scripts/dey-aws-tool.sh diff --git a/scripts/dey-aws-tool.sh b/scripts/dey-aws-tool.sh new file mode 100755 index 000000000..7afacd052 --- /dev/null +++ b/scripts/dey-aws-tool.sh @@ -0,0 +1,141 @@ +#!/bin/sh +# +# Copyright (c) 2017, Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# Description: AWS CLI wrapper to be used in DEY +# + +SCRIPTNAME="$(basename ${0})" + +USAGE=" +AWS CLI wrapper to facilitate integration with Digi Embedded Yocto + +Usage: ${SCRIPTNAME} [OPTIONS] + + -c, --create-certs Create Root CA and Greengrass Core device certificates under + -t, --thing-name Name of the Greengrass Core Thing. The script will register this Thing in your account if it is not already. +" + +error() { + printf "%s\n" "${1}" + exit 1 +} + +do_create_certs() { + GG_ROOTCA_KEY="${GG_CERTS_DIR}/root-ca.key" + GG_ROOTCA_PEM="${GG_CERTS_DIR}/root-ca.pem" + GG_ROOTCA_VERIF_KEY="${GG_CERTS_DIR}/root-ca-verif.key" + GG_ROOTCA_VERIF_CSR="${GG_CERTS_DIR}/root-ca-verif.csr" + GG_ROOTCA_VERIF_PEM="${GG_CERTS_DIR}/root-ca-verif.pem" + GG_CORE_KEY="${GG_CERTS_DIR}/gg-core.key" + GG_CORE_CSR="${GG_CERTS_DIR}/gg-core.csr" + GG_CORE_PEM="${GG_CERTS_DIR}/gg-core.pem" + + # Verify that no certificate artifact exists in the certs directory + if [ -f "${GG_ROOTCA_KEY}" ] || \ + [ -f "${GG_ROOTCA_PEM}" ] || \ + [ -f "${GG_ROOTCA_PEM}" ] || \ + [ -f "${GG_ROOTCA_VERIF_KEY}" ] || \ + [ -f "${GG_ROOTCA_VERIF_CSR}" ] || \ + [ -f "${GG_ROOTCA_VERIF_PEM}" ] || \ + [ -f "${GG_CORE_KEY}" ] || \ + [ -f "${GG_CORE_CSR}" ] || \ + [ -f "${GG_CORE_PEM}" ]; then + error "[ERROR] Certificates directory contains artifacts from previous execution" + fi + + mkdir -p "${GG_CERTS_DIR}" + + # Get AWS root CA certificate + printf "[INFO] Downloading AWS root CA certificate.\n" + AWS_ROOT_CA_URL="https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem" + [ -f "${GG_CERTS_DIR}/aws-root-ca.pem" ] || wget -t 2 -T 30 -q --passive-ftp --no-check-certificate -O "${GG_CERTS_DIR}/aws-root-ca.pem" "${AWS_ROOT_CA_URL}" + + # + # Create a self-signed CA certificate (if it doesn't exit) + # + printf "[INFO] Creating Greengrass Core CA certificate and key.\n" + GG_ROOTCA_SUBJ="/C=US/ST=Minnesota/L=Minnetonka/O=Digi International Inc./OU=Digi Enginnering/CN=AWS IoT CA Certificate" + openssl genrsa -out "${GG_ROOTCA_KEY}" 2048 2>/dev/null + openssl req -x509 -new -nodes -key "${GG_ROOTCA_KEY}" -sha256 -days 1024 -out "${GG_ROOTCA_PEM}" -subj "${GG_ROOTCA_SUBJ}" + + # + # Create verification certificate (needed to register the CA certificate) + # + printf "[INFO] Creating verification certificate.\n" + if ! REG_CODE="$(aws iot get-registration-code --query registrationCode 2>/dev/null)"; then + error "[ERROR] Unable to get registration code" + fi + GG_ROOTCA_VERIF_SUBJ="/C=US/ST=Minnesota/L=Minnetonka/O=Digi International Inc./OU=Digi Enginnering/CN=${REG_CODE}" + openssl genrsa -out "${GG_ROOTCA_VERIF_KEY}" 2048 2>/dev/null + openssl req -new -key "${GG_ROOTCA_VERIF_KEY}" -out "${GG_ROOTCA_VERIF_CSR}" -subj "${GG_ROOTCA_VERIF_SUBJ}" + openssl x509 -req -in "${GG_ROOTCA_VERIF_CSR}" -CA "${GG_ROOTCA_PEM}" -CAkey "${GG_ROOTCA_KEY}" -CAcreateserial -out "${GG_ROOTCA_VERIF_PEM}" -days 1024 -sha256 2>/dev/null + + # + # Create Greengrass Core device certificate + # + printf "[INFO] Creating Greengrass Core device certificate.\n" + GG_CORE_SUBJ="/C=US/ST=Minnesota/L=Minnetonka/O=Digi International Inc./OU=Digi Enginnering/CN=AWS IoT Device Certificate" + openssl genrsa -out "${GG_CORE_KEY}" 2048 2>/dev/null + openssl req -new -key "${GG_CORE_KEY}" -out "${GG_CORE_CSR}" -subj "${GG_CORE_SUBJ}" + openssl x509 -req -in "${GG_CORE_CSR}" -CA "${GG_ROOTCA_PEM}" -CAkey "${GG_ROOTCA_KEY}" -CAcreateserial -out "${GG_CORE_PEM}" -days 1024 -sha256 2>/dev/null +} + +do_register_thing() { + printf "[INFO] Registering Greengrass Core Thing.\n" + if ! AWS_GGCORE_THING_ARN="$(aws iot create-thing --thing-name ${GG_THING_NAME} --query thingArn 2>/dev/null)"; then + error "[ERROR] Unable to create Greengrass Core Thing" + fi +} + +# Use GNU 'getopt' to parse command line options +SHORT_OPTS="hc:t:" +LONG_OPTS="help,create-certs:,thing-name:" +CMDLINE_OPTS=$(getopt -o ${SHORT_OPTS} -l ${LONG_OPTS} -- "$@") || error "${USAGE}" + +eval set -- "${CMDLINE_OPTS}" + +while true; do + case "$1" in + -h|--help) printf "%s\n" "${USAGE}"; exit 0;; + -c|--create-certs) GG_CERTS_DIR="${2}"; shift;; + -t|--thing-name) GG_THING_NAME="${2}"; shift;; + --) shift; break;; + esac + shift +done + +# Sanity checks: AWS CLI needs to be installed and configured +if ! aws configure get aws_access_key_id >/dev/null 2>&1; then + error "[ERROR] AWS CLI needs to be installed and configured" +fi + +AWS_GGCORE_IOT_HOST="$(aws iot describe-endpoint 2>/dev/null)" + +[ -n "${GG_CERTS_DIR}" ] && do_create_certs +[ -n "${GG_THING_NAME}" ] && do_register_thing + +# Print AWS IoT configuration for DEY projects +cat <<-_EOF_ + + For Greengrass enabled images, add the following configuration to your project: + + AWS_IOT_CERTS_DIR = "${GG_CERTS_DIR:-}" + AWS_GGCORE_IOT_HOST = "${AWS_GGCORE_IOT_HOST:-}" + AWS_GGCORE_THING_ARN = "${AWS_GGCORE_THING_ARN:-}" + + Please verify variables' value is correct. + +_EOF_ From 838a76e15598179a410de9dc1c1916e34ca8fd3f Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 30 Jun 2017 10:44:34 +0200 Subject: [PATCH 74/95] meta-digi: update conf-notes.txt with AWS support https://jira.digi.com/browse/DEL-4274 Signed-off-by: Javier Viguera --- sdk/config/ccimx6sbc/conf-notes.txt | 6 ++++++ sdk/config/ccimx6ulsbc/conf-notes.txt | 6 ++++++ sdk/config/ccimx6ulstarter/conf-notes.txt | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/sdk/config/ccimx6sbc/conf-notes.txt b/sdk/config/ccimx6sbc/conf-notes.txt index d8fa34f70..ed1cd5158 100644 --- a/sdk/config/ccimx6sbc/conf-notes.txt +++ b/sdk/config/ccimx6sbc/conf-notes.txt @@ -10,3 +10,9 @@ Digi Embedded Yocto provides the following image recipes: DISTRO_FEATURES_remove = "x11" + * dey-image-aws: console-only image supporting Amazon Web Services IoT + + This image includes the AWS Greengrass Core and an AWS IoT platform + example application. For more information on AWS support in Digi + Embedded Yocto see the online documentation. + diff --git a/sdk/config/ccimx6ulsbc/conf-notes.txt b/sdk/config/ccimx6ulsbc/conf-notes.txt index c6c1bf9fb..027ac1216 100644 --- a/sdk/config/ccimx6ulsbc/conf-notes.txt +++ b/sdk/config/ccimx6ulsbc/conf-notes.txt @@ -15,3 +15,9 @@ Digi Embedded Yocto provides the following image recipes: Expansion of native core-image-base by including all the support for the target device hardware like firmware files, rootfs customizations, etc. + * dey-image-aws: console-only image supporting Amazon Web Services IoT + + This image includes the AWS Greengrass Core and an AWS IoT platform + example application. For more information on AWS support in Digi + Embedded Yocto see the online documentation. + diff --git a/sdk/config/ccimx6ulstarter/conf-notes.txt b/sdk/config/ccimx6ulstarter/conf-notes.txt index 811825d35..a08fe9e99 100644 --- a/sdk/config/ccimx6ulstarter/conf-notes.txt +++ b/sdk/config/ccimx6ulstarter/conf-notes.txt @@ -5,3 +5,9 @@ Digi Embedded Yocto provides the following image recipes: Expansion of native core-image-base by including all the support for the target device hardware like firmware files, rootfs customizations, etc. + * dey-image-aws: console-only image supporting Amazon Web Services IoT + + This image includes the AWS Greengrass Core and an AWS IoT platform + example application. For more information on AWS support in Digi + Embedded Yocto see the online documentation. + From e15dc3080063becb6c342da10edbdfca6b7f94e7 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 4 Jul 2017 10:54:30 +0200 Subject: [PATCH 75/95] meta-digi-arm: firmware-atheros: Update fw-4.bin for RED certification The new fw-4.bin (v3.4.0.236) with md5sum e2fc33daba2c35fe2c4f62492a44f8b6 was used to pass RED (Radio Equipment Directive) certification on the CC6 module. https://jira.digi.com/browse/DEL-4512 Signed-off-by: Alex Gonzalez --- .../firmware-atheros/fw-4.bin | Bin 114025 -> 114261 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/firmware-atheros/firmware-atheros/fw-4.bin b/meta-digi-arm/recipes-bsp/firmware-atheros/firmware-atheros/fw-4.bin index 35ebeff3284f6f7ab0600e9a0c4a36b424dcb355..38a27059c47ee72d828f8f377bd4a879c8b2650b 100644 GIT binary patch delta 28020 zcmW(63s@9Yckb-YK8H6fuLYK67nX+#h{#I?LcIA%Y;d06g)roX*&GC*>C%h*&gdey;sS^2}U9;X)7<1d&TP z$L15|)AONgZUsX*hoTB*lCwX0z$|dy3)jCpFLtirrj0)uA0KyuXRXA`3TCNGq^dkF zpHP)G5X5wXaCXkE;3ki^MCKB*=zPL?RRhuFl}q$KB8YX2&1EC1VrTei5ndT}1epv76P|ShA*?HznqNU} zPU;(OAl60H5zd~uggZc-8<66119QY91(h=|J;I~iVO|7L-TZO|JV(?uH~ic{6#m*k z)Ln*2{n$X`W=@nj%mB!CtAybgWV zp++L|ULE1iX(R|0(41-{itZ6a2i!kNRy7hG{{S+7HV_YF`+oGbrrAj)4h5Km!{T3#c;wPX{|&DlhE1-FoBByyoC*D;q6Boo9Y zz%vG}O8}QKIHv*h0j@W%>>vh3jfAtfk;vlDhH(UqM7KjDVfEZe)IsC*IN%1)+zM)o zv%;y7kUBOJ&jD)T`YAxsvmHdF3ycNh4+7k!?aXo9b8*5ZmqtR?o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u10Or3~jPGq%%`R9iw#6%xoq2%U1LbY^ar6 z)g=zg4aRJ;=Dtc~OQ2?!DRK`T^%5W+!ST@?QC61_1ukwSDr<16U`*z*e% zQTcxkb#>FBt`q8_>`&`YKh3-NH0mq-_$&%nr9GuaLV}yV%UFF54Jsj0dH;%Cf+ijJ zvbYzU=hPvzjs7r!!FbWi%`$yd@D2G5@!$0Z@pgaWH*8Zbz%RuN{Q7BZ_ m{G+nqMy4nX>Z Date: Wed, 28 Jun 2017 11:34:27 +0200 Subject: [PATCH 76/95] dey-examples: add example to use the Atmel ATECC508A https://jira.digi.com/browse/DEL-4371 Signed-off-by: Diaz de Grenu, Jose --- .../dey-examples/dey-examples-cryptochip.bb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb new file mode 100644 index 000000000..e1700995b --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cryptochip.bb @@ -0,0 +1,28 @@ +# Copyright (C) 2017 Digi International. + +SUMMARY = "DEY examples: Cryptochip example application" +SECTION = "examples" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +DEPENDS = "cryptoauthlib" + +SRCBRANCH = "master" +SRCREV = "${AUTOREV}" + +CC_STASH = "${DIGI_MTK_GIT}dey/dey-examples.git;protocol=ssh" +CC_GITHUB = "${DIGI_GITHUB_GIT}/dey-examples.git;protocol=git" + +CC_GIT_URI ?= "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${CC_STASH}', '${CC_GITHUB}', d)}" + +SRC_URI = "${CC_GIT_URI};branch=${SRCBRANCH}" + +S = "${WORKDIR}/git/cryptochip-get-random" + +do_install() { + oe_runmake DESTDIR=${D} install +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(ccimx6ul)" + From 42e2202a7d8afebc4c108206ac5dce0c658d4f21 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Fri, 30 Jun 2017 11:49:11 +0200 Subject: [PATCH 77/95] custom-licenses: atmel: add copyright Signed-off-by: Diaz de Grenu, Jose --- meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE b/meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE index cc9ab017b..9e033a8a6 100644 --- a/meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE +++ b/meta-digi-dey/custom-licenses/ATMEL_CRYPTOAUTHLIB_LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2015 Atmel Corporation. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: From 4c7829c2393b4c411e062f63c73e38dd559509e6 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 15 May 2017 15:10:17 +0200 Subject: [PATCH 78/95] networkmanager: configure compile time PACKAGECONFIG options * Disabled: dnsmasq and netconfig * Enabled: cellular related options and connectivity check https://jira.digi.com/browse/DEL-4289 Signed-off-by: Javier Viguera --- .../networkmanager/networkmanager_1.0.12.bbappend | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend new file mode 100644 index 000000000..69e063704 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend @@ -0,0 +1,4 @@ +# Copyright (C) 2017, Digi International Inc. + +PACKAGECONFIG_remove = "dnsmasq netconfig" +PACKAGECONFIG_append = " concheck modemmanager ppp" From bb7202b413c9bd72e048a5d3fc52a7b7696c0a34 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 16 May 2017 11:51:28 +0200 Subject: [PATCH 79/95] networkmanager: add boot script and config file https://jira.digi.com/browse/DEL-4289 Signed-off-by: Javier Viguera --- .../networkmanager/NetworkManager.conf | 6 ++++ .../networkmanager/networkmanager-init | 28 +++++++++++++++++++ .../networkmanager_1.0.12.bbappend | 19 +++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/networkmanager-init diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf new file mode 100644 index 000000000..8ecb93545 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf @@ -0,0 +1,6 @@ +[main] +plugins=ifupdown,keyfile +no-auto-default=type:ethernet + +[ifupdown] +managed=false diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/networkmanager-init b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/networkmanager-init new file mode 100644 index 000000000..67ef4e86d --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/networkmanager-init @@ -0,0 +1,28 @@ +#!/bin/sh + +DAEMON="/usr/sbin/NetworkManager" +PIDFILE="/var/run/NetworkManager/NetworkManager.pid" +DESC="NetworkManager" + +case "${1}" in + start) + mkdir -p /var/run/NetworkManager + echo -n "Starting ${DESC}: " + ${DAEMON} + echo "done" + ;; + stop) + echo -n "Stopping ${DESC}: " + start-stop-daemon -K -o -q -p ${PIDFILE} + echo "done" + ;; + restart) + ${0} stop + sleep 1 + ${0} start + ;; + *) + echo "Usage: ${0} {start|stop|restart}" + exit 1 + ;; +esac diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend index 69e063704..f24de6b0d 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend @@ -1,4 +1,23 @@ # Copyright (C) 2017, Digi International Inc. +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +SRC_URI += " \ + file://NetworkManager.conf \ + file://networkmanager-init \ +" + PACKAGECONFIG_remove = "dnsmasq netconfig" PACKAGECONFIG_append = " concheck modemmanager ppp" + +inherit update-rc.d + +do_install_append() { + install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/NetworkManager + install -m 0644 ${WORKDIR}/NetworkManager.conf ${D}${sysconfdir}/NetworkManager/ + install -m 0755 ${WORKDIR}/networkmanager-init ${D}${sysconfdir}/init.d/networkmanager +} + +# NetworkManager needs to be started after DBUS +INITSCRIPT_NAME = "networkmanager" +INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 80 0 6 1 ." From 09b7d4f2b1e5671387971d19f61fbebced44128b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 18 May 2017 17:38:45 +0200 Subject: [PATCH 80/95] networkmanager: implement ethernet configuration https://jira.digi.com/browse/DEL-4289 Signed-off-by: Javier Viguera --- .../networkmanager/nm.eth0.dhcp | 7 ++++ .../networkmanager/nm.eth0.static | 9 +++++ .../networkmanager/nm.eth1.dhcp | 7 ++++ .../networkmanager/nm.eth1.static | 9 +++++ .../networkmanager_1.0.12.bbappend | 37 +++++++++++++++++++ 5 files changed, 69 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp new file mode 100644 index 000000000..bf463888d --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp @@ -0,0 +1,7 @@ +[connection] +id=eth0 +type=ethernet +interface-name=eth0 + +[ipv4] +method=auto diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static new file mode 100644 index 000000000..0b776cc0d --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static @@ -0,0 +1,9 @@ +[connection] +id=eth0 +type=ethernet +interface-name=eth0 + +[ipv4] +address1=##ETH0_STATIC_CIDR##,##ETH0_STATIC_GATEWAY## +dns=##ETH0_STATIC_DNS##; +method=manual diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp new file mode 100644 index 000000000..c7f11b9a1 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp @@ -0,0 +1,7 @@ +[connection] +id=eth1 +type=ethernet +interface-name=eth1 + +[ipv4] +method=auto diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static new file mode 100644 index 000000000..deeac0897 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static @@ -0,0 +1,9 @@ +[connection] +id=eth1 +type=ethernet +interface-name=eth1 + +[ipv4] +address1=##ETH1_STATIC_CIDR##,##ETH1_STATIC_GATEWAY## +dns=##ETH1_STATIC_DNS##; +method=manual diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend index f24de6b0d..439f9215a 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend @@ -5,17 +5,54 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI += " \ file://NetworkManager.conf \ file://networkmanager-init \ + file://nm.eth0.dhcp \ + file://nm.eth0.static \ + file://nm.eth1.dhcp \ + file://nm.eth1.static \ " PACKAGECONFIG_remove = "dnsmasq netconfig" PACKAGECONFIG_append = " concheck modemmanager ppp" +# +# NetworkManager only accepts IP addresses in CIDR format +# +def ipaddr_to_cidr(iface, d): + ipaddr = d.getVar('%s_STATIC_IP' % iface.upper(), True) + netmask = d.getVar('%s_STATIC_NETMASK' % iface.upper(), True) + binary_str = '' + for byte in netmask.split('.'): + binary_str += bin(int(byte))[2:].zfill(8) + return ipaddr + '/' + str(len(binary_str.rstrip('0'))) + +ETH0_STATIC_CIDR = "${@ipaddr_to_cidr('eth0', d)}" +ETH1_STATIC_CIDR = "${@ipaddr_to_cidr('eth1', d)}" + inherit update-rc.d do_install_append() { install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/NetworkManager install -m 0644 ${WORKDIR}/NetworkManager.conf ${D}${sysconfdir}/NetworkManager/ install -m 0755 ${WORKDIR}/networkmanager-init ${D}${sysconfdir}/init.d/networkmanager + + # + # Connections config files + # + install -d ${D}${sysconfdir}/NetworkManager/system-connections/ + + # Ethernet + install -m 0600 ${WORKDIR}/nm.eth0.${ETH0_MODE} ${D}${sysconfdir}/NetworkManager/system-connections/nm.eth0 + sed -i -e "s,##ETH0_STATIC_CIDR##,${ETH0_STATIC_CIDR},g" \ + -e "s,##ETH0_STATIC_GATEWAY##,${ETH0_STATIC_GATEWAY},g" \ + -e "s,##ETH0_STATIC_DNS##,${ETH0_STATIC_DNS},g" \ + ${D}${sysconfdir}/NetworkManager/system-connections/nm.eth0 + + # Ethernet (second interface) + install -m 0600 ${WORKDIR}/nm.eth1.${ETH1_MODE} ${D}${sysconfdir}/NetworkManager/system-connections/nm.eth1 + sed -i -e "s,##ETH1_STATIC_CIDR##,${ETH1_STATIC_CIDR},g" \ + -e "s,##ETH1_STATIC_GATEWAY##,${ETH1_STATIC_GATEWAY},g" \ + -e "s,##ETH1_STATIC_DNS##,${ETH1_STATIC_DNS},g" \ + ${D}${sysconfdir}/NetworkManager/system-connections/nm.eth1 } # NetworkManager needs to be started after DBUS From e700b4d0c3a3ec05c077322bf470093f762b328c Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 18 May 2017 17:41:14 +0200 Subject: [PATCH 81/95] networkmanager: implement wireless configuration https://jira.digi.com/browse/DEL-4289 Signed-off-by: Javier Viguera --- .../networkmanager/networkmanager/nm.wlan0.dhcp | 10 ++++++++++ .../networkmanager/networkmanager/nm.wlan0.static | 12 ++++++++++++ .../networkmanager/networkmanager_1.0.12.bbappend | 10 ++++++++++ 3 files changed, 32 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp new file mode 100644 index 000000000..37918d043 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp @@ -0,0 +1,10 @@ +[connection] +id=wlan0 +type=wifi +interface-name=wlan0 + +[wifi] +ssid="" + +[ipv4] +method=auto diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static new file mode 100644 index 000000000..0c2006f59 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static @@ -0,0 +1,12 @@ +[connection] +id=wlan0 +type=wifi +interface-name=wlan0 + +[wifi] +ssid="" + +[ipv4] +address1=##WLAN0_STATIC_CIDR##,##WLAN0_STATIC_GATEWAY## +dns=##WLAN0_STATIC_DNS##; +method=manual diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend index 439f9215a..6c52eec31 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend @@ -9,6 +9,8 @@ SRC_URI += " \ file://nm.eth0.static \ file://nm.eth1.dhcp \ file://nm.eth1.static \ + file://nm.wlan0.dhcp \ + file://nm.wlan0.static \ " PACKAGECONFIG_remove = "dnsmasq netconfig" @@ -27,6 +29,7 @@ def ipaddr_to_cidr(iface, d): ETH0_STATIC_CIDR = "${@ipaddr_to_cidr('eth0', d)}" ETH1_STATIC_CIDR = "${@ipaddr_to_cidr('eth1', d)}" +WLAN0_STATIC_CIDR = "${@ipaddr_to_cidr('wlan0', d)}" inherit update-rc.d @@ -53,6 +56,13 @@ do_install_append() { -e "s,##ETH1_STATIC_GATEWAY##,${ETH1_STATIC_GATEWAY},g" \ -e "s,##ETH1_STATIC_DNS##,${ETH1_STATIC_DNS},g" \ ${D}${sysconfdir}/NetworkManager/system-connections/nm.eth1 + + # Wireless (only IP settings; connection settings need to be provided at runtime) + install -m 0600 ${WORKDIR}/nm.wlan0.${WLAN0_MODE} ${D}${sysconfdir}/NetworkManager/system-connections/nm.wlan0 + sed -i -e "s,##WLAN0_STATIC_CIDR##,${WLAN0_STATIC_CIDR},g" \ + -e "s,##WLAN0_STATIC_GATEWAY##,${WLAN0_STATIC_GATEWAY},g" \ + -e "s,##WLAN0_STATIC_DNS##,${WLAN0_STATIC_DNS},g" \ + ${D}${sysconfdir}/NetworkManager/system-connections/nm.wlan0 } # NetworkManager needs to be started after DBUS From fbc6b188f5f7cdeb625c87a1919eb72fdccf6a8e Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 18 May 2017 17:41:37 +0200 Subject: [PATCH 82/95] networkmanager: implement cellular configuration https://jira.digi.com/browse/DEL-4289 Signed-off-by: Javier Viguera --- .../networkmanager/networkmanager/nm.cellular | 10 ++++++++++ .../networkmanager/networkmanager_1.0.12.bbappend | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular new file mode 100644 index 000000000..df788cc58 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular @@ -0,0 +1,10 @@ +[connection] +id=cellular +type=gsm + +[gsm] +apn=##CELLULAR_APN## +number=*99# +password=##CELLULAR_PASSWORD## +pin=##CELLULAR_PIN## +username=##CELLULAR_USER## diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend index 6c52eec31..2572506a6 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend @@ -5,6 +5,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI += " \ file://NetworkManager.conf \ file://networkmanager-init \ + file://nm.cellular \ file://nm.eth0.dhcp \ file://nm.eth0.static \ file://nm.eth1.dhcp \ @@ -63,6 +64,20 @@ do_install_append() { -e "s,##WLAN0_STATIC_GATEWAY##,${WLAN0_STATIC_GATEWAY},g" \ -e "s,##WLAN0_STATIC_DNS##,${WLAN0_STATIC_DNS},g" \ ${D}${sysconfdir}/NetworkManager/system-connections/nm.wlan0 + + # Cellular + if [ -n "${@bb.utils.contains('DISTRO_FEATURES', 'cellular', '1', '', d)}" ]; then + install -m 0600 ${WORKDIR}/nm.cellular ${D}${sysconfdir}/NetworkManager/system-connections/nm.cellular + [ -z "${CELLULAR_APN}" ] && sed -i -e "/##CELLULAR_APN##/d" ${D}${sysconfdir}/NetworkManager/system-connections/nm.cellular + [ -z "${CELLULAR_PIN}" ] && sed -i -e "/##CELLULAR_PIN##/d" ${D}${sysconfdir}/NetworkManager/system-connections/nm.cellular + [ -z "${CELLULAR_USER}" ] && sed -i -e "/##CELLULAR_USER##/d" ${D}${sysconfdir}/NetworkManager/system-connections/nm.cellular + [ -z "${CELLULAR_PASSWORD}" ] && sed -i -e "/##CELLULAR_PASSWORD##/d" ${D}${sysconfdir}/NetworkManager/system-connections/nm.cellular + sed -i -e "s,##CELLULAR_APN##,${CELLULAR_APN},g" \ + -e "s,##CELLULAR_PIN##,${CELLULAR_PIN},g" \ + -e "s,##CELLULAR_USER##,${CELLULAR_USER},g" \ + -e "s,##CELLULAR_PASSWORD##,${CELLULAR_PASSWORD},g" \ + ${D}${sysconfdir}/NetworkManager/system-connections/nm.cellular + fi } # NetworkManager needs to be started after DBUS From d72c3019b9806175334d85ef36372ef5c493ea9d Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 22 May 2017 10:37:38 +0200 Subject: [PATCH 83/95] networkmanager: disable features that depend on X11 library So the package can be compiled in a non-X11 graphical system. https://jira.digi.com/browse/DEL-4289 Signed-off-by: Javier Viguera --- .../networkmanager/networkmanager_1.0.12.bbappend | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend index 2572506a6..0ce3aa24c 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager_1.0.12.bbappend @@ -14,6 +14,11 @@ SRC_URI += " \ file://nm.wlan0.static \ " +# 'polkit' and 'consolekit' require 'x11' distro feature, so disable them for non-X11 distros +DEPENDS_remove = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'polkit', d)}" +PACKAGECONFIG_remove = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'consolekit', d)}" +EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '--enable-polkit=disabled', d)}" + PACKAGECONFIG_remove = "dnsmasq netconfig" PACKAGECONFIG_append = " concheck modemmanager ppp" From 3834dd5065eb5298482b10aae7b10be944777ca6 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 26 May 2017 10:48:20 +0200 Subject: [PATCH 84/95] networkmanager: disable IPv6 by default from connections It's giving a periodic failure in the log file: nm-lndp-rdisc.c:68] send_rs(): (wlan0): cannot send router solicitation: -101. Signed-off-by: Javier Viguera --- .../networkmanager/networkmanager/nm.cellular | 3 +++ .../networkmanager/networkmanager/nm.eth0.dhcp | 3 +++ .../networkmanager/networkmanager/nm.eth0.static | 3 +++ .../networkmanager/networkmanager/nm.eth1.dhcp | 3 +++ .../networkmanager/networkmanager/nm.eth1.static | 3 +++ .../networkmanager/networkmanager/nm.wlan0.dhcp | 3 +++ .../networkmanager/networkmanager/nm.wlan0.static | 3 +++ 7 files changed, 21 insertions(+) diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular index df788cc58..f052a2fbc 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.cellular @@ -8,3 +8,6 @@ number=*99# password=##CELLULAR_PASSWORD## pin=##CELLULAR_PIN## username=##CELLULAR_USER## + +[ipv6] +method=ignore diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp index bf463888d..3889a91be 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.dhcp @@ -5,3 +5,6 @@ interface-name=eth0 [ipv4] method=auto + +[ipv6] +method=ignore diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static index 0b776cc0d..191f5120c 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth0.static @@ -7,3 +7,6 @@ interface-name=eth0 address1=##ETH0_STATIC_CIDR##,##ETH0_STATIC_GATEWAY## dns=##ETH0_STATIC_DNS##; method=manual + +[ipv6] +method=ignore diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp index c7f11b9a1..ef4fdab26 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.dhcp @@ -5,3 +5,6 @@ interface-name=eth1 [ipv4] method=auto + +[ipv6] +method=ignore diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static index deeac0897..c2b0c8fb0 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.eth1.static @@ -7,3 +7,6 @@ interface-name=eth1 address1=##ETH1_STATIC_CIDR##,##ETH1_STATIC_GATEWAY## dns=##ETH1_STATIC_DNS##; method=manual + +[ipv6] +method=ignore diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp index 37918d043..4083247a1 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.dhcp @@ -8,3 +8,6 @@ ssid="" [ipv4] method=auto + +[ipv6] +method=ignore diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static index 0c2006f59..ccf79ba73 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/nm.wlan0.static @@ -10,3 +10,6 @@ ssid="" address1=##WLAN0_STATIC_CIDR##,##WLAN0_STATIC_GATEWAY## dns=##WLAN0_STATIC_DNS##; method=manual + +[ipv6] +method=ignore From 308cb251d396b5090e1c5b10ae543e2ccbf891a4 Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Mon, 26 Jun 2017 11:24:48 +0200 Subject: [PATCH 85/95] wpa-supplicant: enable control socket interface when executed by D-Bus Signed-off-by: Mike Engel --- ...nable-control-socket-interface-when-.patch | 37 +++++++++++++++++++ .../wpa-supplicant/wpa-supplicant_%.bbappend | 3 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-wpa_supplicant-enable-control-socket-interface-when-.patch diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-wpa_supplicant-enable-control-socket-interface-when-.patch b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-wpa_supplicant-enable-control-socket-interface-when-.patch new file mode 100644 index 000000000..2956bf002 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-wpa_supplicant-enable-control-socket-interface-when-.patch @@ -0,0 +1,37 @@ +From: Javier Viguera +Date: Tue, 16 May 2017 18:30:31 +0200 +Subject: [PATCH] wpa_supplicant: enable control socket interface when executed + by D-Bus + +Otherwise trying to use the "wpa_cli" fails with: + +Failed to connect to non-global ctrl_ifname + +Signed-off-by: Javier Viguera +--- + wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in | 2 +- + wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in +index a75918f9380b..9cce6331d92e 100644 +--- a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in ++++ b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in +@@ -1,5 +1,5 @@ + [D-BUS Service] + Name=fi.epitest.hostap.WPASupplicant +-Exec=@BINDIR@/wpa_supplicant -u ++Exec=@BINDIR@/wpa_supplicant -u -O /var/run/wpa_supplicant + User=root + SystemdService=wpa_supplicant.service +diff --git a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in +index d97ff392175d..98b72cf32481 100644 +--- a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in ++++ b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in +@@ -1,5 +1,5 @@ + [D-BUS Service] + Name=fi.w1.wpa_supplicant1 +-Exec=@BINDIR@/wpa_supplicant -u ++Exec=@BINDIR@/wpa_supplicant -u -O /var/run/wpa_supplicant + User=root + SystemdService=wpa_supplicant.service diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend index 24383d38a..bee53d088 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend @@ -1,9 +1,10 @@ -# Copyright (C) 2013 Digi International. +# Copyright (C) 2013-2017 Digi International. FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" PACKAGECONFIG ?= "openssl" +SRC_URI += "file://0001-wpa_supplicant-enable-control-socket-interface-when-.patch" SRC_URI_append_ccimx6ul = " file://wpa_supplicant_p2p.conf" do_install_append_ccimx6ul() { From 27138c983811b04533951c7ac4afd669873f62ef Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Mon, 26 Jun 2017 11:29:09 +0200 Subject: [PATCH 86/95] kernel-module-qualcomm: let udev load wireless module NetworkManager is not able to detect and manage the wireless interface until is actually created, so let udev load the kernel module and create the interface on boot. Signed-off-by: Mike Engel --- .../kernel-module-qualcomm.bb | 10 +- .../kernel-module-qualcomm/80-sdio-qcom.rules | 2 + .../kernel-module-qualcomm/qualcomm-pre-up | 114 ------------------ .../kernel-module-qualcomm/qualcomm.sh | 105 ++++++++++++++++ 4 files changed, 113 insertions(+), 118 deletions(-) create mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/80-sdio-qcom.rules delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up create mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index ef6e6e3c2..f71415430 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -17,8 +17,9 @@ SRC_URI = " \ " SRC_URI_append = " \ - file://qualcomm-pre-up \ + file://80-sdio-qcom.rules \ file://modprobe-qualcomm.conf \ + file://qualcomm.sh \ " S = "${WORKDIR}/git" @@ -38,18 +39,19 @@ do_compile_prepend() { } do_install_append() { - install -d ${D}${sysconfdir}/network/if-pre-up.d - install -m 0755 ${WORKDIR}/qualcomm-pre-up ${D}${sysconfdir}/network/if-pre-up.d/qualcomm install -d ${D}${sysconfdir}/modprobe.d install -m 0644 ${WORKDIR}/modprobe-qualcomm.conf ${D}${sysconfdir}/modprobe.d/qualcomm.conf install -d ${D}${base_libdir}/firmware/wlan/ install -m 0644 ${WORKDIR}/git/firmware_bin/WCNSS_cfg.dat ${D}${base_libdir}/firmware/wlan/cfg.dat install -m 0644 ${WORKDIR}/git/firmware_bin/WCNSS_qcom_cfg.ini ${D}${base_libdir}/firmware/wlan/qcom_cfg.ini + install -d ${D}${sysconfdir}/udev/rules.d ${D}${sysconfdir}/udev/scripts + install -m 0644 ${WORKDIR}/80-sdio-qcom.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 0755 ${WORKDIR}/qualcomm.sh ${D}${sysconfdir}/udev/scripts/ } FILES_${PN} += " \ - ${sysconfdir}/network/if-pre-up.d/qualcomm \ ${sysconfdir}/modprobe.d/qualcomm.conf \ + ${sysconfdir}/udev/ \ ${base_libdir}/firmware/wlan/cfg.dat \ ${base_libdir}/firmware/wlan/qcom_cfg.ini \ " diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/80-sdio-qcom.rules b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/80-sdio-qcom.rules new file mode 100644 index 000000000..1eb47fabd --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/80-sdio-qcom.rules @@ -0,0 +1,2 @@ +# Load Qualcomm wireless module +SUBSYSTEM=="sdio", ACTION=="add", ENV{MODALIAS}=="sdio:c00v0271d050A" RUN+="/etc/udev/scripts/qualcomm.sh" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up deleted file mode 100644 index 3c1cccdeb..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# qualcomm-pre-up -# -# Copyright (C) 2016 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: Load Qualcomm' wireless driver -# -#=============================================================================== - -[ "${IFACE}" != "wlan0" ] && [ "${IFACE}" != "p2p0" ] && exit 0 - -# If the qualcomm driver is already loaded exit -grep -qws 'wlan' /proc/modules && exit 0 - -FIRMWARE_DIR="/lib/firmware" -MACFILE="${FIRMWARE_DIR}/wlan/wlan_mac.bin" -TMP_MACFILE="$(mktemp -t wlan_mac.XXXXXX)" - -# Read the MACs from DeviceTree. We can have up to four wireless interfaces -# The only required one is wlan0 that is mapped with device tree mac address -# without suffix. -for index in $(seq 0 3); do - DT_WLANx_MAC="/proc/device-tree/wireless/mac-address" - if [ "${index}" = "0" ]; then - # Set a default MAC for wlan0 - MAC_ADDR="00:04:F3:FF:FF:FB" - else - # Add the interface suffix for the device tree node - DT_WLANx_MAC=${DT_WLANx_MAC}${index} - MAC_ADDR="" - fi - - if [ -f "${DT_WLANx_MAC}" ]; then - MAC_ADDR="$(hexdump -ve '1/1 "%02X" ":"' ${DT_WLANx_MAC} | sed 's/:$//g')" - fi - - # Dump the MAC address in a file with the expected firmware format. - # example: Intf0MacAddress=0004f3fffffb - echo "Intf${index}MacAddress=${MAC_ADDR}" | sed s/://g >> ${TMP_MACFILE} -done - -# Override the MAC firmware file only if the MAC file has changed. -if ! cmp -s ${TMP_MACFILE} ${MACFILE}; then - cp ${TMP_MACFILE} ${MACFILE} -fi -rm -f ${TMP_MACFILE} - -OTP_REGION_CODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null)" -DTB_REGION_CODE="$(cat /proc/device-tree/wireless/regulatory-domain 2>/dev/null)" -US_CODE="0x0" -WW_CODE="0x1" -JP_CODE="0x2" -# Check if the DTB_REGION_CODE is in the list of valid codes, -# if not use the OTP programmed value. -case "${DTB_REGION_CODE}" in - ${US_CODE}|${WW_CODE}|${JP_CODE}) - REGULATORY_DOMAIN=${DTB_REGION_CODE};; - *) - if [ -n "${DTB_REGION_CODE}" ]; then - logger -t qca6564 "[ERROR] Invalid region code in device tree, using OTP value" - fi - REGULATORY_DOMAIN=${OTP_REGION_CODE};; -esac - -BDATA_LINK="${FIRMWARE_DIR}/bdwlan30.bin" -UTFBDATA_LINK="${FIRMWARE_DIR}/utfbd30.bin" -# Create a symbolic links to the FW files for the specific country region. -BDATA_SOURCE="${FIRMWARE_DIR}/bdwlan30_US.bin" -case "${REGULATORY_DOMAIN}" in - ${US_CODE}) - logger -t qca6564 "Setting US wireless region";; - ${WW_CODE}|${JP_CODE}) - if [ -e "${FIRMWARE_DIR}/bdwlan30_World.bin" ]; then - logger -t qca6564 "Setting WW (world wide) wireless region" - BDATA_SOURCE="${FIRMWARE_DIR}/bdwlan30_World.bin" - else - logger -t qca6564 "[WARN] No WW (worldwide) board data file, using US" - fi - ;; - "") - logger -t qca6564 "[WARN] region code not found, using US";; - *) - logger -t qca6564 "[WARN] Invalid region code, using US";; -esac - -# We don't want to rewrite NAND every time we boot so only -# change the links if they are wrong. -if [ ! -e "${BDATA_LINK}" ] || ! cmp -s "${BDATA_LINK}" "${BDATA_SOURCE}"; then - ln -sf "${BDATA_SOURCE}" "${BDATA_LINK}" - ln -sf "${BDATA_SOURCE}" "${UTFBDATA_LINK}" -fi - -# Check the version of modprobe installed to compound the arguments. -if readlink -f $(which modprobe) | grep -qs kmod; then - MODPROBE_ARGS="-i" -fi -# Load the wireless module with the params defined in modprobe.d/qualcomm.conf -modprobe ${MODPROBE_ARGS} wlan - -# Validate that firmware was loaded by checking if the interface is present. -if [ -d "/sys/class/net/${IFACE}" ]; then - echo "Loading qca6564 module: [OK]" -else - echo "Loading qca6564 module: [FAILED]" - exit 1 -fi diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh new file mode 100644 index 000000000..d387bc667 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh @@ -0,0 +1,105 @@ +#!/bin/sh +# +# Copyright (c) 2017, Digi International Inc. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +# Do nothing if the module is already loaded +grep -qws 'wlan' /proc/modules && exit 0 + +FIRMWARE_DIR="/lib/firmware" +MACFILE="${FIRMWARE_DIR}/wlan/wlan_mac.bin" +TMP_MACFILE="$(mktemp -t wlan_mac.XXXXXX)" + +# Read the MACs from DeviceTree. We can have up to four wireless interfaces +# The only required one is wlan0 that is mapped with device tree mac address +# without suffix. +for index in $(seq 0 3); do + MAC_ADDR="$(hexdump -ve '1/1 "%02X"' /proc/device-tree/wireless/mac-address${index%0} 2>/dev/null)" + if [ "${index}" = "0" ] && { [ -z "${MAC_ADDR}" ] || [ "${MAC_ADDR}" = "00:00:00:00:00:00" ]; }; then + # Set a default MAC for wlan0 + MAC_ADDR="0004F3FFFFFB" + fi + + # Add the MAC address to the firmware file with the expected format + echo "Intf${index}MacAddress=${MAC_ADDR}" >> ${TMP_MACFILE} +done + +# Override the MAC firmware file only if the MAC file has changed. +if ! cmp -s ${TMP_MACFILE} ${MACFILE}; then + cp ${TMP_MACFILE} ${MACFILE} +fi +rm -f "${TMP_MACFILE}" + +OTP_REGION_CODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null)" +DTB_REGION_CODE="$(cat /proc/device-tree/wireless/regulatory-domain 2>/dev/null)" +US_CODE="0x0" +WW_CODE="0x1" +JP_CODE="0x2" +# Check if the DTB_REGION_CODE is in the list of valid codes, +# if not use the OTP programmed value. +case "${DTB_REGION_CODE}" in + ${US_CODE} | ${WW_CODE} | ${JP_CODE}) + REGULATORY_DOMAIN="${DTB_REGION_CODE}";; + *) + if [ -n "${DTB_REGION_CODE}" ]; then + logger -t qca6564 "[WARN] Invalid region code in device tree, using OTP value" + fi + REGULATORY_DOMAIN="${OTP_REGION_CODE}";; +esac + + +# Create symbolic links to the proper FW files depending on the country region +# Use a sub-shell here to change to firmware directory +( + cd "${FIRMWARE_DIR}" + + BDATA_SOURCE="bdwlan30_US.bin" + case "${REGULATORY_DOMAIN}" in + ${US_CODE}) + logger -t qca6564 "Setting US wireless region";; + ${WW_CODE}|${JP_CODE}) + if [ -f "bdwlan30_World.bin" ]; then + logger -t qca6564 "Setting WW (world wide) wireless region" + BDATA_SOURCE="bdwlan30_World.bin" + else + logger -t qca6564 "[WARN] No WW (worldwide) board data file, using US" + fi + ;; + "") + logger -t qca6564 "[WARN] region code not found, using US";; + *) + logger -t qca6564 "[WARN] Invalid region code, using US";; + esac + + # We don't want to rewrite NAND every time we boot so only + # change the links if they are wrong. + BDATA_LINK="bdwlan30.bin" + UTFBDATA_LINK="utfbd30.bin" + if [ ! -e "${BDATA_LINK}" ] || ! cmp -s "${BDATA_LINK}" "${BDATA_SOURCE}"; then + ln -sf "${BDATA_SOURCE}" "${BDATA_LINK}" + ln -sf "${BDATA_SOURCE}" "${UTFBDATA_LINK}" + fi +) + +# Check the version of modprobe installed to compound the arguments. +if readlink -f $(which modprobe) | grep -qs kmod; then + MODPROBE_ARGS="-i" +fi + +# Load the wireless module with the params defined in modprobe.d/qualcomm.conf +modprobe ${MODPROBE_ARGS} wlan + +# Verify the interface is present +[ -d "/sys/class/net/wlan0" ] || logger -t qca6564 "[ERROR] Loading qca6564 module" From 308d9c02ceea701f94ca46feee44dab0b353708a Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Mon, 26 Jun 2017 11:42:03 +0200 Subject: [PATCH 87/95] init-ifupdown: remove interfaces managed by Networkmanager This commit removes the interfaces that are managed by Networkmanager from the /etc/network/interfaces entry. Signed-off-by: Mike Engel --- .../ccimx6ul/interfaces.wlan0.dhcp | 7 -- .../ccimx6ul/interfaces.wlan0.static | 10 --- .../init-ifupdown-1.0/interfaces.cellular | 9 --- .../init-ifupdown-1.0/interfaces.eth0.dhcp | 4 - .../init-ifupdown-1.0/interfaces.eth0.static | 7 -- .../init-ifupdown-1.0/interfaces.eth1.dhcp | 4 - .../init-ifupdown-1.0/interfaces.eth1.static | 7 -- .../init-ifupdown-1.0/interfaces.wlan0.dhcp | 8 -- .../init-ifupdown-1.0/interfaces.wlan0.static | 11 --- .../init-ifupdown/init-ifupdown_1.0.bbappend | 73 ------------------- 10 files changed, 140 deletions(-) delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.dhcp delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.static delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.cellular delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.dhcp delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.static delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.dhcp delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.static delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.dhcp delete mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.static diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.dhcp b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.dhcp deleted file mode 100644 index c31b678e1..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.dhcp +++ /dev/null @@ -1,7 +0,0 @@ - -auto wlan0 -iface wlan0 inet dhcp - udhcpc_opts -S -b >/dev/null & - wpa-driver ##WPA_DRIVER## - wpa-conf /etc/wpa_supplicant.conf - post-up /bin/virtwlans.sh diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.static b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.static deleted file mode 100644 index f49d9fd82..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/interfaces.wlan0.static +++ /dev/null @@ -1,10 +0,0 @@ - -auto wlan0 -iface wlan0 inet static - address ##WLAN0_STATIC_IP## - netmask ##WLAN0_STATIC_NETMASK## - gateway ##WLAN0_STATIC_GATEWAY## - dns-nameservers ##WLAN0_STATIC_DNS## - wpa-driver ##WPA_DRIVER## - wpa-conf /etc/wpa_supplicant.conf - post-up /bin/virtwlans.sh diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.cellular b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.cellular deleted file mode 100644 index 1afe87e86..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.cellular +++ /dev/null @@ -1,9 +0,0 @@ - -# Cellular interface -#auto ##CELLULAR_INTERFACE## -iface ##CELLULAR_INTERFACE## inet manual - port - apn - pin - user - password diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.dhcp b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.dhcp deleted file mode 100644 index dd290cc5f..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.dhcp +++ /dev/null @@ -1,4 +0,0 @@ - -auto eth0 -iface eth0 inet dhcp - udhcpc_opts -S -b >/dev/null & diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.static b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.static deleted file mode 100644 index 70e73c131..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth0.static +++ /dev/null @@ -1,7 +0,0 @@ - -auto eth0 -iface eth0 inet static - address ##ETH0_STATIC_IP## - netmask ##ETH0_STATIC_NETMASK## - gateway ##ETH0_STATIC_GATEWAY## - dns-nameservers ##ETH0_STATIC_DNS## diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.dhcp b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.dhcp deleted file mode 100644 index 201900537..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.dhcp +++ /dev/null @@ -1,4 +0,0 @@ - -auto eth1 -iface eth1 inet dhcp - udhcpc_opts -S -b >/dev/null & diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.static b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.static deleted file mode 100644 index 538d46cf6..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.eth1.static +++ /dev/null @@ -1,7 +0,0 @@ - -auto eth1 -iface eth1 inet static - address ##ETH1_STATIC_IP## - netmask ##ETH1_STATIC_NETMASK## - gateway ##ETH1_STATIC_GATEWAY## - dns-nameservers ##ETH1_STATIC_DNS## diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.dhcp b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.dhcp deleted file mode 100644 index 60d3f4750..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.dhcp +++ /dev/null @@ -1,8 +0,0 @@ - -auto wlan0 -iface wlan0 inet dhcp - udhcpc_opts -S -b >/dev/null & - wpa-driver ##WPA_DRIVER## - wpa-conf /etc/wpa_supplicant.conf - # post-up /etc/init.d/hostapd start - # pre-down /etc/init.d/hostapd stop diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.static b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.static deleted file mode 100644 index ddb10dd87..000000000 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.wlan0.static +++ /dev/null @@ -1,11 +0,0 @@ - -auto wlan0 -iface wlan0 inet static - address ##WLAN0_STATIC_IP## - netmask ##WLAN0_STATIC_NETMASK## - gateway ##WLAN0_STATIC_GATEWAY## - dns-nameservers ##WLAN0_STATIC_DNS## - wpa-driver ##WPA_DRIVER## - wpa-conf /etc/wpa_supplicant.conf - # post-up /etc/init.d/hostapd start - # pre-down /etc/init.d/hostapd stop diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend index 99a1c3890..60cd13e5d 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend @@ -7,14 +7,7 @@ INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 80 0 6 1 ." SRC_URI_append = " \ file://interfaces.br0.example \ - file://interfaces.eth0.static \ - file://interfaces.eth0.dhcp \ - file://interfaces.eth1.static \ - file://interfaces.eth1.dhcp \ - file://interfaces.wlan0.static \ - file://interfaces.wlan0.dhcp \ file://interfaces.p2p \ - file://interfaces.cellular \ file://resolv \ " @@ -30,12 +23,7 @@ do_install_append() { # Install DNS servers handler install -m 0755 ${WORKDIR}/resolv ${D}${sysconfdir}/network/if-up.d/resolv - # Create 'interfaces' file dynamically - cat ${WORKDIR}/interfaces.eth0.${ETH0_MODE} >> ${D}${sysconfdir}/network/interfaces - [ -n "${HAVE_SECOND_ETH}" ] && cat ${WORKDIR}/interfaces.eth1.${ETH1_MODE} >> ${D}${sysconfdir}/network/interfaces - if [ -n "${HAVE_WIFI}" ]; then - cat ${WORKDIR}/interfaces.wlan0.${WLAN0_MODE} >> ${D}${sysconfdir}/network/interfaces if [ -n "${WLAN_P2P_INTERFACE}" ]; then cat ${WORKDIR}/interfaces.p2p >> ${D}${sysconfdir}/network/interfaces [ -n "${WLAN_P2P_AUTO}" ] && sed -i -e 's/^#auto ##WLAN_P2P_INTERFACE##/auto ##WLAN_P2P_INTERFACE##/g' ${D}${sysconfdir}/network/interfaces @@ -45,73 +33,12 @@ do_install_append() { cat ${WORKDIR}/interfaces.br0.example >> ${D}${sysconfdir}/network/interfaces # Remove config entries if corresponding variable is not defined - [ -z "${ETH0_STATIC_DNS}" ] && sed -i -e "/##ETH0_STATIC_DNS##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${ETH0_STATIC_GATEWAY}" ] && sed -i -e "/##ETH0_STATIC_GATEWAY##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${ETH0_STATIC_IP}" ] && sed -i -e "/##ETH0_STATIC_IP##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${ETH0_STATIC_NETMASK}" ] && sed -i -e "/##ETH0_STATIC_NETMASK##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${ETH1_STATIC_DNS}" ] && sed -i -e "/##ETH1_STATIC_DNS##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${ETH1_STATIC_GATEWAY}" ] && sed -i -e "/##ETH1_STATIC_GATEWAY##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${ETH1_STATIC_IP}" ] && sed -i -e "/##ETH1_STATIC_IP##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${ETH1_STATIC_NETMASK}" ] && sed -i -e "/##ETH1_STATIC_NETMASK##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${WLAN0_STATIC_DNS}" ] && sed -i -e "/##WLAN0_STATIC_DNS##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${WLAN0_STATIC_GATEWAY}" ] && sed -i -e "/##WLAN0_STATIC_GATEWAY##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${WLAN0_STATIC_IP}" ] && sed -i -e "/##WLAN0_STATIC_IP##/d" ${D}${sysconfdir}/network/interfaces - [ -z "${WLAN0_STATIC_NETMASK}" ] && sed -i -e "/##WLAN0_STATIC_NETMASK##/d" ${D}${sysconfdir}/network/interfaces [ -z "${P2P0_STATIC_DNS}" ] && sed -i -e "/##P2P0_STATIC_DNS##/d" ${D}${sysconfdir}/network/interfaces [ -z "${P2P0_STATIC_GATEWAY}" ] && sed -i -e "/##P2P0_STATIC_GATEWAY##/d" ${D}${sysconfdir}/network/interfaces [ -z "${P2P0_STATIC_IP}" ] && sed -i -e "/##P2P0_STATIC_IP##/d" ${D}${sysconfdir}/network/interfaces [ -z "${P2P0_STATIC_NETMASK}" ] && sed -i -e "/##P2P0_STATIC_NETMASK##/d" ${D}${sysconfdir}/network/interfaces - # Cellular interface - if [ -n "${@bb.utils.contains('DISTRO_FEATURES', 'cellular', '1', '', d)}" ] && [ -n "${CELLULAR_INTERFACE}" ]; then - cat ${WORKDIR}/interfaces.cellular >> ${D}${sysconfdir}/network/interfaces - [ -n "${CELLULAR_AUTO}" ] && sed -i -e 's/^#auto ##CELLULAR_INTERFACE##/auto ##CELLULAR_INTERFACE##/g' ${D}${sysconfdir}/network/interfaces - sed -i -e 's,##CELLULAR_INTERFACE##,${CELLULAR_INTERFACE},g' ${D}${sysconfdir}/network/interfaces - - if [ -n "${CELLULAR_APN}" ]; then - sed -i -e 's/^\([[:blank:]]*\)apn/\1apn ${CELLULAR_APN}/g' ${D}${sysconfdir}/network/interfaces - else - sed -i -e '/^[[:blank:]]*apn/d' ${D}${sysconfdir}/network/interfaces - fi - - if [ -n "${CELLULAR_PIN}" ]; then - sed -i -e 's/^\([[:blank:]]*\)pin/\1pin ${CELLULAR_PIN}/g' ${D}${sysconfdir}/network/interfaces - else - sed -i -e '/^[[:blank:]]*pin/d' ${D}${sysconfdir}/network/interfaces - fi - - if [ -n "${CELLULAR_PORT}" ]; then - sed -i -e 's/^\([[:blank:]]*\)port/\1port ${CELLULAR_PORT}/g' ${D}${sysconfdir}/network/interfaces - else - sed -i -e '/^[[:blank:]]*port/d' ${D}${sysconfdir}/network/interfaces - fi - - if [ -n "${CELLULAR_USER}" ]; then - sed -i -e 's/^\([[:blank:]]*\)user/\1user ${CELLULAR_USER}/g' ${D}${sysconfdir}/network/interfaces - else - sed -i -e '/^[[:blank:]]*user/d' ${D}${sysconfdir}/network/interfaces - fi - - if [ -n "${CELLULAR_PASSWORD}" ]; then - sed -i -e 's/^\([[:blank:]]*\)password/\1password ${CELLULAR_PASSWORD}/g' ${D}${sysconfdir}/network/interfaces - else - sed -i -e '/^[[:blank:]]*password/d' ${D}${sysconfdir}/network/interfaces - fi - fi - # Replace interface parameters - sed -i -e "s,##ETH0_STATIC_IP##,${ETH0_STATIC_IP},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##ETH0_STATIC_NETMASK##,${ETH0_STATIC_NETMASK},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##ETH0_STATIC_GATEWAY##,${ETH0_STATIC_GATEWAY},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##ETH0_STATIC_DNS##,${ETH0_STATIC_DNS},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##ETH1_STATIC_IP##,${ETH1_STATIC_IP},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##ETH1_STATIC_NETMASK##,${ETH1_STATIC_NETMASK},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##ETH1_STATIC_GATEWAY##,${ETH1_STATIC_GATEWAY},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##ETH1_STATIC_DNS##,${ETH1_STATIC_DNS},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##WLAN0_STATIC_IP##,${WLAN0_STATIC_IP},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##WLAN0_STATIC_NETMASK##,${WLAN0_STATIC_NETMASK},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##WLAN0_STATIC_GATEWAY##,${WLAN0_STATIC_GATEWAY},g" ${D}${sysconfdir}/network/interfaces - sed -i -e "s,##WLAN0_STATIC_DNS##,${WLAN0_STATIC_DNS},g" ${D}${sysconfdir}/network/interfaces sed -i -e "s,##P2P0_STATIC_IP##,${P2P0_STATIC_IP},g" ${D}${sysconfdir}/network/interfaces sed -i -e "s,##P2P0_STATIC_NETMASK##,${P2P0_STATIC_NETMASK},g" ${D}${sysconfdir}/network/interfaces sed -i -e "s,##P2P0_STATIC_GATEWAY##,${P2P0_STATIC_GATEWAY},g" ${D}${sysconfdir}/network/interfaces From 58c5fe96c8cfe68a4099e9e0ae9f8dcf36e7f811 Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Mon, 26 Jun 2017 15:45:16 +0200 Subject: [PATCH 88/95] networkmanager: add unmanaged devices to NetworkManager config file Signed-off-by: Mike Engel --- .../networkmanager/networkmanager/NetworkManager.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf index 8ecb93545..6739bb39f 100644 --- a/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf +++ b/meta-digi-dey/recipes-connectivity/networkmanager/networkmanager/NetworkManager.conf @@ -4,3 +4,6 @@ no-auto-default=type:ethernet [ifupdown] managed=false + +[keyfile] +unmanaged-devices=interface-name:p2p0;interface-name:wlan1 From baddd28fc8e80b6d855b44022484881a3ba85f1d Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Mon, 3 Jul 2017 17:46:03 +0200 Subject: [PATCH 89/95] packagegroup-dey-core: add networkmanager package Signed-off-by: Mike Engel --- .../recipes-core/packagegroups/packagegroup-dey-core.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index 63bd88c4a..2a4613cc1 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -39,6 +39,7 @@ RDEPENDS_${PN} = "\ init-ifupdown \ modutils-initscripts \ netbase \ + networkmanager \ os-release \ recovery-utils \ sysinfo \ From 9329e5681b35fc55ec58158ce3f5d5afcb8a3c64 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 5 Jul 2017 10:25:14 +0200 Subject: [PATCH 90/95] kernel-module-qualcomm: fix two udev rules managing qcom wireless driver Udev comes with a bunch of generic rules for the hardware. One of them: /lib/udev/rules.d/80-drivers.rules is able to load the qualcomm wireless module. At the same time our new rule is needed, so it prepares the firmware before the module is loaded. Both rules running collide with following error message: udevd[181]: '/etc/udev/scripts/qualcomm.sh' [184] terminated by signal 1 (Hangup) So to fix this, we rename the specific rule so it's parsed later, and then we use the hard assignation '=' instead of '+=' to override the values that come from the previous parsed rule. Also clean-up a bit the 'qualcomm.sh' script and the modprobe file, given that now we know the standard drivers rule won't run for this interface. Signed-off-by: Javier Viguera --- .../kernel-module-qualcomm/kernel-module-qualcomm.bb | 4 ++-- .../{80-sdio-qcom.rules => 81-sdio-qcom.rules} | 2 +- .../kernel-module-qualcomm/modprobe-qualcomm.conf | 1 - .../kernel-module-qualcomm/qualcomm.sh | 7 +------ 4 files changed, 4 insertions(+), 10 deletions(-) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{80-sdio-qcom.rules => 81-sdio-qcom.rules} (69%) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index f71415430..e65ff29f5 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -17,7 +17,7 @@ SRC_URI = " \ " SRC_URI_append = " \ - file://80-sdio-qcom.rules \ + file://81-sdio-qcom.rules \ file://modprobe-qualcomm.conf \ file://qualcomm.sh \ " @@ -45,7 +45,7 @@ do_install_append() { install -m 0644 ${WORKDIR}/git/firmware_bin/WCNSS_cfg.dat ${D}${base_libdir}/firmware/wlan/cfg.dat install -m 0644 ${WORKDIR}/git/firmware_bin/WCNSS_qcom_cfg.ini ${D}${base_libdir}/firmware/wlan/qcom_cfg.ini install -d ${D}${sysconfdir}/udev/rules.d ${D}${sysconfdir}/udev/scripts - install -m 0644 ${WORKDIR}/80-sdio-qcom.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 0644 ${WORKDIR}/81-sdio-qcom.rules ${D}${sysconfdir}/udev/rules.d/ install -m 0755 ${WORKDIR}/qualcomm.sh ${D}${sysconfdir}/udev/scripts/ } diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/80-sdio-qcom.rules b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/81-sdio-qcom.rules similarity index 69% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/80-sdio-qcom.rules rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/81-sdio-qcom.rules index 1eb47fabd..a69152b59 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/80-sdio-qcom.rules +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/81-sdio-qcom.rules @@ -1,2 +1,2 @@ # Load Qualcomm wireless module -SUBSYSTEM=="sdio", ACTION=="add", ENV{MODALIAS}=="sdio:c00v0271d050A" RUN+="/etc/udev/scripts/qualcomm.sh" +SUBSYSTEM=="sdio", ACTION=="add", ENV{MODALIAS}=="sdio:c00v0271d050A", RUN="/etc/udev/scripts/qualcomm.sh" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/modprobe-qualcomm.conf b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/modprobe-qualcomm.conf index 313d88b5c..13852c0cd 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/modprobe-qualcomm.conf +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/modprobe-qualcomm.conf @@ -1,4 +1,3 @@ -install wlan true # Load the wlan module with values for SDIO3.0. options wlan asyncintdelay=0x2 writecccr1=0xf2 writecccr1value=0xf \ writecccr2=0xf1 writecccr2value=0xa8 writecccr3=0xf0 \ diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh index d387bc667..3bb5331ea 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh @@ -93,13 +93,8 @@ esac fi ) -# Check the version of modprobe installed to compound the arguments. -if readlink -f $(which modprobe) | grep -qs kmod; then - MODPROBE_ARGS="-i" -fi - # Load the wireless module with the params defined in modprobe.d/qualcomm.conf -modprobe ${MODPROBE_ARGS} wlan +modprobe wlan # Verify the interface is present [ -d "/sys/class/net/wlan0" ] || logger -t qca6564 "[ERROR] Loading qca6564 module" From 092305e8f6a868a751b646ab63c5c057c2456467 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 5 Jul 2017 12:39:17 +0200 Subject: [PATCH 91/95] modemmanager: remove cellularifupdown script The cellular interface is now managed by NetworkManager, so there is no need for this custom script. Signed-off-by: Javier Viguera --- .../modemmanager/cellularifupdown | 65 ------------------- .../modemmanager/modemmanager_%.bbappend | 6 -- 2 files changed, 71 deletions(-) delete mode 100644 meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown deleted file mode 100644 index 15e993c8d..000000000 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -RETRIES=12 -POLLING_WAIT=5 - -# Run only for cellular network interfaces -[ -z "${IF_APN}" ] && exit 0 - -background_connect() { - # The XBee Cellular needs more time to settle down before MM is able - # to detect it. As the XBee is connected to a 'ttymxc' serial port, - # we check those ports to conditionally delay the launch of MM. - if echo "${IF_PORT}" | grep -qs ttymxc; then - sleep 25 - fi - - # Ensure ModemManager is running - killall -0 ModemManager 2>/dev/null || ModemManager --log-file=/var/log/modemmanager.log & - - # Wait for modem detection - while [ "${RETRIES}" -gt "0" ]; do - mmcli -m 0 > /dev/null 2>&1 && break - sleep ${POLLING_WAIT} - RETRIES="$((RETRIES - 1))" - done - - # Abort if no modem detected - if [ "$RETRIES" -eq "0" ]; then - logger -s -p error -t modemmanager "No modem detected"; - exit - fi - - ARGS="apn=${IF_APN}" - [ -n "${IF_PIN}" ] && ARGS="${ARGS},pin=${IF_PIN}" - - [ -n "${IF_USER}" ] && ARGS="${ARGS},user=${IF_USER}" - [ -n "${IF_PASSWORD}" ] && ARGS="${ARGS},password=${IF_PASSWORD}" - [ -n "${IF_PORT}" ] && ARGS="${ARGS},number=*99#" - - # Enable the modem and connect to provider - mmcli -m 0 --simple-connect=${ARGS} > /dev/null 2>&1 - - # For serial modems, pppd creates the network interface - # Otherwise, get an IP with udhcpc - if [ -n "${IF_PORT}" ]; then - pppd ${IF_PORT} call mm_cellular > /dev/null 2>&1 - else - udhcpc -q -i ${IFACE} >/dev/null - fi - - ifconfig ${IFACE} up -} - - -if [ "$MODE" = "start" ]; then - background_connect & -elif [ "$MODE" = "stop" ]; then - # If a call number was used, destroy the network interface - [ -n "${IF_PORT}" ] && poff mm_cellular - - ifconfig ${IFACE} down - - # Disconnect and disable the modem - mmcli -m 0 -d > /dev/null 2>&1 -fi diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend index 1a67116d7..b1d763aea 100644 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend @@ -3,7 +3,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI += " \ - file://cellularifupdown \ file://78-mm-digi-xbee-cellular.rules \ " @@ -13,11 +12,6 @@ SRC_URI += " \ PACKAGECONFIG_remove = " polkit" do_install_append() { - # Install ifupdown script for cellular interfaces - install -d ${D}${sysconfdir}/network/if-pre-up.d/ ${D}${sysconfdir}/network/if-post-down.d/ - install -m 0755 ${WORKDIR}/cellularifupdown ${D}${sysconfdir}/network/if-pre-up.d/ - ln -sf ../if-pre-up.d/cellularifupdown ${D}${sysconfdir}/network/if-post-down.d/cellularifupdown - # Install udev rules for XBee cellular install -d ${D}${nonarch_base_libdir}/udev/rules.d install -m 0644 ${WORKDIR}/78-mm-digi-xbee-cellular.rules ${D}${nonarch_base_libdir}/udev/rules.d/ From a5ae6a5b3c5f53044fa33877ec68e6f8745d0431 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 5 Jul 2017 19:38:11 +0200 Subject: [PATCH 92/95] kernel-module-qualcomm: create wlan virtual interface Use the same udev script that loads the qualcomm wireless module to create the 'wlan1' virtual interface. https://jira.digi.com/browse/DEL-4453 Signed-off-by: Javier Viguera --- .../kernel-module-qualcomm/qualcomm.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh index 3bb5331ea..acf2e6841 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh @@ -97,4 +97,9 @@ esac modprobe wlan # Verify the interface is present -[ -d "/sys/class/net/wlan0" ] || logger -t qca6564 "[ERROR] Loading qca6564 module" +if [ -d "/sys/class/net/wlan0" ]; then + # Create 'wlan1' virtual interface + virtwlans.sh +else + logger -t qca6564 "[ERROR] Loading qca6564 module" +fi From 6ffd69da82f8961819e35470f99b2cfff78bae6f Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 6 Jul 2017 14:01:24 +0200 Subject: [PATCH 93/95] kernel-module-qualcomm: use kernel log buffer for logging At the point this script is run (from udev) the system log is not yet available, so use the kernel log buffer instead. Signed-off-by: Javier Viguera --- .../kernel-module-qualcomm/qualcomm.sh | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh index acf2e6841..71d81f3d5 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm.sh @@ -15,6 +15,12 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +# At this point of the boot (udev script), the system log (syslog) is not +# available yet, so use the kernel log buffer from userspace. +log() { + printf "<5>qca6564: $1\n" >/dev/kmsg +} + # Do nothing if the module is already loaded grep -qws 'wlan' /proc/modules && exit 0 @@ -54,7 +60,7 @@ case "${DTB_REGION_CODE}" in REGULATORY_DOMAIN="${DTB_REGION_CODE}";; *) if [ -n "${DTB_REGION_CODE}" ]; then - logger -t qca6564 "[WARN] Invalid region code in device tree, using OTP value" + log "[WARN] Invalid region code in device tree, using OTP value" fi REGULATORY_DOMAIN="${OTP_REGION_CODE}";; esac @@ -68,19 +74,19 @@ esac BDATA_SOURCE="bdwlan30_US.bin" case "${REGULATORY_DOMAIN}" in ${US_CODE}) - logger -t qca6564 "Setting US wireless region";; + log "Setting US wireless region";; ${WW_CODE}|${JP_CODE}) if [ -f "bdwlan30_World.bin" ]; then - logger -t qca6564 "Setting WW (world wide) wireless region" + log "Setting WW (world wide) wireless region" BDATA_SOURCE="bdwlan30_World.bin" else - logger -t qca6564 "[WARN] No WW (worldwide) board data file, using US" + log "[WARN] No WW (worldwide) board data file, using US" fi ;; "") - logger -t qca6564 "[WARN] region code not found, using US";; + log "[WARN] region code not found, using US";; *) - logger -t qca6564 "[WARN] Invalid region code, using US";; + log "[WARN] Invalid region code, using US";; esac # We don't want to rewrite NAND every time we boot so only @@ -101,5 +107,5 @@ if [ -d "/sys/class/net/wlan0" ]; then # Create 'wlan1' virtual interface virtwlans.sh else - logger -t qca6564 "[ERROR] Loading qca6564 module" + log "[ERROR] Loading qca6564 module" fi From eb76b2ac687557ba7bce65a942fec2df95b094fd Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 6 Jul 2017 20:16:26 +0200 Subject: [PATCH 94/95] suspend: adapt script for NetworkManager integration Now the suspend script brings down all the wireless interfaces that are managed by ifupdown command (in the '/etc/network/interfaces' file) and then unloads the wireless driver. On resume the script triggers an event so udev reloads the wireless driver and then brings up the interfaces that were brought down on suspend. https://jira.digi.com/browse/DEL-4288 Signed-off-by: Javier Viguera --- .../busybox/busybox-1.24.1/ccimx6/suspend | 22 +++++++++++----- .../busybox/busybox-1.24.1/ccimx6ul/suspend | 25 ++++++++++++------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend index ceded7b74..65aeed292 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend @@ -31,9 +31,12 @@ usage() { } suspend_interfaces() { - # Suspend wireless interface - if grep -qs '^wlan0' /var/run/ifstate; then - ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod ath6kl_sdio + # Suspend wireless interfaces + if [ -d "/proc/device-tree/wireless" ]; then + for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do + ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" + done + grep -qs '^ath6kl_sdio' /proc/modules && rmmod ath6kl_sdio ath6kl_core fi # Suspend bluetooth interface @@ -43,9 +46,16 @@ suspend_interfaces() { } resume_interfaces() { - # Resume wireless interface - if ! grep -qs '^wlan0' /var/run/ifstate; then - [ -n "${up_wlan_on_resume}" ] && modprobe ath6kl_sdio && sleep 0.5 && ifup wlan0 + # Resume wireless interfaces + if [ -d "/proc/device-tree/wireless" ]; then + # Trigger wireless module loading event, and wait until the interface exists + udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d0301" + timeout -t 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null + + # Bring up the interfaces that were bring down on suspend + for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do + grep -qs "^${i}" /var/run/ifstate || ifup "${i}" + done fi # Resume bluetooth interface diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend index 33086f979..25b286c14 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend @@ -31,12 +31,12 @@ usage() { } suspend_interfaces() { - # Suspend wireless interface - if grep -qs '^wlan0' /var/run/ifstate; then - ifdown wlan0 && up_wlan_on_resume="1" - fi - if grep -qs '^wlan' /proc/modules; then - rmmod wlan + # Suspend wireless interfaces + if [ -d "/proc/device-tree/wireless" ]; then + for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do + ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" + done + grep -qs '^wlan' /proc/modules && rmmod wlan fi # Suspend bluetooth interface @@ -46,9 +46,16 @@ suspend_interfaces() { } resume_interfaces() { - # Resume wireless interface - if ! grep -qs '^wlan0' /var/run/ifstate; then - [ -n "${up_wlan_on_resume}" ] && ifup wlan0 + # Resume wireless interfaces + if [ -d "/proc/device-tree/wireless" ]; then + # Trigger wireless module loading event, and wait until the interface exists + udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" + timeout -t 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null + + # Bring up the interfaces that were bring down on suspend + for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do + grep -qs "^${i}" /var/run/ifstate || ifup "${i}" + done fi # Resume bluetooth interface From f94e039cc849db7338ae5e30d2b6758de11b7a59 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 7 Jul 2017 12:40:53 +0200 Subject: [PATCH 95/95] suspend: check module variant before bringing down/up BT interface Signed-off-by: Javier Viguera --- .../busybox/busybox-1.24.1/ccimx6/suspend | 16 ++++++++++------ .../busybox/busybox-1.24.1/ccimx6ul/suspend | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend index 65aeed292..140645eea 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend @@ -40,9 +40,11 @@ suspend_interfaces() { fi # Suspend bluetooth interface - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" + ${BT_DAEMON} stop >/dev/null + ${BT_INIT} stop >/dev/null + fi } resume_interfaces() { @@ -59,9 +61,11 @@ resume_interfaces() { fi # Resume bluetooth interface - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + if [ -n "${up_bt_on_resume}" ]; then + ${BT_INIT} start >/dev/null + ${BT_DAEMON} start >/dev/null + fi fi } diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend index 25b286c14..a74f24d35 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend @@ -40,9 +40,11 @@ suspend_interfaces() { fi # Suspend bluetooth interface - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" + ${BT_DAEMON} stop >/dev/null + ${BT_INIT} stop >/dev/null + fi } resume_interfaces() { @@ -59,9 +61,11 @@ resume_interfaces() { fi # Resume bluetooth interface - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + if [ -n "${up_bt_on_resume}" ]; then + ${BT_INIT} start >/dev/null + ${BT_DAEMON} start >/dev/null + fi fi }