From b421fb7995a984ae648a176c478370da91c50d3f Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 27 Jul 2017 14:05:29 +0200 Subject: [PATCH] qualcomm: generalize log function to pass the log level We need to pass different log levels depending on the message, so they appear in the console, so generalize the 'log' function. https://jira.digi.com/browse/DEL-4682 Signed-off-by: Javier Viguera --- .../kernel-module-qualcomm/qualcomm.sh | 19 ++++++++++--------- .../init-ifupdown-1.0/ccimx6ul/virtwlans.sh | 3 +-- 2 files changed, 11 insertions(+), 11 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 42a40c3b8..64812873a 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 @@ -18,7 +18,7 @@ # 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 + printf "<$1>qca6564: $2\n" >/dev/kmsg } # Do nothing if the module is already loaded @@ -60,7 +60,7 @@ case "${DTB_REGION_CODE}" in REGULATORY_DOMAIN="${DTB_REGION_CODE}";; *) if [ -n "${DTB_REGION_CODE}" ]; then - log "[WARN] Invalid region code in device tree, using OTP value" + log "5" "[WARN] Invalid region code in device tree, using OTP value" fi REGULATORY_DOMAIN="${OTP_REGION_CODE}";; esac @@ -74,19 +74,19 @@ esac BDATA_SOURCE="bdwlan30_US.bin" case "${REGULATORY_DOMAIN}" in ${US_CODE}) - log "Setting US wireless region";; + log "5" "Setting US wireless region";; ${WW_CODE}|${JP_CODE}) if [ -f "bdwlan30_World.bin" ]; then - log "Setting WW (world wide) wireless region" + log "5" "Setting WW (world wide) wireless region" BDATA_SOURCE="bdwlan30_World.bin" else - log "[WARN] No WW (worldwide) board data file, using US" + log "5" "[WARN] No WW (worldwide) board data file, using US" fi ;; "") - log "[WARN] region code not found, using US";; + log "5" "[WARN] region code not found, using US";; *) - log "[WARN] Invalid region code, using US";; + log "5" "[WARN] Invalid region code, using US";; esac # We don't want to rewrite NAND every time we boot so only @@ -108,7 +108,8 @@ modprobe wlan # Verify the interface is present if [ -d "/sys/class/net/wlan0" ]; then # Create 'wlan1' virtual interface - virtwlans.sh + VIRTWLANS_OUT="$(virtwlans.sh)" + [ -n "${VIRTWLANS_OUT}" ] && log "3" "${VIRTWLANS_OUT}" else - log "[ERROR] Loading qca6564 module" + log "3" "[ERROR] Loading qca6564 module" fi diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/virtwlans.sh b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/virtwlans.sh index 600cad8c0..304c09fc5 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/virtwlans.sh +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/ccimx6ul/virtwlans.sh @@ -21,8 +21,7 @@ if [ -s "/proc/device-tree/wireless/mac-address1" ] && [ -s "/proc/device-tree/wireless/mac-address3" ]; then : else - echo "WARNING: Using default MAC addresses for virtual interfaces, please " - echo "program them referring to the Digi U-Boot Documentation" + echo "[WARN] Using default MAC addresses for virtual interfaces, please program them referring to the Digi U-Boot Documentation" fi if [ ! -d "/sys/class/net/wlan1" ]; then