From 314d4c82d6a2102bd62d383173c04d7a67f3788d Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Wed, 24 Jan 2018 14:07:58 +0100 Subject: [PATCH] meta-digi: fix scripts to remove undesired warning ignoring null bytes Bash v4.4 or higher warns when discarding NULL bytes in command substitution output. Remove these bytes to avoid the undesired warnings. https://jira.digi.com/browse/DEL-5588 Signed-off-by: Arturo Buzarra --- .../kernel-module-qualcomm/qualcomm.sh | 6 ++--- .../bluez5-5.41/ccimx6sbc/bluetooth-init | 4 ++-- .../bluez/bluez5-5.41/ccimx6ul/bluetooth-init | 4 ++-- .../bluez5-5.46/ccimx6sbc/bluetooth-init | 4 ++-- .../bluez/bluez5-5.46/ccimx6ul/bluetooth-init | 4 ++-- .../recipes-digi/sysinfo/sysinfo/sysinfo | 22 +++++++++---------- 6 files changed, 22 insertions(+), 22 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 64812873a..1f9c09012 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 @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017, Digi International Inc. +# Copyright (c) 2017,2018 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 @@ -48,8 +48,8 @@ if ! cmp -s ${TMP_MACFILE} ${MACFILE}; then 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)" +OTP_REGION_CODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null | tr -d '\0')" +DTB_REGION_CODE="$(cat /proc/device-tree/wireless/regulatory-domain 2>/dev/null | tr -d '\0')" US_CODE="0x0" WW_CODE="0x1" JP_CODE="0x2" diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6sbc/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6sbc/bluetooth-init index 6e43617c6..ff7e24476 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6sbc/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.41/ccimx6sbc/bluetooth-init @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2012-2017 by Digi International Inc. +# Copyright (C) 2012-2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -56,7 +56,7 @@ bluetooth_init() { # Symlink the correct firmware file depending on region code JPN_REGCODE="0x2" - REGCODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null)" + REGCODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null | tr -d '\0')" BT_CLASS_LINK="PS_ASIC.pst" BT_CLASS_FILE="PS_ASIC_class_1.pst" if [ -n "${REGCODE}" ] && [ "${JPN_REGCODE}" = "${REGCODE}" ]; then 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 6cad5a082..9e81c2b73 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 @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2012-2017 by Digi International Inc. +# Copyright (C) 2012-2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ bluetooth_init() { fi # Module version older than revision 4 has swapped TX and RX lines - MOD_VERSION="$(($(cat /proc/device-tree/digi,hwid,hv 2>/dev/null || true)))" + MOD_VERSION="$(($(cat /proc/device-tree/digi,hwid,hv 2>/dev/null | tr -d '\0' || true)))" if [ "${MOD_VERSION}" -lt "4" ]; then # Ignore the CTS flow control BT_CTS_QCA_GPIO_NR="18" diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6sbc/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6sbc/bluetooth-init index 6e43617c6..ff7e24476 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6sbc/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6sbc/bluetooth-init @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2012-2017 by Digi International Inc. +# Copyright (C) 2012-2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -56,7 +56,7 @@ bluetooth_init() { # Symlink the correct firmware file depending on region code JPN_REGCODE="0x2" - REGCODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null)" + REGCODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null | tr -d '\0')" BT_CLASS_LINK="PS_ASIC.pst" BT_CLASS_FILE="PS_ASIC_class_1.pst" if [ -n "${REGCODE}" ] && [ "${JPN_REGCODE}" = "${REGCODE}" ]; then diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6ul/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6ul/bluetooth-init index 6cad5a082..9e81c2b73 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6ul/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx6ul/bluetooth-init @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2012-2017 by Digi International Inc. +# Copyright (C) 2012-2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ bluetooth_init() { fi # Module version older than revision 4 has swapped TX and RX lines - MOD_VERSION="$(($(cat /proc/device-tree/digi,hwid,hv 2>/dev/null || true)))" + MOD_VERSION="$(($(cat /proc/device-tree/digi,hwid,hv 2>/dev/null | tr -d '\0' || true)))" if [ "${MOD_VERSION}" -lt "4" ]; then # Ignore the CTS flow control BT_CTS_QCA_GPIO_NR="18" diff --git a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo index f21c798e1..f938a6efc 100755 --- a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo +++ b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo @@ -3,7 +3,7 @@ # # sysinfo # -# Copyright (C) 2016,2017 by Digi International Inc. +# Copyright (C) 2016-2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -254,28 +254,28 @@ make_report(){ DISTRO="$(sed -ne 's,DISTRO = \(.*\)$,\1,g;T;p' /etc/build)" DEY_VERSION="$(sed -ne 's,DISTRO_VERSION = \(.*\)$,\1,g;T;p' /etc/build)" -UBOOT_VERSION="$(cat /proc/device-tree/digi,uboot,version 2>/dev/null)" +UBOOT_VERSION="$(cat /proc/device-tree/digi,uboot,version 2>/dev/null | tr -d '\0')" if [ -z "${UBOOT_VERSION}" ]; then UBOOT_PARTITION="/dev/mmcblk0boot0" [ -c "/dev/mtd0" ] && UBOOT_PARTITION="/dev/mtd0" UBOOT_VERSION="$(strings ${UBOOT_PARTITION} | grep -m 1 dub | cut -d' ' -f2)" fi -MACHINE="$(cat /proc/device-tree/digi,machine,name)" -BOARD_VARIANT="$(cat /proc/device-tree/digi,hwid,variant)" -BOARD_SN="$(cat /proc/device-tree/digi,hwid,sn)" -BOARD_VERSION="$(cat /proc/device-tree/digi,carrierboard,version)" -BOARD_ID="$(cat /proc/device-tree/digi,carrierboard,id)" +MACHINE="$(cat /proc/device-tree/digi,machine,name | tr -d '\0')" +BOARD_VARIANT="$(cat /proc/device-tree/digi,hwid,variant | tr -d '\0')" +BOARD_SN="$(cat /proc/device-tree/digi,hwid,sn | tr -d '\0')" +BOARD_VERSION="$(cat /proc/device-tree/digi,carrierboard,version | tr -d '\0')" +BOARD_ID="$(cat /proc/device-tree/digi,carrierboard,id | tr -d '\0')" if grep -qs '\' /proc/device-tree/compatible; then MCA_NODE="/sys/bus/i2c/devices/0-007e" - MCA_HW_VERSION=$(cat ${MCA_NODE}/hw_version) || MCA_HW_VERSION="??" - MCA_FW_VERSION=$(cat ${MCA_NODE}/fw_version) || MCA_FW_VERSION="??" + MCA_HW_VERSION=$(cat ${MCA_NODE}/hw_version 2>/dev/null | tr -d '\0') || MCA_HW_VERSION="??" + MCA_FW_VERSION=$(cat ${MCA_NODE}/fw_version 2>/dev/null | tr -d '\0') || MCA_FW_VERSION="??" MCA_VERSION="HW_VERSION=${MCA_HW_VERSION} FW_VERSION=${MCA_FW_VERSION}" fi IOEXP_NODE="/sys/bus/i2c/devices/0-006e" if [ -d "$IOEXP_NODE" ]; then - IOEXP_HW_VERSION=$(cat ${IOEXP_NODE}/hw_version 2>/dev/null) || IOEXP_HW_VERSION="??" - IOEXP_FW_VERSION=$(cat ${IOEXP_NODE}/fw_version 2>/dev/null) || IOEXP_FW_VERSION="??" + IOEXP_HW_VERSION=$(cat ${IOEXP_NODE}/hw_version 2>/dev/null | tr -d '\0') || IOEXP_HW_VERSION="??" + IOEXP_FW_VERSION=$(cat ${IOEXP_NODE}/fw_version 2>/dev/null | tr -d '\0') || IOEXP_FW_VERSION="??" IOEXP_VERSION="HW_VERSION=${IOEXP_HW_VERSION} FW_VERSION=${IOEXP_FW_VERSION}" fi