Merge branch 'dey-2.0/master' into dey-2.0/maint

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2017-01-26 18:17:12 +01:00
commit 7005b0a330
126 changed files with 6579 additions and 896 deletions

View File

@ -1,5 +1,5 @@
# Digi Embedded Yocto (DEY) 2.0
## Release 2.0-r4
## Release 2.0-r5
This document provides information about Digi Embedded Yocto,
Digi International's professional embedded Yocto development environment.
@ -64,6 +64,10 @@ Documentation is available online on the Digi documentation site:
# Release Changelog
## 2.0-r5
* TBC
## 2.0-r4
* Digi ConnectCore 6UL

View File

@ -124,17 +124,76 @@ IMAGE_CMD_boot.ubifs() {
rm -rf ${TMP_BOOTDIR}
}
IMAGE_CMD_rootfs.initramfs() {
IMAGE_DEPENDS_recovery.vfat = "${RECOVERY_INITRAMFS_IMAGE}:do_rootfs"
# The recovery vfat image requires the boot image to be built before
IMAGE_TYPEDEP_recovery.vfat = "${SDIMG_BOOTFS_TYPE}"
IMAGE_CMD_recovery.vfat() {
#
# Image generation code for image type 'rootfs.initramfs'
# Image generation code for image type 'recovery.vfat'
#
mkimage -A ${TARGET_ARCH} -O linux -T ramdisk -C none -n ${IMAGE_NAME} -d ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.initramfs
# Copy the boot.vfat image
cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.vfat ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat
# Copy the recovery init script into the VFAT image
mcopy -o -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat -s ${DEPLOY_DIR_IMAGE}/recovery.scr ::/boot.scr
# Copy the recovery ramdisk into the VFAT image
mcopy -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat -s ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ::/uramdisk-recovery.img
# Create the symlink
if [ -n "${IMAGE_LINK_NAME}" ] && [ -e ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.initramfs ]; then
ln -s ${IMAGE_NAME}.rootfs.initramfs ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.initramfs
if [ -n "${IMAGE_LINK_NAME}" ] && [ -e ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat ]; then
ln -s ${IMAGE_NAME}.recovery.vfat ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.recovery.vfat
fi
}
IMAGE_TYPEDEP_rootfs.initramfs = "cpio.gz"
IMAGE_DEPENDS_recovery.ubifs = " \
mtd-utils-native:do_populate_sysroot \
u-boot:do_deploy \
virtual/kernel:do_deploy \
${RECOVERY_INITRAMFS_IMAGE}:do_rootfs \
"
IMAGE_CMD_recovery.ubifs() {
#
# Image generation code for image type 'recovery.ubifs'
#
RECOVERYIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"
if [ -n "${KERNEL_DEVICETREE}" ]; then
for DTB in ${KERNEL_DEVICETREE}; do
if [ -e "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB}" ]; then
RECOVERYIMG_FILES_SYMLINK="${RECOVERYIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB}"
fi
done
fi
# Create temporary folder
TMP_RECOVERYDIR="$(mktemp -d ${DEPLOY_DIR_IMAGE}/recovery.XXXXXX)"
# Hard-link RECOVERYIMG_FILES into the temporary folder with the symlink filename
for item in ${RECOVERYIMG_FILES_SYMLINK}; do
orig="$(readlink -e ${item})"
ln ${orig} ${TMP_RECOVERYDIR}/$(basename ${item})
done
# Copy the recovery init script.
cp ${DEPLOY_DIR_IMAGE}/recovery.scr ${TMP_RECOVERYDIR}/boot.scr
# Copy the recovery ramdisk image.
cp ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ${TMP_RECOVERYDIR}/uramdisk-recovery.img
# Build UBIFS boot image out of temp folder
mkfs.ubifs -r ${TMP_RECOVERYDIR} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.ubifs ${MKUBIFS_BOOT_ARGS}
# Create the symlink
if [ -n "${IMAGE_LINK_NAME}" ] && [ -e ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.ubifs ]; then
ln -s ${IMAGE_NAME}.recovery.ubifs ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.recovery.ubifs
fi
# Remove the temporary folder
rm -rf ${TMP_RECOVERYDIR}
}
IMAGE_CMD_cpio.gz.u-boot.tf() {
#

View File

@ -36,4 +36,4 @@ BT_TTY ?= "ttymxc1"
BOOT_SCRIPTS = "boot.scr:boot.scr"
# Flash image types
IMAGE_FSTYPES ?= "boot.vfat ext4 sdcard tar.bz2"
IMAGE_FSTYPES ?= "boot.vfat ext4 sdcard tar.bz2 recovery.vfat"

View File

@ -27,4 +27,4 @@ BT_TTY ?= "ttymxc0"
BOOT_SCRIPTS = "boot.scr:boot.scr"
# Flash image types
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs"
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs recovery.ubifs"

View File

@ -25,4 +25,4 @@ BT_TTY ?= "ttymxc0"
BOOT_SCRIPTS = "boot.scr:boot.scr"
# Flash image types
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs"
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs recovery.ubifs"

View File

@ -15,7 +15,7 @@ UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
# Wireless external module
WIRELESS_MODULE ?= ""
WIRELESS_MODULE_append = "${@bb.utils.contains('MACHINE_FEATURES', 'wifi', 'kernel-module-atheros', '', d)}"
WIRELESS_MODULE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'wifi', 'kernel-module-atheros', '', d)}"
# Firmware
MACHINE_FIRMWARE ?= ""

View File

@ -14,7 +14,7 @@ UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
# Wireless external module
WIRELESS_MODULE ?= ""
WIRELESS_MODULE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'wifi', 'kernel-module-qualcomm', '', d)}"
WIRELESS_MODULE_append = " ${@base_conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}"
# Firmware
MACHINE_FIRMWARE ?= ""
@ -30,8 +30,8 @@ MACHINE_EXTRA_RRECOMMENDS += "fsl-alsa-plugins cryptodev-module"
MACHINE_FEATURES += "wifi bluetooth"
MACHINE_FIRMWARE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'bluetooth', 'firmware-qualcomm-qca6564-bt', '', d)}"
MACHINE_FIRMWARE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'wifi', 'firmware-qualcomm-qca6564-wifi', '', d)}"
MACHINE_FIRMWARE_append = " ${@base_conditional('HAVE_BT', '1', 'firmware-qualcomm-qca6564-bt', '', d)}"
MACHINE_FIRMWARE_append = " ${@base_conditional('HAVE_WIFI', '1', 'firmware-qualcomm-qca6564-wifi', '', d)}"
KERNEL_IMAGETYPE = "zImage"

View File

@ -38,6 +38,8 @@ ETH1_STATIC_NETMASK ?= "255.255.255.0"
WLAN0_MODE ?= "static"
WLAN0_STATIC_IP ?= "192.168.43.30"
WLAN0_STATIC_NETMASK ?= "255.255.255.0"
P2P0_STATIC_IP ?= "192.168.45.30"
P2P0_STATIC_NETMASK ?= "255.255.255.0"
# Digi BSP default settings
IMAGE_CLASSES = "image_types_digi"

View File

@ -40,6 +40,7 @@ MACHINE_EXTRA_RRECOMMENDS += "udev-extraconf udev-rules-imx"
MACHINE_GSTREAMER_1_0_PLUGIN ?= ""
MACHINE_GSTREAMER_1_0_PLUGIN_mx6q ?= "gst1.0-fsl-plugin gst1.0-fsl-plugin-gplay gst1.0-fsl-plugin-grecorder"
MACHINE_GSTREAMER_1_0_PLUGIN_mx6dl ?= "gst1.0-fsl-plugin gst1.0-fsl-plugin-gplay gst1.0-fsl-plugin-grecorder"
MACHINE_GSTREAMER_1_0_PLUGIN_mx6ul ?= "gst1.0-fsl-plugin gst1.0-fsl-plugin-gplay gst1.0-fsl-plugin-grecorder"
# Determines if the SoC has support for Vivante kernel driver
SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT = "0"

View File

@ -2,7 +2,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI += " \
SRC_URI_append_ccimx6 = " \
file://asound.inline_play.state \
file://asound.inline.state \
file://asound.micro_play.state \
@ -10,6 +10,20 @@ SRC_URI += " \
file://asound.play.state \
"
do_install_append() {
SRC_URI_append_ccardimx28 = " \
file://asound.inline_play.state \
file://asound.inline.state \
file://asound.micro_play.state \
file://asound.micro.state \
file://asound.play.state \
"
SRC_URI_append_ccimx6ul = " file://asound.state"
do_install_append_ccimx6() {
ln -sf asound.micro_play.state ${D}${localstatedir}/lib/alsa/asound.state
}
do_install_append_ccardimx28() {
ln -sf asound.micro_play.state ${D}${localstatedir}/lib/alsa/asound.state
}

View File

@ -1,43 +1,9 @@
pcm.btheadset {
type plug
slave {
pcm {
type bluetooth
device 80:57:19:B2:A1:04
profile "auto"
}
}
hint {
show on
description "BT Headset"
}
pcm.imxmax98088 {
type hw
card 0
}
ctl.btheadset {
type bluetooth
}
pcm.btspeaker {
type plug
slave {
pcm {
type bluetooth
device A0:E9:DB:10:33:58
profile "auto"
}
}
hint {
show on
description "BT Speaker"
}
}
ctl.btspeaker {
type bluetooth
}
pcm.btspeaker_softvol
{
type softvol
slave.pcm "btspeaker"
control.name "Bluetooth"
control.card 0
ctl.imxmax98088 {
type hw
card 0
}
ctl.!default imxmax98088

View File

@ -1,127 +0,0 @@
state.sgtl5000audio {
control.1 {
iface MIXER
name 'PCM Playback Volume'
value.0 144
value.1 144
comment {
access 'read write'
type INTEGER
count 2
range '0 - 192'
}
}
control.2 {
iface MIXER
name 'Capture Volume'
value.0 12
value.1 12
comment {
access 'read write'
type INTEGER
count 2
range '0 - 15'
}
}
control.3 {
iface MIXER
name 'Capture Attenuate Switch (-6dB)'
value 1
comment {
access 'read write'
type INTEGER
count 1
range '0 - 2'
dbmin -600
dbmax 600
dbvalue.0 0
}
}
control.4 {
iface MIXER
name 'Capture ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.5 {
iface MIXER
name 'Headphone Playback Volume'
value.0 105
value.1 105
comment {
access 'read write'
type INTEGER
count 2
range '0 - 127'
dbmin -5150
dbmax 1200
dbvalue.0 100
dbvalue.1 100
}
}
control.6 {
iface MIXER
name 'Headphone Playback ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.7 {
iface MIXER
name 'Mic Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
dbmin 0
dbmax 4000
dbvalue.0 3000
}
}
control.8 {
iface MIXER
name 'Headphone Mux'
value LINE_IN
comment {
access 'read write'
type ENUMERATED
count 1
item.0 DAC
item.1 LINE_IN
}
}
control.9 {
iface MIXER
name 'Capture Mux'
value LINE_IN
comment {
access 'read write'
type ENUMERATED
count 1
item.0 MIC_IN
item.1 LINE_IN
}
}
}
state.imxhdmisoc {
control.1 {
iface MIXER
name 'IEC958 Playback Default'
value '0400220300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read write volatile'
type IEC958
count 1
}
}
}

View File

@ -1,127 +0,0 @@
state.sgtl5000audio {
control.1 {
iface MIXER
name 'PCM Playback Volume'
value.0 144
value.1 144
comment {
access 'read write'
type INTEGER
count 2
range '0 - 192'
}
}
control.2 {
iface MIXER
name 'Capture Volume'
value.0 12
value.1 12
comment {
access 'read write'
type INTEGER
count 2
range '0 - 15'
}
}
control.3 {
iface MIXER
name 'Capture Attenuate Switch (-6dB)'
value 1
comment {
access 'read write'
type INTEGER
count 1
range '0 - 2'
dbmin -600
dbmax 600
dbvalue.0 0
}
}
control.4 {
iface MIXER
name 'Capture ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.5 {
iface MIXER
name 'Headphone Playback Volume'
value.0 105
value.1 105
comment {
access 'read write'
type INTEGER
count 2
range '0 - 127'
dbmin -5150
dbmax 1200
dbvalue.0 100
dbvalue.1 100
}
}
control.6 {
iface MIXER
name 'Headphone Playback ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.7 {
iface MIXER
name 'Mic Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
dbmin 0
dbmax 4000
dbvalue.0 3000
}
}
control.8 {
iface MIXER
name 'Headphone Mux'
value DAC
comment {
access 'read write'
type ENUMERATED
count 1
item.0 DAC
item.1 LINE_IN
}
}
control.9 {
iface MIXER
name 'Capture Mux'
value LINE_IN
comment {
access 'read write'
type ENUMERATED
count 1
item.0 MIC_IN
item.1 LINE_IN
}
}
}
state.imxhdmisoc {
control.1 {
iface MIXER
name 'IEC958 Playback Default'
value '0400220300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read write volatile'
type IEC958
count 1
}
}
}

View File

@ -1,127 +0,0 @@
state.sgtl5000audio {
control.1 {
iface MIXER
name 'PCM Playback Volume'
value.0 144
value.1 144
comment {
access 'read write'
type INTEGER
count 2
range '0 - 192'
}
}
control.2 {
iface MIXER
name 'Capture Volume'
value.0 12
value.1 12
comment {
access 'read write'
type INTEGER
count 2
range '0 - 15'
}
}
control.3 {
iface MIXER
name 'Capture Attenuate Switch (-6dB)'
value 1
comment {
access 'read write'
type INTEGER
count 1
range '0 - 2'
dbmin -600
dbmax 600
dbvalue.0 0
}
}
control.4 {
iface MIXER
name 'Capture ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.5 {
iface MIXER
name 'Headphone Playback Volume'
value.0 105
value.1 105
comment {
access 'read write'
type INTEGER
count 2
range '0 - 127'
dbmin -5150
dbmax 1200
dbvalue.0 100
dbvalue.1 100
}
}
control.6 {
iface MIXER
name 'Headphone Playback ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.7 {
iface MIXER
name 'Mic Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
dbmin 0
dbmax 4000
dbvalue.0 3000
}
}
control.8 {
iface MIXER
name 'Headphone Mux'
value DAC
comment {
access 'read write'
type ENUMERATED
count 1
item.0 DAC
item.1 LINE_IN
}
}
control.9 {
iface MIXER
name 'Capture Mux'
value MIC_IN
comment {
access 'read write'
type ENUMERATED
count 1
item.0 MIC_IN
item.1 LINE_IN
}
}
}
state.imxhdmisoc {
control.1 {
iface MIXER
name 'IEC958 Playback Default'
value '0400220300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read write volatile'
type IEC958
count 1
}
}
}

View File

@ -1,127 +0,0 @@
state.sgtl5000audio {
control.1 {
iface MIXER
name 'PCM Playback Volume'
value.0 144
value.1 144
comment {
access 'read write'
type INTEGER
count 2
range '0 - 192'
}
}
control.2 {
iface MIXER
name 'Capture Volume'
value.0 12
value.1 12
comment {
access 'read write'
type INTEGER
count 2
range '0 - 15'
}
}
control.3 {
iface MIXER
name 'Capture Attenuate Switch (-6dB)'
value 1
comment {
access 'read write'
type INTEGER
count 1
range '0 - 2'
dbmin -600
dbmax 600
dbvalue.0 0
}
}
control.4 {
iface MIXER
name 'Capture ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.5 {
iface MIXER
name 'Headphone Playback Volume'
value.0 105
value.1 105
comment {
access 'read write'
type INTEGER
count 2
range '0 - 127'
dbmin -5150
dbmax 1200
dbvalue.0 100
dbvalue.1 100
}
}
control.6 {
iface MIXER
name 'Headphone Playback ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.7 {
iface MIXER
name 'Mic Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
dbmin 0
dbmax 4000
dbvalue.0 3000
}
}
control.8 {
iface MIXER
name 'Headphone Mux'
value DAC
comment {
access 'read write'
type ENUMERATED
count 1
item.0 DAC
item.1 LINE_IN
}
}
control.9 {
iface MIXER
name 'Capture Mux'
value MIC_IN
comment {
access 'read write'
type ENUMERATED
count 1
item.0 MIC_IN
item.1 LINE_IN
}
}
}
state.imxhdmisoc {
control.1 {
iface MIXER
name 'IEC958 Playback Default'
value '0400220300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read write volatile'
type IEC958
count 1
}
}
}

View File

@ -1,127 +0,0 @@
state.sgtl5000audio {
control.1 {
iface MIXER
name 'PCM Playback Volume'
value.0 144
value.1 144
comment {
access 'read write'
type INTEGER
count 2
range '0 - 192'
}
}
control.2 {
iface MIXER
name 'Capture Volume'
value.0 12
value.1 12
comment {
access 'read write'
type INTEGER
count 2
range '0 - 15'
}
}
control.3 {
iface MIXER
name 'Capture Attenuate Switch (-6dB)'
value 1
comment {
access 'read write'
type INTEGER
count 1
range '0 - 2'
dbmin -600
dbmax 600
dbvalue.0 0
}
}
control.4 {
iface MIXER
name 'Capture ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.5 {
iface MIXER
name 'Headphone Playback Volume'
value.0 105
value.1 105
comment {
access 'read write'
type INTEGER
count 2
range '0 - 127'
dbmin -5150
dbmax 1200
dbvalue.0 100
dbvalue.1 100
}
}
control.6 {
iface MIXER
name 'Headphone Playback ZC Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.7 {
iface MIXER
name 'Mic Volume'
value 2
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
dbmin 0
dbmax 4000
dbvalue.0 3000
}
}
control.8 {
iface MIXER
name 'Headphone Mux'
value DAC
comment {
access 'read write'
type ENUMERATED
count 1
item.0 DAC
item.1 LINE_IN
}
}
control.9 {
iface MIXER
name 'Capture Mux'
value MIC_IN
comment {
access 'read write'
type ENUMERATED
count 1
item.0 MIC_IN
item.1 LINE_IN
}
}
}
state.imxhdmisoc {
control.1 {
iface MIXER
name 'IEC958 Playback Default'
value '0400220300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read write volatile'
type IEC958
count 1
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,6 @@ FW_QCA6564-WIFI = " \
file://otp30.bin \
file://qwlan30.bin \
file://utf30.bin \
file://utfbd30.bin \
file://wlan/cfg.dat \
file://wlan/qcom_cfg.ini \
"
@ -50,7 +49,6 @@ do_install() {
otp30.bin \
qwlan30.bin \
utf30.bin \
utfbd30.bin \
${D}${base_libdir}/firmware
install -m 0644 \
wlan/cfg.dat \

View File

@ -2,13 +2,38 @@
# defaults for the WLAN Driver
# Debug tracing bit values
# VOS tracing requires a debug build - see BUILD_DEBUG_VERSION
# None = 0
# Error
# Warn
# Info
# Info high
# Info med
# Info low
# Debug = 7
# Debug masks in decimal
# Default debug is Error and Warn 0x06 (6)
# All debug is 0xff (255)
#vosTraceEnableTL=6
#vosTraceEnableWDI=6
#vosTraceEnableHDD=6
#vosTraceEnableSME=6
#vosTraceEnablePE=6
#vosTraceEnablePMC=6
#vosTraceEnableWDA=6
#vosTraceEnableSYS=6
#vosTraceEnableVOSS=6
#vosTraceEnableSAP=6
#vosTraceEnableHDDSAP=6
# Enable/Disable Idle Scan
gEnableRxThread=1
gEnableIdleScan=0
# Increase sleep duration (seconds) during IMPS
# 0 implies no periodic wake up from IMPS. Periodic wakeup is
@ -29,12 +54,10 @@ gEnableSuspend=3
# 7 = 11b only 8 = 11ac only.
gDot11Mode=0
# CSR Roaming Enable(1) Disable(0)
gRoamingTime=0
# Assigned MAC Addresses - This will be used until NV items are in place
# Each byte of MAC address is represented in Hex format as XX
@ -103,19 +126,12 @@ gEnableDFSMasterCap=1
ImplicitQosIsEnabled=0
gNeighborLookupThreshold=76
gNeighborReassocThreshold=81
#Check if the AP to which we are roaming is better than current AP in terms of RSSI.
#Checking is disabled if set to Zero.Otherwise it will use this value as to how better
#the RSSI of the new/roamable AP should be for roaming
RoamRssiDiff=3
# If the RSSI of any available candidate is better than currently associated
# AP by at least gImmediateRoamRssiDiff, then being to roam immediately (without
# registering for reassoc threshold).
# NOTE: Value of 0 means that we would register for reassoc threshold.
gImmediateRoamRssiDiff=10
# SAP auto channel selection configuration
# 0 = disable auto channel selection

View File

@ -62,10 +62,11 @@ fi;
setenv INSTALL_MMCDEV 1
setenv INSTALL_LINUX_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.boot.vfat
setenv INSTALL_RECOVERY_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.recovery.vfat
setenv INSTALL_ROOTFS_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.ext4
# Check for presence of firmware files on the SD card
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then
echo "ERROR: Could not find file ${install_f}";
install_abort=1;
@ -105,8 +106,10 @@ fi
# - Save the environment
# - Partition the eMMC user data area for Linux
# - Update the 'linux' partition
# - Update the 'recovery' partition
# - Update the 'rootfs' partition
# - Reset the system and let it boot
# - Configure recovery to wipe 'update' partition
# - Run 'recovery' and let the system boot after
setenv bootcmd "
env default -a;
saveenv;
@ -136,6 +139,18 @@ setenv bootcmd "
fi;
echo \"\";
echo \"\";
echo \">> Installing recovery\";
echo \"\";
echo \"\";
update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update recovery partition!\";
echo \"\";
echo \"Aborted.\";
exit;
fi;
echo \"\";
echo \"\";
echo \">> Installing Linux root file system\";
echo \"\";
echo \"\";
@ -147,14 +162,12 @@ setenv bootcmd "
exit;
fi;
echo \"\";
echo \"#######################\";
echo \"# Install complete! #\";
echo \"#######################\";
echo \"\";
setenv boot_recovery yes
setenv recovery_command wipe_update
saveenv;
echo \">> Firmware installation complete. Booting into recovery for final deployment.\";
sleep 1;
echo \">> Restarting the system\";
sleep 1;
reset;
run recoverycmd;
"
saveenv

View File

@ -0,0 +1,49 @@
#
# U-Boot bootscript for EMMC/SD images created by Yocto.
#
#
# Set device tree filename depending on the board ID (if defined)
#
if test -n "${board_id}"; then
setenv fdt_file uImage-${soc_family}-ccimx6sbc-id${board_id}.dtb
else
#
# Set device tree filename depending on the hardware variant
#
if test "${module_variant}" = "0x02"; then
setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb
elif test "${module_variant}" = "0x03"; then
setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb
elif test "${module_variant}" = "0x04"; then
setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb
elif test "${module_variant}" = "0x05"; then
setenv fdt_file uImage-imx6q-ccimx6sbc-w.dtb
elif test "${module_variant}" = "0x06"; then
setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb
elif test "${module_variant}" = "0x08"; then
setenv fdt_file uImage-imx6q-ccimx6sbc.dtb
elif test "${module_variant}" = "0x0a"; then
setenv fdt_file uImage-imx6dl-ccimx6sbc-w.dtb
elif test "${module_variant}" = "0x0b"; then
setenv fdt_file uImage-imx6dl-ccimx6sbc-wb.dtb
elif test "${module_variant}" = "0x0c"; then
setenv fdt_file uImage-imx6dl-ccimx6sbc.dtb
elif test "${module_variant}" = "0x0e"; then
setenv fdt_file uImage-imx6q-ccimx6sbc.dtb
elif test "${module_variant}" = "0x0f"; then
setenv fdt_file uImage-imx6q-ccimx6sbc.dtb
elif test "${module_variant}" = "0x11"; then
setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb
elif test "${module_variant}" = "0x12"; then
setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb
elif test "${module_variant}" = "0x13"; then
setenv fdt_file uImage-imx6dl-ccimx6sbc-wb.dtb
else
echo "------ Using default fdt_file"
fi
fi
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
dboot linux mmc ${mmcbootdev}:${mmcpart}

View File

@ -22,10 +22,11 @@ fi
setenv INSTALL_MMCDEV 0
setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulsbc.imx
setenv INSTALL_LINUX_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.boot.ubifs
setenv INSTALL_RECOVERY_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.recovery.ubifs
setenv INSTALL_ROOTFS_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6ulsbc.ubifs
# Check for presence of firmware files on the SD card
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then
echo "ERROR: Could not find file ${install_f}";
install_abort=1;
@ -61,8 +62,10 @@ fi
# - Reset environment to defaults
# - Save the environment
# - Update the 'linux' partition
# - Update the 'recovery' partition
# - Update the 'rootfs' partition
# - Reset the system and let it boot
# - Configure recovery to wipe 'update' partition
# - Run 'recovery' and let the system boot after
setenv bootcmd "
env default -a;
saveenv;
@ -71,6 +74,7 @@ setenv bootcmd "
echo \">> Installing Linux kernel and device tree files\";
echo \"\";
echo \"\";
nand erase.part linux
update linux mmc ${INSTALL_MMCDEV} fat ${INSTALL_LINUX_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux partition!\";
@ -80,9 +84,23 @@ setenv bootcmd "
fi;
echo \"\";
echo \"\";
echo \">> Installing recovery\";
echo \"\";
echo \"\";
nand erase.part recovery
update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update recovery partition!\";
echo \"\";
echo \"Aborted.\";
exit;
fi;
echo \"\";
echo \"\";
echo \">> Installing Linux root file system\";
echo \"\";
echo \"\";
nand erase.part rootfs
update rootfs mmc ${INSTALL_MMCDEV} fat ${INSTALL_ROOTFS_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs partition!\";
@ -90,16 +108,13 @@ setenv bootcmd "
echo \"Aborted.\";
exit;
fi;
echo \"\";
setenv boot_recovery yes
setenv recovery_command wipe_update
saveenv;
echo \"\";
echo \"#######################\";
echo \"# Install complete! #\";
echo \"#######################\";
echo \"\";
echo \">> Firmware installation complete. Booting into recovery for final deployment.\";
sleep 1;
echo \">> Restarting the system\";
sleep 1;
reset;
run recoverycmd;
"
saveenv

View File

@ -0,0 +1,25 @@
#
# U-Boot bootscript for NAND images created by Yocto.
#
#
# Set device tree filename depending on the board ID (if defined)
#
if test -n "${board_id}"; then
setenv fdt_file zImage-imx6ul-ccimx6ulsbc-id${board_id}.dtb
else
#
# Set device tree filename depending on the hardware variant
#
if test "${module_variant}" = "0x02"; then
setenv fdt_file zImage-imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x03"; then
setenv fdt_file zImage-imx6ul-ccimx6ulsbc.dtb
else
echo "------ Using default fdt_file: $fdt_file"
fi
fi
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
dboot linux nand ${mtdbootpart}

View File

@ -22,10 +22,11 @@ fi
setenv INSTALL_MMCDEV 0
setenv INSTALL_UBOOT_FILENAME u-boot-ccimx6ulstarter.imx
setenv INSTALL_LINUX_FILENAME core-image-base-ccimx6ulstarter.boot.ubifs
setenv INSTALL_RECOVERY_FILENAME core-image-base-ccimx6ulstarter.recovery.ubifs
setenv INSTALL_ROOTFS_FILENAME core-image-base-ccimx6ulstarter.ubifs
# Check for presence of firmware files on the SD card
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
for install_f in ${INSTALL_UBOOT_FILENAME} ${INSTALL_LINUX_FILENAME} ${INSTALL_RECOVERY_FILENAME} ${INSTALL_ROOTFS_FILENAME}; do
if test ! -e mmc ${INSTALL_MMCDEV}:1 ${install_f}; then
echo "ERROR: Could not find file ${install_f}";
install_abort=1;
@ -61,8 +62,10 @@ fi
# - Reset environment to defaults
# - Save the environment
# - Update the 'linux' partition
# - Update the 'recovery' partition
# - Update the 'rootfs' partition
# - Reset the system and let it boot
# - Configure recovery to wipe 'update' partition
# - Run 'recovery' and let the system boot after
setenv bootcmd "
env default -a;
saveenv;
@ -71,6 +74,7 @@ setenv bootcmd "
echo \">> Installing Linux kernel and device tree files\";
echo \"\";
echo \"\";
nand erase.part linux
update linux mmc ${INSTALL_MMCDEV} fat ${INSTALL_LINUX_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux partition!\";
@ -80,9 +84,23 @@ setenv bootcmd "
fi;
echo \"\";
echo \"\";
echo \">> Installing recovery\";
echo \"\";
echo \"\";
nand erase.part recovery
update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update recovery partition!\";
echo \"\";
echo \"Aborted.\";
exit;
fi;
echo \"\";
echo \"\";
echo \">> Installing Linux root file system\";
echo \"\";
echo \"\";
nand erase.part rootfs
update rootfs mmc ${INSTALL_MMCDEV} fat ${INSTALL_ROOTFS_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs partition!\";
@ -90,16 +108,13 @@ setenv bootcmd "
echo \"Aborted.\";
exit;
fi;
echo \"\";
setenv boot_recovery yes
setenv recovery_command wipe_update
saveenv;
echo \"\";
echo \"#######################\";
echo \"# Install complete! #\";
echo \"#######################\";
echo \"\";
echo \">> Firmware installation complete. Booting into recovery for final deployment.\";
sleep 1;
echo \">> Restarting the system\";
sleep 1;
reset;
run recoverycmd;
"
saveenv

View File

@ -0,0 +1,25 @@
#
# U-Boot bootscript for NAND images created by Yocto.
#
#
# Set device tree filename depending on the board ID (if defined)
#
if test -n "${board_id}"; then
setenv fdt_file zImage-imx6ul-ccimx6ulstarter-id${board_id}.dtb
else
#
# Set device tree filename depending on the hardware variant
#
if test "${module_variant}" = "0x02"; then
setenv fdt_file zImage-imx6ul-ccimx6ulstarter-wb.dtb
elif test "${module_variant}" = "0x03"; then
setenv fdt_file zImage-imx6ul-ccimx6ulstarter.dtb
else
echo "------ Using default fdt_file: $fdt_file"
fi
fi
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
dboot linux nand ${mtdbootpart}

View File

@ -24,6 +24,7 @@ SRC_URI = " \
SRC_URI_append = " \
file://boot.txt \
file://install_linux_fw_sd.txt \
file://recovery.txt \
"
LOCALVERSION ?= ""
@ -150,12 +151,24 @@ do_deploy_append() {
TMP_BOOTSCR="$(mktemp ${WORKDIR}/bootscr.XXXXXX)"
sed -e "${TF_BOOTSCRIPT_SEDFILTER}" ${WORKDIR}/boot.txt > ${TMP_BOOTSCR}
mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr
# Recovery boot script for DEY images
mkimage -T script -n bootscript -C none -d ${WORKDIR}/recovery.txt ${DEPLOYDIR}/recovery.scr
# Sign the scripts
if [ "${TRUSTFENCE_SIGN}" = "1" ]; then
export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}"
[ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}"
[ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}"
"${STAGING_BINDIR_NATIVE}/trustfence-sign-kernel.sh" -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${DEPLOYDIR}/boot-signed.scr"
mv ${DEPLOYDIR}/boot-signed.scr ${DEPLOYDIR}/boot.scr
# Sign boot script
TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/bootscr-signed.XXXXXX)"
trustfence-sign-kernel.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${TMP_SIGNED_BOOTSCR}"
mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/boot.scr"
# Sign recovery script
trustfence-sign-kernel.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/recovery.scr" "${TMP_SIGNED_BOOTSCR}"
mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/recovery.scr"
fi
rm -f ${TMP_BOOTSCR}
}

View File

@ -8,7 +8,7 @@ Signed-off-by: Javier Viguera <javier.viguera@digi.com>
1 file changed, 33 insertions(+)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 09f06c874b17..ae6c69eca0ad 100644
index 09f06c874b17..e4e242b35bd1 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1218,6 +1218,27 @@ static int flash_read (int fd)
@ -18,7 +18,7 @@ index 09f06c874b17..ae6c69eca0ad 100644
+/*
+ * Set mmcboot partition read-write protection
+ */
+static int sysfs_mmcboot_set_protection(char *device, int value)
+static int sysfs_mmcboot_set_protection(const char *device, int value)
+{
+ int fd;
+ char buf[64];

View File

@ -0,0 +1,146 @@
From: Javier Viguera <javier.viguera@digi.com>
Date: Tue, 10 Jan 2017 19:34:26 +0100
Subject: [PATCH] Implement U-Boot environment access functions
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
tools/env/Makefile | 2 +-
tools/env/ubootenv.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/env/ubootenv.h | 46 ++++++++++++++++++++++++++++++++++++++
3 files changed, 109 insertions(+), 1 deletion(-)
create mode 100644 tools/env/ubootenv.c
create mode 100644 tools/env/ubootenv.h
diff --git a/tools/env/Makefile b/tools/env/Makefile
index fa2a564bb357..b29dcea16fe8 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -25,7 +25,7 @@ hostprogs-y := fw_printenv
lib-y += fw_env.o \
crc32.o ctype.o linux_string.o \
- env_attr.o env_flags.o aes.o ../../lib/md5.o
+ env_attr.o env_flags.o aes.o ../../lib/md5.o ubootenv.o
fw_printenv-objs := fw_env_main.o $(lib-y)
diff --git a/tools/env/ubootenv.c b/tools/env/ubootenv.c
new file mode 100644
index 000000000000..db789a55adaa
--- /dev/null
+++ b/tools/env/ubootenv.c
@@ -0,0 +1,62 @@
+/*
+ * 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: U-Boot environment get/set wrappers
+ *
+ */
+
+#include <stdio.h>
+
+#include "fw_env.h"
+
+/*
+ * Function: uboot_getenv
+ * Description: get U-Boot's environment variable
+ */
+int uboot_getenv(char *name, const char **value)
+{
+ int ret = 0;
+
+ ret = fw_env_open();
+ if (ret)
+ goto err;
+
+ *value = fw_getenv(name);
+
+err:
+ return ret ? -1 : 0;
+}
+
+/*
+ * Function: uboot_setenv
+ * Description: set U-Boot's environment variable
+ */
+int uboot_setenv(char *name, char *value)
+{
+ int ret = 0;
+
+ ret = fw_env_open();
+ if (ret)
+ goto err;
+
+ ret = fw_env_write(name, value);
+ if (ret)
+ goto err;
+
+ ret = fw_env_close();
+
+err:
+ return ret ? -1 : 0;
+}
diff --git a/tools/env/ubootenv.h b/tools/env/ubootenv.h
new file mode 100644
index 000000000000..d4043db75372
--- /dev/null
+++ b/tools/env/ubootenv.h
@@ -0,0 +1,46 @@
+/*
+ * 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: U-Boot environment get/set wrappers
+ *
+ */
+
+#ifndef UBOOTENV_H
+#define UBOOTENV_H
+
+/*
+ * Get U-Boot's environment variable.
+ *
+ * Params:
+ * 'name' (input) Name of the environment variable
+ * 'value' (output) Pointer to the variable's value
+ * (NULL if not found)
+ *
+ * Return: 0 on sucess, -1 on failure
+ */
+int uboot_getenv(char *name, const char **value);
+
+/*
+ * Set U-Boot's environment variable.
+ *
+ * Params:
+ * 'name' (input) Name of the environment variable
+ * 'value' (input) Value of the environment variable
+ *
+ * Return: 0 on sucess, -1 on failure
+ */
+int uboot_setenv(char *name, char *value);
+
+#endif /* UBOOTENV_H */

View File

@ -0,0 +1,27 @@
From: Stefano Babic <sbabic@denx.de>
Date: Mon, 22 Jun 2015 14:58:24 +0200
Subject: [PATCH] Allow fw env tools to be available as library
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
tools/env/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/env/Makefile b/tools/env/Makefile
index de4766ddf8dd..fa2a564bb357 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -23,10 +23,12 @@ endif
always := fw_printenv
hostprogs-y := fw_printenv
-fw_printenv-objs := fw_env.o fw_env_main.o \
+lib-y += fw_env.o \
crc32.o ctype.o linux_string.o \
env_attr.o env_flags.o aes.o ../../lib/md5.o
+fw_printenv-objs := fw_env_main.o $(lib-y)
+
quiet_cmd_crosstools_strip = STRIP $^
cmd_crosstools_strip = $(STRIP) $^; touch $@

View File

@ -6,6 +6,7 @@ SRC_URI += " \
file://fw_env.config \
file://0001-tools-env-implement-support-for-environment-encrypti.patch \
"
SRC_URI_append = " file://0004-Implement-U-Boot-environment-access-functions.patch"
SRC_URI_append_ccimx6 = " file://0002-fw_env-add-support-to-unlock-emmc-boot-partition.patch"
# We do not have a platform defconfig in this version of u-boot, so just use the generic
@ -14,6 +15,8 @@ UBOOT_CONFIG = "sandbox"
UBOOT_CONFIG[sandbox] = "sandbox_defconfig"
do_install_append() {
install -d ${D}${includedir}/libubootenv
install -m 0644 ${S}/tools/env/ubootenv.h ${D}${includedir}/libubootenv/
install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/
}

View File

@ -16,6 +16,10 @@
# Boot partitions
SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="linux*", ACTION=="add", RUN+="/etc/udev/scripts/mount_bootparts.sh", GOTO="automount_rules_end"
# Update partition
SUBSYSTEM=="block", ENV{ID_PART_ENTRY_NAME}=="update*", ACTION=="add", RUN+="/etc/udev/scripts/mount_partition.sh 'update'", GOTO="automount_rules_end"
SUBSYSTEM=="mtd", ATTRS{name}=="update", ACTION=="add", RUN+="/etc/udev/scripts/mount_partition.sh 'update'", GOTO="automount_rules_end"
# Media automounting
SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"

View File

@ -0,0 +1,46 @@
#!/bin/sh
#===============================================================================
#
# mount_partition.sh
#
# Copyright (C) 2017 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: Attempt to mount the partition triggered by udev
#
#===============================================================================
MOUNT="/bin/mount"
PARTITION_NAME="${1}"
MOUNTPOINT="/mnt/${PARTITION_NAME}"
# Use 'silent' if util-linux's mount (busybox's does not support that option)
[ "$(readlink ${MOUNT})" = "/bin/mount.util-linux" ] && MOUNT="${MOUNT} -o silent"
if mkdir -p "${MOUNTPOINT}" && ! mountpoint -q "${MOUNTPOINT}"; then
if [ "${SUBSYSTEM}" = "block" ]; then
FSTYPE="$(blkid ${DEVNAME} | sed -e 's,.*TYPE="\([^"]\+\)".*,\1,g')"
if ! mount ${FSTYPE:+-t ${FSTYPE}} "${DEVNAME}" "${MOUNTPOINT}"; then
logger -t udev "ERROR: Could not mount '${PARTITION_NAME}' partition"
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
fi
elif [ "${SUBSYSTEM}" = "mtd" ]; then
# Attach and get UBI device number
dev_number="$(ubiattach -p ${DEVNAME} 2>/dev/null | sed -ne 's,.*device number \([0-9]\).*,\1,g;T;p' 2>/dev/null)"
# Check if volume exists.
if ubinfo "/dev/ubi${dev_number}" -N "${PARTITION_NAME}" >/dev/null 2>&1; then
# Mount the volume.
if ! mount -t ubifs "ubi${dev_number}:${PARTITION_NAME}" "${MOUNTPOINT}"; then
logger -t udev "ERROR: Could not mount '${PARTITION_NAME}' partition"
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
fi
else
logger -t udev "ERROR: Could not mount '${PARTITION_NAME}' partition, volume not found"
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
fi
fi
fi

View File

@ -2,10 +2,14 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI += "file://mount_bootparts.sh"
SRC_URI += " \
file://mount_bootparts.sh \
file://mount_partition.sh \
"
do_install_append() {
install -m 0755 ${WORKDIR}/mount_bootparts.sh ${D}${sysconfdir}/udev/scripts/
install -m 0755 ${WORKDIR}/mount_partition.sh ${D}${sysconfdir}/udev/scripts/
# Bluetooth tty symlink
if [ -n "${BT_TTY}" ]; then

View File

@ -7,8 +7,8 @@ LICENSE = "CLOSED"
PKGNAME = "mca_tool"
SRC_URI = "${DIGI_PKG_SRC}/${PKGNAME}-${PV}.tar.gz"
SRC_URI[md5sum] = "bee011ed0f1f2394c55bedaeda92f5cf"
SRC_URI[sha256sum] = "d6983fb0941a8b8c63c7369ef7285190be19ef446fc2a206e25a2c545a1ea671"
SRC_URI[md5sum] = "eb36b9e98c3ac30372343567c29f385d"
SRC_URI[sha256sum] = "864fdf42ce313e1a55caa654d53d9b9efa0073034914eb7b2e1ecc95f1a4fbf2"
S = "${WORKDIR}/${PKGNAME}-${PV}"

View File

@ -4,14 +4,11 @@ SUMMARY = "Qualcomm's wireless driver for qca6564"
DESCRIPTION = "qcacld-2.0 module.bbclass mechanism."
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
DEPENDS = "virtual/kernel"
inherit module
CAF_MIRROR = "git://codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-2.0"
PV = "v4.2.74.63"
PV = "v4.2.79.63"
SRCBRANCH = "caf-wlan/QCA6564_LE_1.0.3_LA.4.2.2.3"
SRCREV = "38f01638d75bdf3eb83ac428a4b6ec528b26f541"
SRCREV = "b0ae2aa45bbba54600b537e90cb1aca34f2d1a13"
SRC_URI = " \
${CAF_MIRROR};destsuffix=${PV};branch=${SRCBRANCH} \
@ -29,16 +26,20 @@ SRC_URI = " \
file://0010-native_sdio-src-hif-Do-not-call-to-HIGH-SPEED-functi.patch \
file://0011-osdep_adf.h-fix-for-undefined-ath_sysctl_pktlog_size.patch \
file://0012-Kbuild-Add-compilation-flag-based-on-kernel-support.patch \
file://0013-Kbuild-do-not-create-an-auxiliar-p2p-on-init.patch \
file://0014-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch \
file://0015-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch \
file://0016-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch \
file://0017-Add-.gitignore-rules.patch \
file://0018-wlan_hdd_main-initialize-all-adapter-completion-vari.patch \
file://0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch \
file://0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch \
file://0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch \
file://0016-Add-.gitignore-rules.patch \
file://0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch \
file://0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch \
file://0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch \
file://0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch \
"
S = "${WORKDIR}/${PV}"
inherit module
EXTRA_OEMAKE += "CONFIG_CLD_HL_SDIO_CORE=y CONFIG_LINUX_QCMBR=y WLAN_OPEN_SOURCE=1"
# Explicity state it is not a QC platform, if not the driver will try to remap
# memory that is not allowed in ARMv6 (kernel commit
@ -48,7 +49,7 @@ EXTRA_OEMAKE += "CONFIG_NON_QC_PLATFORM=y"
EXTRA_OEMAKE += "BUILD_DEBUG_VERSION=0"
do_compile_prepend() {
export BUILD_VER=${PV}
export BUILD_VER=${PV}
}
do_install_append() {

View File

@ -1,22 +0,0 @@
From: Isaac Hermida <isaac.hermida@digi.com>
Date: Mon, 27 Jun 2016 13:07:23 +0200
Subject: [PATCH] Kbuild: do not create an auxiliar p2p on init
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
---
Kbuild | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Kbuild b/Kbuild
index 339262874c94..b14417a558cd 100644
--- a/Kbuild
+++ b/Kbuild
@@ -1254,7 +1254,7 @@ CDEFINES += -DQCA_HT_2040_COEX
else
#Open P2P device interface only for non-Mobile router use cases
-CDEFINES += -DWLAN_OPEN_P2P_INTERFACE
+# CDEFINES += -DWLAN_OPEN_P2P_INTERFACE
#Enable 2.4 GHz social channels in 5 GHz only mode for p2p usage
CDEFINES += -DWLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY

View File

@ -0,0 +1,76 @@
From: Alex Gonzalez <alex.gonzalez@digi.com>
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 <alex.gonzalez@digi.com>
---
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
{

View File

@ -0,0 +1,26 @@
From: Alex Gonzalez <alex.gonzalez@digi.com>
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 <alex.gonzalez@digi.com>
---
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 {

View File

@ -0,0 +1,23 @@
From: Alex Gonzalez <alex.gonzalez@digi.com>
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 <alex.gonzalez@digi.com>
---
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:

View File

@ -15,7 +15,10 @@
#
#===============================================================================
[ "${IFACE}" != "wlan0" ] && exit 0
[ "${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"
@ -68,7 +71,8 @@ case "${DTB_REGION_CODE}" in
esac
BDATA_LINK="${FIRMWARE_DIR}/bdwlan30.bin"
# Create a symbolic link to the FW file for the specific country region.
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})
@ -83,9 +87,10 @@ case "${REGULATORY_DOMAIN}" in
esac
# We don't want to rewrite NAND every time we boot so only
# change the link if it is wrong.
# 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.

View File

@ -8,6 +8,9 @@ CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZ4 is not set
CONFIG_EXPERT=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PERF_EVENTS=y
@ -19,9 +22,9 @@ CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
CONFIG_ARCH_MXC=y
CONFIG_SOC_IMX6Q=y
CONFIG_SOC_IMX6UL=y
# CONFIG_SWP_EMULATE is not set
CONFIG_ARM_ERRATA_764369=y
CONFIG_SMP=y
CONFIG_HAVE_ARM_ARCH_TIMER=y
CONFIG_VMSPLIT_2G=y
@ -37,7 +40,6 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_INTERACTIVE=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
@ -59,7 +61,6 @@ CONFIG_VLAN_8021Q=y
CONFIG_LLC2=y
CONFIG_CAN=y
CONFIG_CAN_FLEXCAN=y
CONFIG_CAN_M_CAN=y
CONFIG_BT=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
@ -68,13 +69,12 @@ 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_IBS=y
CONFIG_CFG80211=y
CONFIG_CFG80211_CERTIFICATION_ONUS=y
CONFIG_CFG80211_DEBUGFS=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_DEBUGFS=y
CONFIG_RFKILL=y
CONFIG_RFKILL_INPUT=y
CONFIG_RFKILL_REGULATOR=y
@ -95,14 +95,8 @@ CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
CONFIG_MTD_NAND_MXC=y
CONFIG_MTD_SPI_NOR=y
CONFIG_SPI_FSL_QUADSPI=y
CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
@ -112,15 +106,11 @@ CONFIG_EEPROM_AT25=y
CONFIG_SCSI=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_NETDEVICES=y
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_CADENCE is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
CONFIG_CS89x0=y
CONFIG_CS89x0_PLATFORM=y
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_INTEL is not set
@ -128,11 +118,14 @@ CONFIG_CS89x0_PLATFORM=y
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
CONFIG_SMC91X=y
CONFIG_SMC911X=y
CONFIG_SMSC911X=y
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
CONFIG_SMSC_PHY=y
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
@ -144,35 +137,28 @@ CONFIG_ATH_DEBUG=y
CONFIG_HOSTAP=y
CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
# CONFIG_RTL_CARDS is not set
CONFIG_INPUT_POLLDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=m
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_IMX=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ELANTECH=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_TOUCHSCREEN_FUSION_7_10=y
CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_MMA8450=y
CONFIG_INPUT_MPL3115=y
CONFIG_SENSOR_FXLS8471=y
CONFIG_INPUT_ISL29023=y
CONFIG_INPUT_MCA_CC6UL_PWRKEY=y
CONFIG_SERIO_SERPORT=m
# 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_ALGOBIT=y
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
CONFIG_I2C_IMX=y
@ -182,9 +168,6 @@ CONFIG_SPI_IMX=y
CONFIG_SPI_SPIDEV=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_MCA_CC6UL=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_74X164=y
CONFIG_POWER_SUPPLY=y
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_SYSCON_POWEROFF=y
@ -197,12 +180,6 @@ CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_NOWAYOUT=y
CONFIG_MCA_CC6UL_WATCHDOG=y
CONFIG_IMX2_WDT=y
CONFIG_MFD_DA9052_I2C=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
CONFIG_MFD_MAX17135=y
CONFIG_MFD_SI476X_CORE=y
CONFIG_MFD_STMPE=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ANATOP=y
@ -213,30 +190,25 @@ CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_MXC_OUTPUT=y
CONFIG_VIDEO_MXC_CAPTURE=y
CONFIG_MXC_CAMERA_OV5640=y
CONFIG_MXC_CAMERA_OV5642=y
CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=y
# CONFIG_MXC_IPU_PRP_ENC is not set
CONFIG_VIDEO_MXC_PXP_V4L2=y
CONFIG_VIDEO_MXC_CSI_CAMERA=y
CONFIG_MXC_SUBDEV_CAMERA_OV5640=y
CONFIG_MXC_SUBDEV_CAMERA_OV5642=y
CONFIG_SOC_CAMERA=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_VIDEO_CODA=y
CONFIG_SOC_CAMERA_OV2640=y
CONFIG_DRM=y
CONFIG_FB=y
# CONFIG_FB_MX3 is not set
CONFIG_FB_MXS=y
CONFIG_FB_MXC_SYNC_PANEL=y
CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
CONFIG_FB_MXC_LDB=y
CONFIG_FB_MXS_SII902X=y
CONFIG_FB_MXC_DCIC=m
CONFIG_HANNSTAR_CABC=y
CONFIG_FB_MXC_EINK_PANEL=y
CONFIG_FB_MXC_EINK_V2_PANEL=y
# CONFIG_FB_MXC_EDID is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_L4F00242T03=y
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_PWM=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
@ -247,14 +219,13 @@ CONFIG_FB_LOGO_CENTERED=y
# CONFIG_LOGO_LINUX_CLUT224 is not set
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_USB_AUDIO=m
# CONFIG_SND_SPI is not set
# CONFIG_SND_USB is not set
CONFIG_SND_SOC=y
CONFIG_SND_SOC_FSL_ASRC=y
CONFIG_SND_SOC_FSL_SAI=y
CONFIG_SND_SOC_FSL_SSI=y
CONFIG_SND_SOC_FSL_ESAI=y
CONFIG_SND_SOC_IMX_AUDMUX=y
CONFIG_SND_IMX_SOC=y
CONFIG_SND_SOC_IMX_MAX98088=y
CONFIG_SND_SOC_IMX_SPDIF=y
CONFIG_USB=y
CONFIG_USB_OTG_WHITELIST=y
@ -323,28 +294,17 @@ CONFIG_STAGING_MEDIA=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_IIO=y
CONFIG_MCA_CC6UL_ADC=y
CONFIG_VF610_ADC=y
CONFIG_TAMPER_MCA_CC6UL=y
CONFIG_PWM=y
CONFIG_PWM_IMX=y
# CONFIG_RESET_GPIO is not set
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
@ -361,13 +321,15 @@ CONFIG_MAGIC_SYSRQ=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_FTRACE is not set
CONFIG_SECURITYFS=y
CONFIG_CRYPTO_USER=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_TEST=m
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_XTS=y
CONFIG_CRYPTO_GHASH=y
CONFIG_CRYPTO_MD4=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_RMD128=y

View File

@ -27,28 +27,34 @@ S = "${WORKDIR}/git"
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
do_deploy_append() {
if [ "${TRUSTFENCE_SIGN}" = "1" ]; then
# Set environment variables for trustfence configuration
export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}"
[ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}"
[ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}"
# Sign/encrypt the kernel image
"${STAGING_BINDIR_NATIVE}/trustfence-sign-kernel.sh" -p "${DIGI_FAMILY}" -l "${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin" "${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}-signed.bin"
mv "${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}-signed.bin" "${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin"
# Sign/encrypt the device tree blobs
if [ -n "${KERNEL_DEVICETREE}" ]; then
for DTB_NAME in ${KERNEL_DEVICETREE}; do
DTB="${B}/arch/${ARCH}/boot/dts/${DTB_NAME}"
"${STAGING_BINDIR_NATIVE}/trustfence-sign-kernel.sh" -p "${DIGI_FAMILY}" -d "${DTB}" "${DTB}-signed"
mv "${DTB}-signed" "${DTB}"
done
fi
fi
(cd ${DEPLOYDIR} && ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME})
}
do_deploy[postfuncs] += "${@base_conditional('TRUSTFENCE_SIGN', '1', 'trustfence_sign', '', d)}"
trustfence_sign() {
# Set environment variables for trustfence configuration
export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}"
[ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}"
[ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}"
# Sign/encrypt the kernel image
KERNEL_IMAGE="$(readlink -e ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME})"
TMP_KERNEL_IMAGE_SIGNED="$(mktemp ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME}-signed.XXXXXX)"
trustfence-sign-kernel.sh -p "${DIGI_FAMILY}" -l "${KERNEL_IMAGE}" "${TMP_KERNEL_IMAGE_SIGNED}"
mv "${TMP_KERNEL_IMAGE_SIGNED}" "${KERNEL_IMAGE}"
# Sign/encrypt the device tree blobs
if [ -n "${KERNEL_DEVICETREE}" ]; then
for DTB_NAME in ${KERNEL_DEVICETREE}; do
DTB=$(readlink -e ${DEPLOYDIR}/${KERNEL_IMAGETYPE}-${DTB_NAME})
TMP_DTB_SIGNED="$(mktemp ${DEPLOYDIR}/${KERNEL_IMAGETYPE}-${DTB_NAME}-signed.XXXXXX)"
trustfence-sign-kernel.sh -p "${DIGI_FAMILY}" -d "${DTB}" "${TMP_DTB_SIGNED}"
mv "${TMP_DTB_SIGNED}" "${DTB}"
done
fi
}
do_deploy[vardeps] += "TRUSTFENCE_SIGN_KEYS_PATH TRUSTFENCE_KEY_INDEX TRUSTFENCE_DEK_PATH"
FILES_kernel-image += "/boot/config-${KERNEL_VERSION}"

View File

@ -1,6 +1,6 @@
DISTRO = "dey"
DISTRO_NAME = "Digi Embedded Yocto"
DISTRO_VERSION = "2.0-r4"
DISTRO_VERSION = "2.0-r5"
DISTRO_CODENAME = "jethro"
SDK_VENDOR = "-deysdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'}"
@ -25,6 +25,9 @@ POKY_DEFAULT_DISTRO_FEATURES_remove = "ptest wayland"
GRAPHICAL_BACKEND = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'fb', d)}"
# Recovery initramfs image name.
RECOVERY_INITRAMFS_IMAGE ?= "dey-image-recovery-initramfs"
# DEY image features (alphabetical order)
FEATURE_PACKAGES_dey-audio = "packagegroup-dey-audio"
FEATURE_PACKAGES_dey-bluetooth = "packagegroup-dey-bluetooth"
@ -50,6 +53,9 @@ PREFERRED_VERSION_linux-yocto_qemumips ?= "4.1%"
PREFERRED_VERSION_linux-yocto_qemumips64 ?= "4.1%"
PREFERRED_VERSION_linux-yocto_qemuppc ?= "4.1%"
# Use swupdate version 2016.10
PREFERRED_VERSION_swupdate = "2016.10+git%"
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"

View File

@ -0,0 +1,8 @@
ctrl_interface=/var/run/wpa_supplicant
update_config=1
device_name=ccimx6ul-p2p
manufacturer=QCA
model_name=McK
device_type=1-0050F204-1
config_methods=display keypad push_button
persistent_reconnect=1

View File

@ -4,4 +4,10 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
PACKAGECONFIG ?= "openssl"
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
}
PACKAGE_ARCH = "${MACHINE_ARCH}"

View File

@ -27,18 +27,17 @@ usage() {
suspend_interfaces() {
if grep -qs '^wlan0' /var/run/ifstate; then
ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod wlan
ifdown wlan0 && up_wlan_on_resume="1"
fi
if hcitool -i hci0 dev >/dev/null 2>&1; then
hciconfig hci0 down && up_hci0_on_resume="1" && sleep 0.5
if grep -qs '^wlan' /proc/modules; then
rmmod wlan
fi
}
resume_interfaces() {
if ! grep -qs '^wlan0' /var/run/ifstate; then
[ -n "${up_wlan_on_resume}" ] && modprobe wlan && sleep 0.5 && ifup wlan0
[ -n "${up_wlan_on_resume}" ] && ifup wlan0
fi
[ -n "${up_hci0_on_resume}" ] && hciconfig hci0 up
}
while getopts "h" c; do

View File

@ -26,6 +26,11 @@ IMAGE_FEATURES += " \
${@bb.utils.contains('MACHINE_FEATURES', 'wifi', 'dey-wireless', '', d)} \
"
# Separately add 'dey-gstreamer' to ccimx6ulsbc platform.
# This platform does not have 'accel-video' but we want gstreamer for using
# it with video/camera
IMAGE_FEATURES_append_ccimx6ulsbc = " dey-gstreamer"
# Remove some features to reduce the rootfs size to fit in the internal storage.
IMAGE_FEATURES_remove_ccimx6ul = "package-management"

View File

@ -0,0 +1,34 @@
# Copyright (C) 2016 Digi International.
DESCRIPTION = "Recovery initramfs image"
LICENSE = "MIT"
PACKAGE_INSTALL = " \
busybox \
psplash \
recovery-initramfs \
swupdate \
trustfence-tool \
u-boot-fw-utils \
wipe \
"
PACKAGE_INSTALL_append_ccimx6 = " e2fsprogs-mke2fs parted"
PACKAGE_INSTALL_append_ccimx6ul = " mtd-utils-ubifs"
# Do not pollute the initrd image with rootfs features
IMAGE_FEATURES = ""
IMAGE_LINGUAS = ""
IMAGE_FSTYPES = "cpio.gz.u-boot.tf"
inherit core-image image_types_uboot
IMAGE_ROOTFS_SIZE = "8192"
# Remove some packages added via recommendations
BAD_RECOMMENDATIONS += " \
busybox-syslog \
openssl-conf \
"
export IMAGE_BASENAME = "dey-image-recovery-initramfs"

View File

@ -7,6 +7,5 @@ include dey-image-tiny.bb
export IMAGE_BASENAME = "dey-image-tiny-initramfs"
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
IMAGE_FSTYPES_append = " rootfs.initramfs"
IMAGE_FSTYPES = "cpio.gz.u-boot.tf"
inherit image_types_uboot

View File

@ -0,0 +1,10 @@
# WiFi P2P interface
#auto ##WLAN_P2P_INTERFACE##
iface ##WLAN_P2P_INTERFACE## inet static
address ##P2P0_STATIC_IP##
netmask ##P2P0_STATIC_NETMASK##
gateway ##P2P0_STATIC_GATEWAY##
dns-nameservers ##P2P0_STATIC_DNS##
wpa-driver ##WPA_DRIVER##
wpa-conf /etc/wpa_supplicant_p2p.conf

View File

@ -13,6 +13,7 @@ SRC_URI_append = " \
file://interfaces.eth1.dhcp \
file://interfaces.wlan0.static \
file://interfaces.wlan0.dhcp \
file://interfaces.p2p \
file://interfaces.cellular \
file://resolv \
"
@ -26,7 +27,15 @@ do_install_append() {
# 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
[ -n "${HAVE_WIFI}" ] && cat ${WORKDIR}/interfaces.wlan0.${WLAN0_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
sed -i -e 's,##WLAN_P2P_INTERFACE##,${WLAN_P2P_INTERFACE},g' ${D}${sysconfdir}/network/interfaces
fi
fi
cat ${WORKDIR}/interfaces.br0.example >> ${D}${sysconfdir}/network/interfaces
# Remove config entries if corresponding variable is not defined
@ -42,6 +51,10 @@ do_install_append() {
[ -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
@ -94,5 +107,9 @@ do_install_append() {
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
sed -i -e "s,##P2P0_STATIC_DNS##,${P2P0_STATIC_DNS},g" ${D}${sysconfdir}/network/interfaces
sed -i -e "s,##WPA_DRIVER##,${WPA_DRIVER},g" ${D}${sysconfdir}/network/interfaces
}

View File

@ -32,6 +32,7 @@ RDEPENDS_${PN} = "\
busybox \
busybox-acpid \
busybox-static-nodes \
cloudconnector \
${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
${@bb.utils.contains("MACHINE_FEATURES", "rtc", "busybox-hwclock", "", d)} \
${@bb.utils.contains("MACHINE_FEATURES", "touchscreen", "${VIRTUAL-RUNTIME_touchscreen}", "",d)} \
@ -39,6 +40,7 @@ RDEPENDS_${PN} = "\
modutils-initscripts \
netbase \
os-release \
recovery-utils \
sysinfo \
usbutils \
${VIRTUAL-RUNTIME_dev_manager} \

View File

@ -0,0 +1,33 @@
From: David Escalona <david.escalona@digi.com>
Date: Thu, 29 Dec 2016 09:42:26 +0100
Subject: [PATCH] colors: modify psplash colors to match Digi scheme
Signed-off-by: David Escalona <david.escalona@digi.com>
---
psplash-colors.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/psplash-colors.h b/psplash-colors.h
index d701089..0795409 100644
--- a/psplash-colors.h
+++ b/psplash-colors.h
@@ -20,15 +20,15 @@
#define _HAVE_PSPLASH_COLORS_H
/* This is the overall background color */
-#define PSPLASH_BACKGROUND_COLOR 0xec,0xec,0xe1
+#define PSPLASH_BACKGROUND_COLOR 0x00,0x00,0x00
/* This is the color of any text output */
-#define PSPLASH_TEXT_COLOR 0x6d,0x6d,0x70
+#define PSPLASH_TEXT_COLOR 0xff,0xff,0xff
/* This is the color of the progress bar indicator */
-#define PSPLASH_BAR_COLOR 0x6d,0x6d,0x70
+#define PSPLASH_BAR_COLOR 0xca,0xca,0xca
/* This is the color of the progress bar background */
-#define PSPLASH_BAR_BACKGROUND_COLOR 0xec,0xec,0xe1
+#define PSPLASH_BAR_BACKGROUND_COLOR 0x00,0x00,0x00
#endif

View File

@ -0,0 +1,104 @@
From: David Escalona <david.escalona@digi.com>
Date: Thu, 29 Dec 2016 10:45:39 +0100
Subject: [PATCH] bar: replace progress bar with Digi one
Signed-off-by: David Escalona <david.escalona@digi.com>
---
psplash-bar-img.h | 84 ++++++++++++++++++++++++++++---------------------------
1 file changed, 43 insertions(+), 41 deletions(-)
diff --git a/psplash-bar-img.h b/psplash-bar-img.h
index c1c7626..28843cd 100644
--- a/psplash-bar-img.h
+++ b/psplash-bar-img.h
@@ -1,47 +1,49 @@
/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */
-#define BAR_IMG_ROWSTRIDE (920)
-#define BAR_IMG_WIDTH (230)
-#define BAR_IMG_HEIGHT (28)
+#define BAR_IMG_ROWSTRIDE (1520)
+#define BAR_IMG_WIDTH (380)
+#define BAR_IMG_HEIGHT (30)
#define BAR_IMG_BYTES_PER_PIXEL (4) /* 3:RGB, 4:RGBA */
#define BAR_IMG_RLE_PIXEL_DATA ((uint8*) \
- "\203\354\354\341\377\4\326\326\315\377\236\236\233\377\200\200\201\377" \
- "nnq\377\377mmp\377\331mmp\377\4nnq\377\200\200\201\377\236\236\233\377" \
- "\326\326\315\377\205\354\354\341\377\2\260\260\253\377oor\377\377mmp" \
- "\377\337mmp\377\2oor\377\260\260\253\377\203\354\354\341\377\1\262\262" \
- "\256\377\377mmp\377\343mmp\377\4\262\262\256\377\354\354\341\377\332" \
- "\332\321\377pps\377\377mmp\377\343mmp\377\3pps\377\332\332\321\377\244" \
- "\244\241\377\204mmp\377\1\205\205\205\377\377\354\354\341\377\333\354" \
- "\354\341\377\1\205\205\205\377\204mmp\377\2\244\244\241\377\210\210\210" \
- "\377\203mmp\377\2\203\203\203\377\351\351\336\377\377\354\354\341\377" \
- "\333\354\354\341\377\2\351\351\336\377\203\203\203\377\203mmp\377\2\210" \
- "\210\210\377qqs\377\203mmp\377\1\255\255\251\377\377\354\354\341\377" \
- "\335\354\354\341\377\1\255\255\251\377\203mmp\377\1qqs\377\204mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\210mmp\377" \
- "\1\270\270\262\377\377\354\354\341\377\336\354\354\341\377\204mmp\377" \
- "\1qqs\377\203mmp\377\1\255\255\251\377\377\354\354\341\377\335\354\354" \
- "\341\377\1\255\255\251\377\203mmp\377\2qqs\377\210\210\210\377\203mm" \
- "p\377\2\203\203\203\377\351\351\336\377\377\354\354\341\377\333\354\354" \
- "\341\377\2\351\351\336\377\203\203\203\377\203mmp\377\2\210\210\210\377" \
- "\244\244\241\377\204mmp\377\1\205\205\205\377\377\354\354\341\377\333" \
- "\354\354\341\377\1\205\205\205\377\204mmp\377\3\244\244\241\377\332\332" \
- "\321\377pps\377\377mmp\377\343mmp\377\4pps\377\332\332\321\377\354\354" \
- "\341\377\262\262\256\377\377mmp\377\343mmp\377\1\262\262\256\377\203" \
- "\354\354\341\377\2\260\260\253\377oor\377\377mmp\377\337mmp\377\2oor" \
- "\377\260\260\253\377\205\354\354\341\377\4\326\326\315\377\236\236\233" \
- "\377\200\200\201\377nnq\377\377mmp\377\331mmp\377\4nnq\377\200\200\201" \
- "\377\236\236\233\377\326\326\315\377\203\354\354\341\377")
+ "\377\312\312\312\377\377\312\312\312\377\377\312\312\312\377\377\312\312" \
+ "\312\377\377\312\312\312\377\377\312\312\312\377\377\377\377\377\0\377" \
+ "\377\377\377\0\372\377\377\377\0\204\312\312\312\377\377\377\377\377" \
+ "\0\377\377\377\377\0\372\377\377\377\0\204\312\312\312\377\377\377\377" \
+ "\377\0\377\377\377\377\0\372\377\377\377\0\204\312\312\312\377\377\377" \
+ "\377\377\0\377\377\377\377\0\372\377\377\377\0\204\312\312\312\377\377" \
+ "\377\377\377\0\377\377\377\377\0\372\377\377\377\0\204\312\312\312\377" \
+ "\377\377\377\377\0\377\377\377\377\0\372\377\377\377\0\204\312\312\312" \
+ "\377\377\377\377\377\0\377\377\377\377\0\372\377\377\377\0\204\312\312" \
+ "\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377\377\0\204\312" \
+ "\312\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377\377\0\204" \
+ "\312\312\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377\377" \
+ "\0\204\312\312\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377" \
+ "\377\0\202\312\312\312\377\2\312\312\312\373\312\312\312\377\377\377" \
+ "\377\377\0\377\377\377\377\0\372\377\377\377\0\1\312\312\312\377\202" \
+ "\312\312\312\373\1\312\312\312\377\377\377\377\377\0\377\377\377\377" \
+ "\0\372\377\377\377\0\1\312\312\312\377\202\312\312\312\373\1\312\312" \
+ "\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377\377\0\1\312" \
+ "\312\312\377\202\312\312\312\373\1\312\312\312\377\377\377\377\377\0" \
+ "\377\377\377\377\0\372\377\377\377\0\1\312\312\312\377\202\312\312\312" \
+ "\373\1\312\312\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377" \
+ "\377\0\1\312\312\312\377\202\312\312\312\373\1\312\312\312\377\377\377" \
+ "\377\377\0\377\377\377\377\0\372\377\377\377\0\1\312\312\312\377\202" \
+ "\312\312\312\373\1\312\312\312\377\377\377\377\377\0\377\377\377\377" \
+ "\0\372\377\377\377\0\1\312\312\312\377\202\312\312\312\373\1\312\312" \
+ "\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377\377\0\1\312" \
+ "\312\312\377\202\312\312\312\373\1\312\312\312\377\377\377\377\377\0" \
+ "\377\377\377\377\0\372\377\377\377\0\1\312\312\312\377\202\312\312\312" \
+ "\373\1\312\312\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377" \
+ "\377\0\1\312\312\312\377\202\312\312\312\373\1\312\312\312\377\377\377" \
+ "\377\377\0\377\377\377\377\0\372\377\377\377\0\1\312\312\312\377\202" \
+ "\312\312\312\373\1\312\312\312\377\377\377\377\377\0\377\377\377\377" \
+ "\0\372\377\377\377\0\1\312\312\312\377\202\312\312\312\373\1\312\312" \
+ "\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377\377\0\1\312" \
+ "\312\312\377\202\312\312\312\373\1\312\312\312\377\377\377\377\377\0" \
+ "\377\377\377\377\0\372\377\377\377\0\1\312\312\312\377\202\312\312\312" \
+ "\373\1\312\312\312\377\377\377\377\377\0\377\377\377\377\0\372\377\377" \
+ "\377\0\1\312\312\312\377\202\312\312\312\373\377\312\312\312\377\377" \
+ "\312\312\312\377\374\312\312\312\377\202\312\312\312\373\377\312\312" \
+ "\312\377\377\312\312\312\377\374\312\312\312\377\1\312\312\312\373")

View File

@ -0,0 +1,31 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: psplash
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
### END INIT INFO
read CMDLINE < /proc/cmdline
for x in $CMDLINE; do
case $x in
psplash=false)
echo "Boot splashscreen disabled"
exit 0;
;;
esac
done
export TMPDIR=/mnt/.psplash
mount tmpfs -t tmpfs $TMPDIR -o,size=40k
rotation=0
if [ -e /etc/rotation ]; then
read rotation < /etc/rotation
fi
if [ -c "${FBDEV:-/dev/fb0}" ]; then
/usr/bin/psplash --angle $rotation &
fi

View File

@ -0,0 +1,718 @@
/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */
#define POKY_IMG_ROWSTRIDE (1350)
#define POKY_IMG_WIDTH (450)
#define POKY_IMG_HEIGHT (200)
#define POKY_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0" \
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0" \
"\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" \
"\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\312" \
"\0\0\0\14\15\15\15\37\37\37""555VVV}}}\235\235\235\265\265\265\311\311" \
"\311\325\325\325\341\341\341\350\350\350\360\360\360\213\374\374\374" \
"\20\360\360\360\350\350\350\337\337\337\325\325\325\317\317\317\302\302" \
"\302\271\271\271\235\235\235\227\227\227}}}YYYQQQ;;;\37\37\37\12\12\12" \
"\3\3\3\377\0\0\0\312\0\0\0\1\37\37\37\265\40\40\40\6\37\37\37\22\22\22" \
"\21\21\21\22\22\22\16\16\16\6\6\6\276\0\0\0\2\11\11\11\37\37\37\227\40" \
"\40\40\2###\25\25\25\270\0\0\0\7\16\16\16(((VVV\204\204\204\241\241\241" \
"\305\305\305\352\352\352\242\377\377\377\12\350\350\350\300\300\300\253" \
"\253\253\225\225\225\177\177\177\\\\\\999+++\25\25\25\6\6\6\252\0\0\0" \
"\1\5\5\5\230\40\40\40\2###\32\32\32\240\0\0\0\2\7\13\5\21\32\15\332\21" \
"\30\14\2\21\32\15\327\327\327\265\342\342\342\1\341\341\341\202\322\322" \
"\322\12\325\325\325\314\314\314\265\265\265\243\243\243\211\211\211t" \
"ttYYY555\22\22\22\5\5\5\267\0\0\0\2EEE\337\337\337\227\342\342\342\3" \
"\344\344\344\241\241\241\5\5\5\263\0\0\0\7\5\5\5'''\\\\\\\223\223\223" \
"\313\313\313\347\347\347\373\373\373\253\377\377\377\13\376\376\376\360" \
"\360\360\350\350\350\327\327\327\266\266\266\217\217\217qqqQQQ(((\22" \
"\22\22\5\5\5\244\0\0\0\1###\230\342\342\342\2\344\344\344\273\273\273" \
"\240\0\0\0\2""9T*v\256V\332u\255V\2x\261X\373\373\373\277\377\377\377" \
"\6\360\360\360\331\331\331\262\262\262{{{EEE\15\15\15\264\0\0\0\1KKK" \
"\231\377\377\377\2\265\265\265\3\3\3\261\0\0\0\4'''iii\260\260\260\350" \
"\350\350\270\377\377\377\7\354\354\354\331\331\331\257\257\257\201\201" \
"\201YYY555\16\16\16\240\0\0\0\1'''\231\377\377\377\1\331\331\331\240" \
"\0\0\0\1>\\.\333\204\303a\2d\223I\363\363\363\303\377\377\377\5\371\371" \
"\371\327\327\327\230\230\230CCC\21\21\21\261\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\256\0\0\0\4\22\22\22UUU\262\262\262" \
"\347\347\347\300\377\377\377\3\360\360\360\320\320\320%%%\237\0\0\0\1" \
"%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\332\204\303a\3a\216" \
"G\14\22\11\363\363\363\307\377\377\377\3\313\313\313}}}(((\257\0\0\0" \
"\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\254\0\0\0\3\40" \
"\40\40rrr\320\320\320\304\377\377\377\2\363\363\363(((\237\0\0\0\1%%" \
"%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\331\204\303a\4a\220H\14" \
"\22\11\0\0\0\363\363\363\311\377\377\377\3\344\344\344\214\214\214((" \
"(\255\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\252" \
"\0\0\0\3\35\35\35}}}\333\333\333\306\377\377\377\2\327\327\327\32\32" \
"\32\237\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\330\204" \
"\303a\2`\215F\14\22\11\202\0\0\0\1\363\363\363\313\377\377\377\3\352" \
"\352\352\211\211\211\27\27\27\253\0\0\0\2HHH\371\371\371\230\377\377" \
"\377\2\260\260\260\3\3\3\251\0\0\0\2YYY\337\337\337\310\377\377\377\2" \
"\302\302\302\15\15\15\237\0\0\0\1%%%\231\377\377\377\1\322\322\322\240" \
"\0\0\0\1<Y,\327\204\303a\2a\216G\13\21\10\203\0\0\0\1\363\363\363\315" \
"\377\377\377\3\327\327\327\\\\\\\3\3\3\251\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\247\0\0\0\3\11\11\11\177\177\177\367" \
"\367\367\311\377\377\377\2\262\262\262\3\3\3\237\0\0\0\1%%%\231\377\377" \
"\377\1\322\322\322\240\0\0\0\1<Y,\326\204\303a\2a\216G\14\22\11\204\0" \
"\0\0\1\363\363\363\317\377\377\377\2\244\244\244\37\37\37\250\0\0\0\2" \
"HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\246\0\0\0\2###\273" \
"\273\273\313\377\377\377\1\235\235\235\240\0\0\0\1%%%\231\377\377\377" \
"\1\322\322\322\240\0\0\0\1<Y,\325\204\303a\2a\220H\14\22\11\205\0\0\0" \
"\1\363\363\363\320\377\377\377\2\322\322\322HHH\247\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\245\0\0\0\2""777\325\325\325" \
"\314\377\377\377\1\207\207\207\240\0\0\0\1%%%\231\377\377\377\1\322\322" \
"\322\240\0\0\0\1<Y,\324\204\303a\2_\214E\14\21\11\206\0\0\0\1\363\363" \
"\363\321\377\377\377\2\367\367\367eee\246\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\244\0\0\0\2OOO\347\347\347\315\377\377" \
"\377\1rrr\240\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y" \
",\323\204\303a\2a\220H\14\21\11\207\0\0\0\1\363\363\363\322\377\377\377" \
"\2\371\371\371ggg\245\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\243\0\0\0\2ZZZ\365\365\365\315\377\377\377\2\376\376\376Y" \
"YY\240\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\322\204" \
"\303a\2a\216G\14\22\11\210\0\0\0\1\363\363\363\323\377\377\377\2\376" \
"\376\376{{{\244\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\242\0\0\0\2VVV\363\363\363\316\377\377\377\2\371\371\371CCC\240" \
"\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\321\204\303" \
"a\2`\215F\14\21\11\211\0\0\0\1\363\363\363\324\377\377\377\2\376\376" \
"\376ttt\243\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3" \
"\3\241\0\0\0\2EEE\356\356\356\317\377\377\377\2\363\363\363///\240\0" \
"\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\320\204\303a\2" \
"_\214E\13\21\10\212\0\0\0\1\363\363\363\325\377\377\377\2\376\376\376" \
"lll\242\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\240" \
"\0\0\0\2+++\344\344\344\320\377\377\377\2\352\352\352\25\25\25\240\0" \
"\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\317\204\303a\2" \
"a\220H\14\21\11\213\0\0\0\1\363\363\363\326\377\377\377\2\367\367\367" \
"HHH\241\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\237" \
"\0\0\0\2\22\22\22\305\305\305\321\377\377\377\2\335\335\335\16\16\16" \
"\240\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\316\204" \
"\303a\2a\216G\14\22\11\214\0\0\0\1\363\363\363\327\377\377\377\2\337" \
"\337\337%%%\240\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\237\0\0\0\1\214\214\214\322\377\377\377\2\305\305\305\11\11\11" \
"\240\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\315\204" \
"\303a\2a\216G\14\21\11\215\0\0\0\1\363\363\363\330\377\377\377\2\257" \
"\257\257\5\5\5\237\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\236\0\0\0\2HHH\371\371\371\322\377\377\377\2\253\253\253\1\1\1" \
"\240\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\314\204" \
"\303a\2a\216G\14\21\11\216\0\0\0\1\363\363\363\330\377\377\377\2\376" \
"\376\376eee\237\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\235\0\0\0\2\16\16\16\314\314\314\323\377\377\377\1\225\225\225" \
"\241\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\313\204" \
"\303a\2b\221H\14\22\11\217\0\0\0\1\363\363\363\331\377\377\377\2\337" \
"\337\337\32\32\32\236\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\235\0\0\0\1eee\324\377\377\377\1\177\177\177\241\0\0\0\1%" \
"%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\312\204\303a\2`\215F" \
"\14\22\11\220\0\0\0\1\363\363\363\332\377\377\377\1\211\211\211\236\0" \
"\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\234\0\0\0\2" \
"\16\16\16\322\322\322\324\377\377\377\1iii\241\0\0\0\1%%%\231\377\377" \
"\377\1\322\322\322\240\0\0\0\1<Y,\311\204\303a\2a\216G\14\21\11\221\0" \
"\0\0\1\363\363\363\332\377\377\377\2\352\352\352%%%\235\0\0\0\2HHH\371" \
"\371\371\230\377\377\377\2\260\260\260\3\3\3\234\0\0\0\1aaa\252\377\377" \
"\377\5\376\376\376\365\365\365\352\352\352\342\342\342\327\327\327\211" \
"\325\325\325\4\331\331\331\344\344\344\342\342\342\352\352\352\202\363" \
"\363\363\1\374\374\374\226\377\377\377\1\\\\\\\241\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\310\204\303a\2a\216G\14\22\11\222" \
"\0\0\0\1\374\374\374\333\377\377\377\1yyy\235\0\0\0\2HHH\371\371\371" \
"\230\377\377\377\2\260\260\260\3\3\3\233\0\0\0\2\5\5\5\262\262\262\245" \
"\377\377\377\11\352\352\352\313\313\313\243\243\243{{{gggSSS<<<'''\27" \
"\27\27\212\0\0\0\4\3\3\3\30\30\30\27\27\27(((\202999\12OOOZZZooo\204" \
"\204\204\237\237\237\254\254\254\307\307\307\344\344\344\356\356\356" \
"\371\371\371\214\377\377\377\2\371\371\371HHH\241\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\307\204\303a\2b\221H\14\22\11\223" \
"\0\0\0\1\207\207\207\261\214\214\214\3\213\213\213\220\220\220\243\243" \
"\243\202\244\244\244\4\273\273\273\331\331\331\356\356\356\376\376\376" \
"\241\377\377\377\2\307\307\307\16\16\16\234\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\233\0\0\0\2(((\347\347\347\241\377\377" \
"\377\7\356\356\356\276\276\276\214\214\214UUU###\21\21\21\1\1\1\233\0" \
"\0\0\14\5\5\5\16\16\16\35\35\35(((CCCaaa\207\207\207\235\235\235\300" \
"\300\300\337\337\337\363\363\363\374\374\374\205\377\377\377\2\354\354" \
"\354222\241\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\306" \
"\204\303a\2_\215F\14\21\11\313\0\0\0\6\6\6\6\27\27\27///YYY\241\241\241" \
"\352\352\352\237\377\377\377\2\367\367\367AAA\234\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\233\0\0\0\1aaa\240\377\377\377" \
"\4\325\325\325\177\177\177///\6\6\6\250\0\0\0\13\12\12\12\35\35\35""9" \
"99YYY\217\217\217\260\260\260\313\313\313\373\373\373\377\377\377\350" \
"\350\350\40\40\40\241\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\305\204\303a\2`\215F\13\21\10\321\0\0\0\3%%%vvv\354\354\354" \
"\236\377\377\377\1}}}\234\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\233\0\0\0\1\223\223\223\236\377\377\377\3\337\337\337" \
"kkk\25\25\25\260\0\0\0\6\3\3\3\21\21\21///ggg\207\207\207\21\21\21\241" \
"\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\304\204\303" \
"a\2_\215F\14\21\11\324\0\0\0\2///\302\302\302\235\377\377\377\2\271\271" \
"\271\3\3\3\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3" \
"\3\3\232\0\0\0\2\6\6\6\300\300\300\235\377\377\377\2\266\266\266\40\40" \
"\40\331\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\303\204" \
"\303a\2b\221H\14\22\11\326\0\0\0\2\16\16\16\253\253\253\234\377\377\377" \
"\2\344\344\344\27\27\27\233\0\0\0\2HHH\371\371\371\230\377\377\377\2" \
"\260\260\260\3\3\3\232\0\0\0\2\22\22\22\342\342\342\234\377\377\377\2" \
"\317\317\317\40\40\40\332\0\0\0\1%%%\231\377\377\377\1\322\322\322\240" \
"\0\0\0\1<Y,\302\204\303a\2`\215F\14\22\11\330\0\0\0\2\21\21\21\325\325" \
"\325\233\377\377\377\2\365\365\365<<<\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\233" \
"\377\377\377\2\350\350\350---\333\0\0\0\1%%%\231\377\377\377\1\322\322" \
"\322\240\0\0\0\1<Y,\301\204\303a\2a\216G\14\21\11\332\0\0\0\2___\376" \
"\376\376\232\377\377\377\2\376\376\376bbb\233\0\0\0\2HHH\371\371\371" \
"\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2""111\367\367\367\232" \
"\377\377\377\2\373\373\373ZZZ\334\0\0\0\1%%%\231\377\377\377\1\322\322" \
"\322\240\0\0\0\1<Y,\300\204\303a\2a\216G\14\22\11\333\0\0\0\2\6\6\6\271" \
"\271\271\233\377\377\377\1{{{\233\0\0\0\2HHH\371\371\371\230\377\377" \
"\377\2\260\260\260\3\3\3\232\0\0\0\2<<<\371\371\371\232\377\377\377\1" \
"\246\246\246\335\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1" \
"<Y,\277\204\303a\2b\221H\14\22\11\335\0\0\0\2OOO\371\371\371\232\377" \
"\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\232\0\0\0\2'''\363\363\363\231\377\377\377\2\360\360\360" \
";;;\335\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\276\204" \
"\303a\2_\214E\14\22\11\336\0\0\0\2\12\12\12\302\302\302\232\377\377\377" \
"\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\232\0\0\0\2\25\25\25\360\360\360\231\377\377\377\2\250\250\250" \
"\3\3\3\335\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\275" \
"\204\303a\2a\216G\13\21\10\340\0\0\0\1{{{\232\377\377\377\1\214\214\214" \
"\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0" \
"\0\0\2\30\30\30\360\360\360\230\377\377\377\2\376\376\376VVV\336\0\0" \
"\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\274\204\303a\2a" \
"\216G\14\22\11\341\0\0\0\2""777\371\371\371\231\377\377\377\1\214\214" \
"\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232" \
"\0\0\0\2\30\30\30\360\360\360\230\377\377\377\2\344\344\344\22\22\22" \
"\336\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\273\204" \
"\303a\2a\220H\14\22\11\342\0\0\0\2\21\21\21\331\331\331\231\377\377\377" \
"\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\232\0\0\0\2\30\30\30\360\360\360\230\377\377\377\1\244\244\244" \
"\337\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\272\204" \
"\303a\2^\212E\13\21\10\270\0\0\0\3\35\35\35ggg\5\5\5\250\0\0\0\2\3\3" \
"\3\257\257\257\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371" \
"\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360" \
"\230\377\377\377\1ggg\337\0\0\0\1%%%\231\377\377\377\1\322\322\322\240" \
"\0\0\0\1<Y,\271\204\303a\2a\216G\13\21\10\270\0\0\0\1\16\16\16\202\271" \
"\271\271\1\1\1\1\251\0\0\0\1\217\217\217\231\377\377\377\1\214\214\214" \
"\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0" \
"\0\0\2\30\30\30\360\360\360\227\377\377\377\2\367\367\367\77\77\77\337" \
"\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\270\204\303" \
"a\2a\216G\14\22\11\270\0\0\0\4\21\21\21\260\260\260\377\377\377\254\254" \
"\254\252\0\0\0\1qqq\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371" \
"\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360" \
"\360\360\227\377\377\377\2\342\342\342%%%\337\0\0\0\1%%%\231\377\377" \
"\377\1\322\322\322\240\0\0\0\1<Y,\267\204\303a\2a\216G\14\21\11\270\0" \
"\0\0\2\16\16\16\257\257\257\202\377\377\377\1\254\254\254\252\0\0\0\1" \
"ggg\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377" \
"\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377" \
"\377\377\2\320\320\320\21\21\21\337\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\240\0\0\0\1<Y,\266\204\303a\2_\214E\14\21\11\270\0\0\0\2\16" \
"\16\16\257\257\257\203\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377" \
"\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276" \
"\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y," \
"\265\204\303a\2b\221H\14\21\11\270\0\0\0\2\16\16\16\257\257\257\204\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%" \
"\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\264\204\303a\2a\216G\14" \
"\22\11\270\0\0\0\2\21\21\21\262\262\262\205\377\377\377\1\254\254\254" \
"\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360" \
"\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\240\0\0\0\1<Y,\263\204\303a\2a\216G\14\21\11\270\0\0\0\2\16" \
"\16\16\260\260\260\206\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377" \
"\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276" \
"\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y," \
"\262\204\303a\2_\215F\14\21\11\270\0\0\0\2\21\21\21\257\257\257\207\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%" \
"\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\261\204\303a\2b\220G\14" \
"\22\11\270\0\0\0\2\16\16\16\260\260\260\210\377\377\377\1\254\254\254" \
"\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360" \
"\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\240\0\0\0\1<Y,\260\204\303a\2_\215F\14\22\11\270\0\0\0\2\21" \
"\21\21\262\262\262\211\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377" \
"\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276" \
"\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y," \
"\257\204\303a\2`\215F\13\21\10\270\0\0\0\2\16\16\16\257\257\257\212\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%" \
"\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\256\204\303a\2e\226K\14" \
"\22\11\270\0\0\0\2\16\16\16\257\257\257\213\377\377\377\1\254\254\254" \
"\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360" \
"\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\240\0\0\0\1<Y,\255\204\303a\2m\243P\22\33\15\270\0\0\0\2\6\6" \
"\6\237\237\237\214\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377" \
"\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276" \
"\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\254" \
"\204\303a\2l\240O\24\36\17\270\0\0\0\2\5\5\5\227\227\227\215\377\377" \
"\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0" \
"\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2" \
"\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231" \
"\377\377\377\1\322\322\322\240\0\0\0\1<Y,\252\204\303a\3\204\302an\241" \
"P\22\33\16\270\0\0\0\2\5\5\5\232\232\232\216\377\377\377\1\254\254\254" \
"\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360" \
"\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\240\0\0\0\1<Y,\252\204\303a\2k\236O\25\37\20\270\0\0\0\2\5\5" \
"\5\230\230\230\217\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377" \
"\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276" \
"\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\250" \
"\204\303a\3\204\302an\242Q\22\33\16\270\0\0\0\2\6\6\6\232\232\232\220" \
"\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214" \
"\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0" \
"\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1" \
"%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\250\204\303a\2k\236" \
"O\24\36\17\270\0\0\0\2\5\5\5\227\227\227\221\377\377\377\1\254\254\254" \
"\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360" \
"\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\240\0\0\0\1<Y,\246\204\303a\3\204\302an\241P\22\33\15\270\0" \
"\0\0\2\6\6\6\232\232\232\222\377\377\377\1\254\254\254\252\0\0\0\1ii" \
"i\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377" \
"\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377" \
"\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\246\204\303a\2l\237O\24\36\17\270\0\0\0\2\6\6\6\232\232\232" \
"\223\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214" \
"\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232" \
"\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0" \
"\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\244\204\303a\3\204" \
"\302an\242Q\23\34\16\270\0\0\0\2\6\6\6\232\232\232\224\377\377\377\1" \
"\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2" \
"HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30" \
"\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\243\204\303a\3\204\302al\237O\24" \
"\36\17\270\0\0\0\2\6\6\6\227\227\227\225\377\377\377\1\254\254\254\252" \
"\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371" \
"\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360" \
"\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322" \
"\322\240\0\0\0\1<Y,\242\204\303a\3\204\302an\241P\22\33\15\270\0\0\0" \
"\2\6\6\6\232\232\232\226\377\377\377\1\254\254\254\252\0\0\0\1iii\231" \
"\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377" \
"\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377" \
"\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0" \
"\1<Y,\242\204\303a\2k\236O\24\36\17\270\0\0\0\2\6\6\6\230\230\230\227" \
"\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214" \
"\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0" \
"\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1" \
"%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\240\204\303a\3\204\302" \
"an\242O\23\34\16\271\0\0\0\1\227\227\227\230\377\377\377\1\254\254\254" \
"\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360" \
"\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\240\0\0\0\1<Y,\240\204\303a\2k\236O\23\34\16\272\0\0\0\1\371" \
"\371\371\230\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377" \
"\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276" \
"\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\236\204" \
"\303a\3\204\302an\242O\22\33\15\273\0\0\0\1\363\363\363\230\377\377\377" \
"\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0" \
"\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30" \
"\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\236\204\303a\2l\240P\24\36\17\274" \
"\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0\0\1iii\231" \
"\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377" \
"\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377" \
"\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0" \
"\1<Y,\234\204\303a\3\204\302al\240P\22\33\16\275\0\0\0\1\363\363\363" \
"\230\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214" \
"\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232" \
"\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0" \
"\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\234\204\303a\2l\240" \
"P\24\36\17\276\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252" \
"\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371" \
"\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360" \
"\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322" \
"\322\240\0\0\0\1<Y,\232\204\303a\3\204\302an\242O\23\34\16\277\0\0\0" \
"\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377" \
"\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276" \
"\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\232" \
"\204\303a\2l\237O\24\36\17\300\0\0\0\1\363\363\363\230\377\377\377\1" \
"\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2" \
"HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30" \
"\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\230\204\303a\3\204\302al\240P\22" \
"\33\15\301\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\340\0\0\0\1%%%\231\377\377\377\1\322\322\322" \
"\240\0\0\0\1<Y,\230\204\303a\2l\237P\24\36\17\302\0\0\0\1\363\363\363" \
"\230\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214" \
"\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232" \
"\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\340\0\0\0" \
"\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\226\204\303a\3\204" \
"\302an\241P\23\34\16\303\0\0\0\1\363\363\363\230\377\377\377\1\254\254" \
"\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371" \
"\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360" \
"\360\360\227\377\377\377\1\276\276\276\254\0\0\0\1\1\1\1\226\12\12\12" \
"\2\15\15\15\6\6\6\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\226\204\303a\2l\237O\24\36\17\304\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\3\22" \
"\22\22\266\266\266\276\276\276\224\275\275\275\2\302\302\302}}}\233\0" \
"\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\1<Y,\224\204\303a\3" \
"\204\302an\241P\22\33\15\305\0\0\0\1\363\363\363\230\377\377\377\1\254" \
"\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH" \
"\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30" \
"\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\1\32\32\32\227\377" \
"\377\377\1\257\257\257\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240" \
"\0\0\0\1<Y,\224\204\303a\2l\237O\24\36\17\306\0\0\0\1\363\363\363\230" \
"\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214" \
"\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0" \
"\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2" \
"\30\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231" \
"\377\377\377\1\322\322\322\240\0\0\0\1<Y,\223\204\303a\2n\241P\22\33" \
"\15\307\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0\0\1" \
"iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377" \
"\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377" \
"\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377\377" \
"\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0" \
"\1<Y,\222\204\303a\2l\240O\24\36\17\310\0\0\0\1\363\363\363\230\377\377" \
"\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0" \
"\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2" \
"\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30\30" \
"\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\220\204\303a\3\204\302an\241P\22" \
"\33\16\311\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\220\204\303a\2k\236O\24\36\17\312\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\216\204\303a\3\204\302an\241P\22" \
"\33\16\313\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\216\204\303a\2l\237O\24\36\17\314\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\214\204\303a\3\204\302an\241P\21" \
"\32\15\315\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\214\204\303a\2l\237O\24\36\17\316\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\212\204\303a\3\204\302an\242Q\23" \
"\34\16\317\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\212\204\303a\2k\236O\24\36\17\320\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\210\204\303a\3\204\302an\241P\23" \
"\34\16\321\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\210\204\303a\2l\240O\24\36\17\322\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\206\204\303a\3\204\302an\241P\23" \
"\34\16\323\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\206\204\303a\2k\236O\23\34\16\324\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\204\204\303a\3\204\302an\241P\23" \
"\34\16\325\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\204\204\303a\2l\240P\24\36\17\326\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\1<Y,\202\204\303a\3\204\302al\240O\22" \
"\33\16\327\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\1<Y,\202\204\303a\2l\240P\23\34\16\330\0\0\0\1\363\363\363\230\377" \
"\377\377\1\254\254\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0" \
"\2\30\30\30\360\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30" \
"\30\30\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\240\0\0\0\4<Y,\204\302an\241P\23\34\16\331\0\0" \
"\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0\0\1iii\231\377" \
"\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\276" \
"\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246\246\246" \
"\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0\0\0\3Cc1r\250S\24" \
"\36\17\332\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0" \
"\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227" \
"\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\240\0" \
"\0\0\2&9\34\31%\22\333\0\0\0\1\363\363\363\230\377\377\377\1\254\254" \
"\254\252\0\0\0\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371" \
"\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360" \
"\360\360\227\377\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367" \
"\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322" \
"\322\375\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0\0" \
"\1iii\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377" \
"\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377" \
"\377\377\1\276\276\276\254\0\0\0\2\30\30\30\367\367\367\226\377\377\377" \
"\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0" \
"\1\363\363\363\230\377\377\377\1\254\254\254\252\0\0\0\1lll\231\377\377" \
"\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\1\275\275" \
"\275\254\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246\246\246\233" \
"\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363\363\363\230" \
"\377\377\377\1\254\254\254\252\0\0\0\1\204\204\204\231\377\377\377\1" \
"\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\2\300\300\300" \
"\3\3\3\253\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246\246\246" \
"\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363\363\363" \
"\230\377\377\377\1\254\254\254\251\0\0\0\2\1\1\1\241\241\241\231\377" \
"\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377\377\377\2\322" \
"\322\322\25\25\25\253\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1" \
"\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1" \
"\363\363\363\230\377\377\377\1\254\254\254\251\0\0\0\2\11\11\11\311\311" \
"\311\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377" \
"\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\227\377" \
"\377\377\2\360\360\360111\253\0\0\0\2\30\30\30\367\367\367\226\377\377" \
"\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0" \
"\0\0\1\363\363\363\230\377\377\377\1\254\254\254\251\0\0\0\2%%%\360\360" \
"\360\231\377\377\377\1\214\214\214\233\0\0\0\2HHH\371\371\371\230\377" \
"\377\377\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\230\377" \
"\377\377\1eee\253\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246" \
"\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363" \
"\363\363\230\377\377\377\1\254\254\254\251\0\0\0\2aaa\376\376\376\231" \
"\377\377\377\1\201\201\201\233\0\0\0\2HHH\371\371\371\230\377\377\377" \
"\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\230\377\377\377" \
"\1\257\257\257\253\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246" \
"\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363" \
"\363\363\230\377\377\377\1\254\254\254\250\0\0\0\2\3\3\3\246\246\246" \
"\232\377\377\377\1lll\233\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\230\377\377\377\2\360" \
"\360\360///\252\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246\246" \
"\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363\363" \
"\363\230\377\377\377\1\254\254\254\250\0\0\0\2///\354\354\354\231\377" \
"\377\377\2\376\376\376\\\\\\\233\0\0\0\2HHH\371\371\371\230\377\377\377" \
"\2\260\260\260\3\3\3\232\0\0\0\2\30\30\30\360\360\360\231\377\377\377" \
"\1\230\230\230\252\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246" \
"\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363" \
"\363\363\230\377\377\377\1\254\254\254\250\0\0\0\1\220\220\220\232\377" \
"\377\377\2\365\365\365<<<\233\0\0\0\2HHH\371\371\371\230\377\377\377" \
"\2\260\260\260\3\3\3\232\0\0\0\2\22\22\22\341\341\341\231\377\377\377" \
"\2\354\354\354111\251\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1" \
"\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1" \
"\363\363\363\230\377\377\377\1\254\254\254\247\0\0\0\2""555\360\360\360" \
"\232\377\377\377\2\347\347\347\35\35\35\233\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\12\12\12\314\314\314\232" \
"\377\377\377\2\254\254\254\5\5\5\250\0\0\0\2\30\30\30\367\367\367\226" \
"\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322" \
"\375\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\246\0\0\0\2\22" \
"\22\22\305\305\305\233\377\377\377\2\305\305\305\5\5\5\233\0\0\0\2HH" \
"H\371\371\371\230\377\377\377\2\260\260\260\3\3\3\232\0\0\0\2\3\3\3\262" \
"\262\262\233\377\377\377\1qqq\250\0\0\0\2\30\30\30\367\367\367\226\377" \
"\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375" \
"\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\245\0\0\0\2\11\11" \
"\11\250\250\250\234\377\377\377\1\220\220\220\234\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\233\0\0\0\1\214\214\214\233" \
"\377\377\377\2\365\365\365HHH\247\0\0\0\2\30\30\30\367\367\367\226\377" \
"\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375" \
"\0\0\0\1\363\363\363\230\377\377\377\1\254\254\254\244\0\0\0\2\30\30" \
"\30\246\246\246\235\377\377\377\1\\\\\\\234\0\0\0\2HHH\371\371\371\230" \
"\377\377\377\2\260\260\260\3\3\3\233\0\0\0\1eee\234\377\377\377\2\344" \
"\344\344AAA\246\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246\246" \
"\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363\363" \
"\363\230\377\377\377\1\254\254\254\243\0\0\0\2SSS\325\325\325\235\377" \
"\377\377\2\347\347\347'''\234\0\0\0\2HHH\371\371\371\230\377\377\377" \
"\2\260\260\260\3\3\3\233\0\0\0\2<<<\363\363\363\234\377\377\377\2\350" \
"\350\350aaa\245\0\0\0\2\30\30\30\367\367\367\226\377\377\377\1\246\246" \
"\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363\363" \
"\363\230\377\377\377\1\250\250\250\237\0\0\0\5\5\5\5%%%___\273\273\273" \
"\376\376\376\236\377\377\377\2\257\257\257\5\5\5\234\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\233\0\0\0\2\25\25\25\325\325" \
"\325\236\377\377\377\3\250\250\250\77\77\77\11\11\11\242\0\0\0\2\22\22" \
"\22\367\367\367\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\375\0\0\0\1\363\363\363\230\377\377\377\2\273" \
"\273\273555\231777\7<<<LLLOOOaaa\217\217\217\275\275\275\341\341\341" \
"\241\377\377\377\1\\\\\\\235\0\0\0\2HHH\371\371\371\230\377\377\377\2" \
"\260\260\260\3\3\3\233\0\0\0\2\1\1\1\230\230\230\237\377\377\377\5\367" \
"\367\367\273\273\273lll999\16\16\16\235\0\0\0\4\11\11\11\32\32\32""2" \
"22\371\371\371\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377" \
"\377\1\322\322\322\375\0\0\0\1\363\363\363\230\377\377\377\2\374\374" \
"\374\363\363\363\231\365\365\365\1\367\367\367\202\376\376\376\244\377" \
"\377\377\2\322\322\322\21\21\21\235\0\0\0\2HHH\371\371\371\230\377\377" \
"\377\2\260\260\260\3\3\3\234\0\0\0\2OOO\374\374\374\241\377\377\377\12" \
"\367\367\367\314\314\314\250\250\250\201\201\201OOO777'''\27\27\27\22" \
"\22\22\12\12\12\213\0\0\0\16\6\6\6\22\22\22\32\32\32'''222777LLLqqq\223" \
"\223\223\262\262\262\307\307\307\333\333\333\341\341\341\376\376\376" \
"\226\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322" \
"\322\375\0\0\0\1\363\363\363\332\377\377\377\1kkk\236\0\0\0\2HHH\371" \
"\371\371\230\377\377\377\2\260\260\260\3\3\3\234\0\0\0\2\15\15\15\320" \
"\320\320\246\377\377\377\6\367\367\367\347\347\347\322\322\322\313\313" \
"\313\300\300\300\244\244\244\210\225\225\225\11\230\230\230\253\253\253" \
"\271\271\271\313\313\313\327\327\327\344\344\344\363\363\363\371\371" \
"\371\376\376\376\235\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\375\0\0\0\1\363\363\363\331\377\377\377\2\322" \
"\322\322\21\21\21\236\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\235\0\0\0\1qqq\332\377\377\377\1\246\246\246\233\0\0\0\1%" \
"%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363\363\363\330\377\377" \
"\377\2\376\376\376___\237\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\235\0\0\0\2\32\32\32\341\341\341\331\377\377\377\1\246" \
"\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363" \
"\363\363\330\377\377\377\2\260\260\260\5\5\5\237\0\0\0\2HHH\371\371\371" \
"\230\377\377\377\2\260\260\260\3\3\3\236\0\0\0\1vvv\331\377\377\377\1" \
"\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1" \
"\363\363\363\327\377\377\377\2\344\344\344---\240\0\0\0\2HHH\371\371" \
"\371\230\377\377\377\2\260\260\260\3\3\3\236\0\0\0\2\21\21\21\320\320" \
"\320\330\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322" \
"\322\322\375\0\0\0\1\363\363\363\326\377\377\377\2\376\376\376\\\\\\" \
"\241\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\237\0" \
"\0\0\2KKK\367\367\367\327\377\377\377\1\246\246\246\233\0\0\0\1%%%\231" \
"\377\377\377\1\322\322\322\375\0\0\0\1\363\363\363\326\377\377\377\2" \
"\214\214\214\3\3\3\241\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260" \
"\260\3\3\3\237\0\0\0\2\1\1\1\220\220\220\327\377\377\377\1\246\246\246" \
"\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375\0\0\0\1\363\363\363" \
"\325\377\377\377\2\243\243\243\6\6\6\242\0\0\0\2HHH\371\371\371\230\377" \
"\377\377\2\260\260\260\3\3\3\240\0\0\0\2\15\15\15\302\302\302\326\377" \
"\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\375" \
"\0\0\0\1\363\363\363\324\377\377\377\2\262\262\262\12\12\12\243\0\0\0" \
"\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\241\0\0\0\2(((" \
"\333\333\333\325\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377\377" \
"\377\1\322\322\322\375\0\0\0\1\363\363\363\323\377\377\377\2\254\254" \
"\254\22\22\22\244\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\242\0\0\0\2<<<\354\354\354\324\377\377\377\1\246\246\246\233\0" \
"\0\0\1%%%\231\377\377\377\1\322\322\322\213\0\0\0\1\16\16\16\207\21\21" \
"\21\6\16\16\16\3\3\3\0\0\0\16\16\16\22\22\22\5\5\5\205\0\0\0\3\12\12" \
"\12\25\25\25\12\12\12\334\0\0\0\1\363\363\363\322\377\377\377\2\217\217" \
"\217\12\12\12\245\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260" \
"\3\3\3\243\0\0\0\2KKK\356\356\356\323\377\377\377\1\246\246\246\233\0" \
"\0\0\1%%%\231\377\377\377\1\322\322\322\213\0\0\0\16\265\265\265\331" \
"\331\331\327\327\327\317\317\317\313\313\313\317\317\317\327\327\327" \
"\331\331\331\300\300\300\35\35\35\6\6\6\241\241\241\317\317\317ggg\204" \
"\0\0\0\4\21\21\21\253\253\253\322\322\322qqq\334\0\0\0\1\363\363\363" \
"\320\377\377\377\2\360\360\360lll\247\0\0\0\2HHH\371\371\371\230\377" \
"\377\377\2\260\260\260\3\3\3\244\0\0\0\2KKK\354\354\354\322\377\377\377" \
"\1\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\213\0\0\0" \
"\17\266\266\266\325\325\325\320\320\320\356\356\356\377\377\377\367\367" \
"\367\322\322\322\325\325\325\300\300\300\32\32\32\15\15\15\322\322\322" \
"\377\377\377\313\313\313\15\15\15\203\0\0\0\1OOO\202\377\377\377\1\220" \
"\220\220\334\0\0\0\1\363\363\363\317\377\377\377\2\322\322\322CCC\250" \
"\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3\3\245\0\0\0" \
"\2<<<\327\327\327\321\377\377\377\1\246\246\246\233\0\0\0\1%%%\231\377" \
"\377\377\1\322\322\322\213\0\0\0\17\11\11\11\12\12\12\5\5\5\203\203\203" \
"\377\377\377\244\244\244\6\6\6\12\12\12\11\11\11\0\0\0\21\21\21\313\313" \
"\313\377\377\377\374\374\374\77\77\77\203\0\0\0\1\250\250\250\202\377" \
"\377\377\1\213\213\213\334\0\0\0\1\363\363\363\315\377\377\377\3\371" \
"\371\371\227\227\227\35\35\35\251\0\0\0\2HHH\371\371\371\230\377\377" \
"\377\2\260\260\260\3\3\3\246\0\0\0\2(((\300\300\300\320\377\377\377\1" \
"\246\246\246\233\0\0\0\1%%%\231\377\377\377\1\322\322\322\216\0\0\0\3" \
"}}}\377\377\377\237\237\237\204\0\0\0\5\21\21\21\313\313\313\344\344" \
"\344\365\365\365\235\235\235\202\0\0\0\5%%%\354\354\354\302\302\302\374" \
"\374\374\214\214\214\334\0\0\0\1\363\363\363\314\377\377\377\2\302\302" \
"\302LLL\253\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3\3" \
"\3\247\0\0\0\2\22\22\22\235\235\235\317\377\377\377\1\246\246\246\233" \
"\0\0\0\1%%%\231\377\377\377\1\322\322\322\216\0\0\0\3\177\177\177\377" \
"\377\377\241\241\241\204\0\0\0\1\21\21\21\202\317\317\317\11\257\257" \
"\257\342\342\342\27\27\27\0\0\0ttt\354\354\354\177\177\177\374\374\374" \
"\214\214\214\334\0\0\0\1\363\363\363\312\377\377\377\3\317\317\317bb" \
"b\12\12\12\254\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3" \
"\3\3\251\0\0\0\2eee\344\344\344\315\377\377\377\1\253\253\253\233\0\0" \
"\0\1%%%\231\377\377\377\1\322\322\322\216\0\0\0\3\177\177\177\377\377" \
"\377\241\241\241\204\0\0\0\14\21\21\21\322\322\322\335\335\335SSS\365" \
"\365\365___\1\1\1\305\305\305\253\253\253___\377\377\377\214\214\214" \
"\334\0\0\0\1\363\363\363\307\377\377\377\4\365\365\365\276\276\276YY" \
"Y\22\22\22\256\0\0\0\2HHH\371\371\371\230\377\377\377\2\260\260\260\3" \
"\3\3\252\0\0\0\2'''\254\254\254\314\377\377\377\1\232\232\232\233\0\0" \
"\0\1%%%\231\377\377\377\1\322\322\322\216\0\0\0\3\177\177\177\377\377" \
"\377\241\241\241\204\0\0\0\14\21\21\21\322\322\322\347\347\347\35\35" \
"\35\311\311\311\254\254\254///\367\367\367FFF\\\\\\\377\377\377\214\214" \
"\214\334\0\0\0\1\363\363\363\304\377\377\377\5\365\365\365\314\314\314" \
"\204\204\204;;;\5\5\5\260\0\0\0\2HHH\371\371\371\230\377\377\377\2\260" \
"\260\260\3\3\3\253\0\0\0\3\5\5\5___\322\322\322\306\377\377\377\5\352" \
"\352\352\313\313\313\213\213\213QQQ\37\37\37\233\0\0\0\1%%%\231\377\377" \
"\377\1\322\322\322\216\0\0\0\3\177\177\177\377\377\377\241\241\241\204" \
"\0\0\0\14\21\21\21\322\322\322\350\350\350\25\25\25bbb\360\360\360\273" \
"\273\273\327\327\327\6\6\6bbb\377\377\377\214\214\214\334\0\0\0\1\365" \
"\365\365\300\377\377\377\6\374\374\374\354\354\354\266\266\266{{{AAA" \
"\16\16\16\263\0\0\0\2HHH\373\373\373\230\377\377\377\2\262\262\262\3" \
"\3\3\255\0\0\0\4\25\25\25bbb\262\262\262\365\365\365\277\377\377\377" \
"\6\363\363\363\302\302\302\217\217\217ZZZ///\16\16\16\236\0\0\0\1'''" \
"\231\377\377\377\1\325\325\325\216\0\0\0\3\177\177\177\377\377\377\241" \
"\241\241\204\0\0\0\14\21\21\21\322\322\322\350\350\350\27\27\27\25\25" \
"\25\344\344\344\377\377\377\177\177\177\0\0\0ggg\377\377\377\214\214" \
"\214\334\0\0\0\1\365\365\365\272\377\377\377\11\371\371\371\352\352\352" \
"\322\322\322\271\271\271\237\237\237ttt<<<\25\25\25\5\5\5\266\0\0\0\2" \
"KKK\373\373\373\230\377\377\377\2\262\262\262\5\5\5\257\0\0\0\5\1\1\1" \
"%%%vvv\271\271\271\350\350\350\267\377\377\377\7\363\363\363\325\325" \
"\325\273\273\273\217\217\217\\\\\\\37\37\37\5\5\5\242\0\0\0\1'''\231" \
"\377\377\377\1\325\325\325\216\0\0\0\3\177\177\177\377\377\377\241\241" \
"\241\204\0\0\0\14\21\21\21\322\322\322\352\352\352\35\35\35\0\0\0\225" \
"\225\225\367\367\367222\0\0\0ggg\377\377\377\217\217\217\334\0\0\0\2" \
"SSSVVV\267UUU\6VVVHHH;;;---\32\32\32\3\3\3\273\0\0\0\3\30\30\30UUUVV" \
"V\226UUU\3ZZZ<<<\1\1\1\263\0\0\0\6+++ZZZ\235\235\235\314\314\314\347" \
"\347\347\374\374\374\254\377\377\377\11\367\367\367\337\337\337\305\305" \
"\305\253\253\253\204\204\204VVV555\32\32\32\3\3\3\246\0\0\0\1\15\15\15" \
"\230UUU\2YYYFFF\216\0\0\0\3\207\207\207\377\377\377\250\250\250\204\0" \
"\0\0\14\22\22\22\331\331\331\360\360\360\40\40\40\0\0\0\37\37\37EEE\6" \
"\6\6\0\0\0ooo\377\377\377\220\220\220\377\0\0\0\377\0\0\0\252\0\0\0\10" \
"\16\16\16(((HHHrrr\254\254\254\307\307\307\333\333\333\360\360\360\237" \
"\377\377\377\13\365\365\365\352\352\352\322\322\322\275\275\275\254\254" \
"\254\207\207\207ZZZQQQ;;;\40\40\40\6\6\6\325\0\0\0\3""777vvvEEE\204\0" \
"\0\0\4\6\6\6ZZZbbb\15\15\15\205\0\0\0\3---vvv<<<\377\0\0\0\377\0\0\0" \
"\256\0\0\0\15\1\1\1\11\11\11\35\35\35""999QQQiii\201\201\201\232\232" \
"\232\257\257\257\313\313\313\314\314\314\344\344\344\360\360\360\214" \
"\356\356\356\17\360\360\360\347\347\347\317\317\317\313\313\313\262\262" \
"\262\235\235\235\211\211\211qqqbbbSSSAAA222\25\25\25\5\5\5\1\1\1\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" \
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\254\0\0\0")

View File

@ -0,0 +1,8 @@
# Copyright (C) 2016 Digi International
FILESEXTRAPATHS_prepend_dey := "${THISDIR}/files:"
SRC_URI += " \
file://0001-colors-modify-psplash-colors-to-match-Digi-scheme.patch \
file://0002-bar-replace-progress-bar-with-Digi-one.patch \
"

View File

@ -0,0 +1,23 @@
# Copyright (C) 2016 Digi International.
SUMMARY = "Recovery initramfs files"
LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
SRC_URI = " \
file://recovery-initramfs-init \
file://swupdate.cfg \
"
S = "${WORKDIR}"
do_install() {
install -d ${D}${sysconfdir}
install -m 0755 ${WORKDIR}/recovery-initramfs-init ${D}/init
install -m 0644 ${WORKDIR}/swupdate.cfg ${D}${sysconfdir}
}
# Do not create debug/devel packages
PACKAGES = "${PN}"
FILES_${PN} = "/"

View File

@ -0,0 +1,462 @@
#!/bin/sh
#===============================================================================
#
# recovery-initramfs-init
#
# 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: Init script for recovery initramfs
#
#===============================================================================
# Variables.
#------------------------------------------------------------------------------
ENV_BOOT_RECOVERY="boot_recovery"
ENV_RECOVERY_COMMAND="recovery_command"
SW_CONFIG="/etc/swupdate.cfg"
USB_MOUNT_DIR="/run/media"
UPDATE_MOUNT_DIR="/mnt/update"
REBOOT_TIME=10
# Functions.
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Function - log
#
# Prints the given text in the console.
#
# @param ${1} - Text to print.
#------------------------------------------------------------------------------
log() {
echo "[RECOVERY] ${1}"
}
#------------------------------------------------------------------------------
# Function - log_warning
#
# Prints the given text in the console as a warning.
#
# @param ${1} - Warning text to print.
#------------------------------------------------------------------------------
log_warning() {
log "[WARNING] ${1}"
}
#------------------------------------------------------------------------------
# Function - log_error
#
# Prints the given text in the console as an error.
#
# @param ${1} - Error text to print.
#------------------------------------------------------------------------------
log_error() {
log "[ERROR] ${1}"
psplash_message "ERROR: ${1}"
psplash_progress "0"
}
#------------------------------------------------------------------------------
# Function - clear_uboot_vars
#
# Clears recovery U-Boot variables.
#------------------------------------------------------------------------------
clear_uboot_vars() {
fw_setenv "${ENV_BOOT_RECOVERY}"
fw_setenv "${ENV_RECOVERY_COMMAND}"
}
#------------------------------------------------------------------------------
# Function - read_uboot_var
#
# Reads the given U-Boot variable.
#
# @param ${1} - U-Boot variable to read.
# @param ${2} - Where to store the value of the read variable.
#------------------------------------------------------------------------------
read_uboot_var() {
eval "${2}=\"$(fw_printenv -n ${1} 2>/dev/null)\""
}
#------------------------------------------------------------------------------
# Function - psplash_message
#
# Shows the given message in the psplash screen.
#
# @param ${1} - Message to show.
#------------------------------------------------------------------------------
psplash_message() {
echo "MSG ${1}" > /tmp/psplash_fifo
sleep 0.2
}
#------------------------------------------------------------------------------
# Function - psplash_progress
#
# Sets the psplash progress bar percentage to the given one.
#
# @param ${1} - Progress percentage.
#------------------------------------------------------------------------------
psplash_progress() {
echo "PROGRESS ${1}" > /tmp/psplash_fifo
sleep 0.2
}
#------------------------------------------------------------------------------
# Function - reboot_system
#
# Reboots the system.
#------------------------------------------------------------------------------
reboot_system() {
sync && reboot -f
}
#------------------------------------------------------------------------------
# Function - quit_with_error
#
# Ends the recovery process with the given error message.
#
# @param ${1} - Error message.
#------------------------------------------------------------------------------
quit_with_error() {
clear_uboot_vars
log_error "${1}"
log "The system will now reboot in ${REBOOT_TIME} seconds"
sleep "${REBOOT_TIME}"
reboot_system
}
#------------------------------------------------------------------------------
# Function - is_nand
#
# Verifies if the system is running in a NAND flash.
#
# @return - "yes" if the system is running in NAND, "no" otherwise
#------------------------------------------------------------------------------
is_nand() {
if [ -f /proc/mtd ] && grep -qs mtd /proc/mtd; then
echo "yes"
else
echo "no"
fi
}
#------------------------------------------------------------------------------
# Function - mount_external_disks
#
# Mounts all available external disks.
#------------------------------------------------------------------------------
mount_external_disks() {
local devices=$(ls -1 /dev/sd? 2>/dev/null)
for device in ${devices}; do
for i in ${device}?; do
local dev_name=$(basename "${i}")
local mount_dir="${USB_MOUNT_DIR}/${dev_name}"
mkdir -p "${mount_dir}"
FSTYPE="$(blkid /dev/${dev_name} | sed -e 's,.*TYPE="\([^"]\+\)".*,\1,g')"
mount -r ${FSTYPE:+-t ${FSTYPE}} "/dev/${dev_name}" "${mount_dir}"
done
done
}
#------------------------------------------------------------------------------
# Function - mount_partition
#
# Mounts the given partition.
#
# @param ${1} - Partition name to mount.
# @param ${2} - Mount point.
#------------------------------------------------------------------------------
mount_partition() {
if [ "$(is_nand)" = "yes" ]; then
mount_ubi_volume "${1}" "${2}"
else
mount_emmc_block "${1}" "${2}"
fi
}
#------------------------------------------------------------------------------
# Function - mount_ubi_volume
#
# Mounts the given UBI volume.
#
# @param ${1} - UBI Volume name to mount.
# @param ${2} - Mount point.
#------------------------------------------------------------------------------
mount_ubi_volume() {
# Find the MTD partition.
local mtd_num="$(sed -ne "s/mtd\([0-9]\+\):.*\<${1}\>.*/\1/g;T;p" /proc/mtd 2>/dev/null)"
if [ -z "${mtd_num}" ]; then
log_warning "Could not find MTD partition for volume '${1}'"
else
# Attach and get UBI device number
local dev_number="$(ubiattach -p /dev/mtd${mtd_num} 2>/dev/null | sed -ne 's,.*device number \([0-9]\).*,\1,g;T;p' 2>/dev/null)"
# Check if volume exists.
ubinfo "/dev/ubi${dev_number}" -N "${1}" >/dev/null 2>&1
if [ "$?" = "0" ]; then
# Mount the volume.
mkdir -p "${2}"
mount -t ubifs "ubi${dev_number}:${1}" "${2}" >/dev/null 2>&1
if [ "$?" != "0" ]; then
log_warning "Could not mount '${1}' partition"
fi
else
log_warning "Could not mount '${1}' partition, volume not found"
fi
fi
}
#------------------------------------------------------------------------------
# Function - mount_emmc_block
#
# Mounts the given emmc partition block name.
#
# @param ${1} - Partition name to mount.
# @param ${2} - Mount point.
#------------------------------------------------------------------------------
mount_emmc_block() {
# Find partition block number.
local partition_block="/dev/mmcblk0p$(parted -s /dev/mmcblk0 print | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<${1}\>.*,\1,g;T;p")"
# Mount the volume.
mkdir -p "${2}"
FSTYPE="$(blkid ${partition_block} | sed -e 's,.*TYPE="\([^"]\+\)".*,\1,g')"
mount -r ${FSTYPE:+-t ${FSTYPE}} "${partition_block}" "${2}"
if [ "$?" != "0" ]; then
log_warning "Could not mount '${1}' partition (${partition_block})"
fi
}
#------------------------------------------------------------------------------
# Function - format_partition
#
# Formats the given partition.
#
# @param ${1} - Partition name to format.
#------------------------------------------------------------------------------
format_partition() {
if [ "$(is_nand)" = "yes" ]; then
format_ubi_volume "${1}"
else
format_emmc_block "${1}"
fi
}
#------------------------------------------------------------------------------
# Function - format_ubi_volume
#
# Formats and re-creates the given UBI volume.
#
# @param ${1} - UBI Volume name to format.
#------------------------------------------------------------------------------
format_ubi_volume() {
# Find the MTD partition.
local mtd_num="$(sed -ne "s/mtd\([0-9]\+\):.*\<${1}\>.*/\1/g;T;p" /proc/mtd 2>/dev/null)"
if [ -z "${mtd_num}" ]; then
quit_with_error "Could not find MTD partition for volume '${1}'"
else
# Umount in case partition is mounted, ignore errors.
if grep -qs "${1}" /proc/mounts; then
local path="$(sed -ne "s/.*:${1} \(.*\) ubifs.*/\1/g;T;p" /proc/mounts 2>/dev/null)"
umount "${path}" >/dev/null 2>&1
ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1
fi
# Format MTD partition.
if ! ubiformat "/dev/mtd${mtd_num}" -q -y; then
quit_with_error "Error erasing '/dev/mtd${mtd_num}' block"
fi
psplash_progress "50"
# Attach and get UBI device number
local dev_number="$(ubiattach -p /dev/mtd${mtd_num} 2>/dev/null | sed -ne 's,.*device number \([0-9]\).*,\1,g;T;p' 2>/dev/null)"
# Create UBI Vol.
ubimkvol "/dev/ubi${dev_number}" -m -N "${1}" >/dev/null 2>&1
if [ "$?" = "0" ]; then
# Configure the empty UBIFS partition to use ZLIB
volid="$(ubinfo "/dev/ubi${dev_number}" -N "${1}" | sed -ne 's,Volume ID:[[:blank:]]\+\([0-9]\+\)[[:blank:]]\+.*,\1,g;T;p')"
mkfs.ubifs -x zlib -F /dev/ubi${dev_number}_${volid}
psplash_progress "100"
log "Partition '${1}' successfully erased!"
# Detach MTD partition.
ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1
else
quit_with_error "Error creating '${1}' UBI volume"
fi
fi
}
#------------------------------------------------------------------------------
# Function - format_emmc_block
#
# Formats the given emmc partition block name.
#
# @param ${1} - Partition name to format.
#------------------------------------------------------------------------------
format_emmc_block() {
# Find partition block number.
local partition_block="/dev/mmcblk0p$(parted -s /dev/mmcblk0 print | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<${1}\>.*,\1,g;T;p")"
if [ -b "${partition_block}" ]; then
# Umount in case partition is mounted, ignore errors.
if grep -qs "${partition_block}" /proc/mounts; then
umount "${partition_block}" >/dev/null 2>&1
fi
# Format emmc block.
mkfs.ext4 "${partition_block}" >/dev/null 2>&1
if [ "$?" = "0" ]; then
psplash_progress "100"
log "Partition '${1}' successfully erased!"
else
quit_with_error "Error erasing '${1}' partition"
fi
else
quit_with_error "Could not find partition block for '${1}'"
fi
}
#------------------------------------------------------------------------------
# Function - swu_package_path
#
# Get absolute path of update package searching in local media
#
# @param ${1} - SWU package name
#------------------------------------------------------------------------------
swu_package_path() {
for i in ${UPDATE_MOUNT_DIR} $(echo ${USB_MOUNT_DIR}/*); do
echo $i | grep -qs "${USB_MOUNT_DIR}/\*" && continue
if [ -f "${i}/${1}" ]; then
swu_abspath="${i}/${1}"
break
fi
done
if [ -n "${swu_abspath}" ]; then
echo "${swu_abspath}"
else
quit_with_error "Unable to find update package '${1}'"
fi
}
# Main
#------------------------------------------------------------------------------
# Setup the environment.
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
# Mount virtual file system.
mkdir -p /proc /sys /dev /tmp
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
mount -t tmpfs tmpfs /tmp
# Setup fw_printenv.
mkdir -p /var/lock
# Set kernel console loglevel.
sysctl -q -w kernel.printk=4
# Start psplash.
psplash &
# Parse the kernel command line.
for arg in $(cat /proc/cmdline); do
case "${arg}" in
rescue=1) eval "${arg}";;
esac
done
# Jump to a rescue shell if requested.
if [ -n "${rescue}" ]; then
# Expand console and respawn if exited
while true; do
setsid cttyhack sh -l
sleep 1
done
fi
log "Starting recovery..."
psplash_message "Starting recovery..."
# Read the recovery command.
read_uboot_var "${ENV_RECOVERY_COMMAND}" COMMAND
# Check if there is any command.
if [ -z "${COMMAND}" ]; then
quit_with_error "No command found"
fi
# Parse the recovery command.
for arg in ${COMMAND}; do
case "${arg}" in
wipe_update)
wipe_update_bool=true;;
encryption_key=*)
encryption_key_bool=true;
eval "${arg}";;
update_package=*)
update_package_bool=true;
eval "${arg}";;
*)
# Not supported command
quit_with_error "Unknown recovery command '${arg}'";;
esac
done
# Check if wipe update patition command is configured.
if [ -n "${wipe_update_bool}" ]; then
log "Wipe 'update' partition requested"
psplash_message "Erasing update partition..."
format_partition update
fi
# Check if encryption key command is configured.
if [ -n "${encryption_key_bool}" ]; then
log "Trustfence encryption key setup requested (new key: ${encryption_key:-random})"
psplash_message "Configuring new encryption key..."
trustfence-tool "--newkey${encryption_key:+=${encryption_key}}"
if [ "$?" = "0" ]; then
psplash_progress "100"
log "Trustfence encryption key setup succeed!"
else
quit_with_error "Error configuring trustfence encryption key"
fi
fi
# Check if update package command is configured.
if [ -n "${update_package_bool}" ]; then
log "Firmware update requested"
psplash_message "Updating firmware..."
if [ -z "${update_package}" ]; then
quit_with_error "Firmware update package not specified"
else
# Give some time for the devices to settle down
sleep 5
mount_external_disks
mount_partition update "${UPDATE_MOUNT_DIR}"
# Check whether the package is local and get the absolute path
if echo "${update_package}" | grep -qs '^file://'; then
update_package="$(swu_package_path $(basename ${update_package}))"
fi
log "Update package location: ${update_package}"
# Execute the progress binary.
progress -wp &
# Execute the software update.
swupdate -f "${SW_CONFIG}" -i "${update_package}"
if [ "$?" = "0" ]; then
log "Firmware update process succeed!"
else
quit_with_error "Error executing the firmware update"
fi
fi
fi
# End the recovery process.
clear_uboot_vars
reboot_system

View File

@ -0,0 +1,7 @@
globals :
{
verbose = true;
loglevel = 5;
syslog = true;
mtd-blacklist = "0 1 2";
};

View File

@ -0,0 +1,17 @@
# Copyright (C) 2017 Digi International
SUMMARY = "Recovery reboot utilities"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
DEPENDS = "u-boot-fw-utils"
PV = "0.1"
SRC_URI = "file://${BPN}"
S = "${WORKDIR}/${BPN}"
do_install() {
oe_runmake DESTDIR=${D} install
}

View File

@ -0,0 +1,29 @@
#
# 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.
#
SUBDIRS := lib recovery-reboot
all: $(SUBDIRS)
recovery-reboot: lib
.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
.PHONY: clean install
clean install:
for a in $(SUBDIRS); do $(MAKE) -C $$a $@; done

View File

@ -0,0 +1,13 @@
Recovery utils
==============
**recovery-utils** allows to configure recovery commands and reboot into
recovery mode.
Provides:
* **librecovery** static library which implements the supported recovery
commands.
* **recovery-reboot** command line example application to configure and
reboot into recovery mode.
* **update-firmware** command supporting only the firmware update recovery
command.

View File

@ -0,0 +1,50 @@
/*
* 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: Recovery boot library
*
*/
#ifndef RECOVERY_H
#define RECOVERY_H
/*
* Configure recovery commands to update the firmware.
*
* Params:
* 'swu_path' (input) Path to the update package
*
* Return: 0 on sucess, -1 on failure
*/
int update_firmware(const char *swu_path);
/*
* Reboot into recovery mode.
*
* Params:
* 'reboot_timeout' (input) Timeout to perform the reboot
*
* Return: -1 on failure, otherwise it does not return
*/
int reboot_recovery(unsigned int reboot_timeout);
/*
* Configure recovery commands to format 'update' partition.
*
* Return: 0 on sucess, -1 on failure
*/
int wipe_update_partition(void);
#endif /* RECOVERY_H */

View File

@ -0,0 +1,35 @@
#
# 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.
#
LIBRECOVERY_AR = librecovery.a
CFLAGS += -Wall
all: $(LIBRECOVERY_AR)
$(LIBRECOVERY_AR): recovery.o
$(AR) -rcs $@ $^
.PHONY: install
install: $(LIBRECOVERY_AR)
install -d $(DESTDIR)/usr/lib/pkgconfig $(DESTDIR)/usr/include/librecovery
install -m 0644 $(LIBRECOVERY_AR) $(DESTDIR)/usr/lib/
install -m 0644 recovery.pc $(DESTDIR)/usr/lib/pkgconfig/
install -m 0644 ../include/recovery.h $(DESTDIR)/usr/include/librecovery/
.PHONY: clean
clean:
-rm -f *.o $(LIBRECOVERY_AR)

View File

@ -0,0 +1,155 @@
/*
* 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: Recovery boot library
*
*/
#define _GNU_SOURCE /* For GNU version of basename */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/reboot.h>
#include <unistd.h>
#include <libubootenv/ubootenv.h>
#define FILE_PREFIX "file://"
/*
* Function: append_recovery_command
* Description: append configuration to the 'recovery_command' variable
*/
static int append_recovery_command(const char *value)
{
const char *old_recovery_cmd;
char *new_recovery_cmd;
int rcvr_cmd_len;
int ret = 0;
ret = uboot_getenv("recovery_command", &old_recovery_cmd);
if (ret) {
fprintf(stderr, "Error: getenv 'recovery_command'\n");
goto err;
}
/* Length of old recovery command (+1 for the space) */
rcvr_cmd_len = (old_recovery_cmd) ? (strlen(old_recovery_cmd) + 1) : 0;
/* Add new value's length + '\0' */
rcvr_cmd_len += strlen(value) + 1;
new_recovery_cmd = calloc(1, rcvr_cmd_len);
if (!new_recovery_cmd) {
fprintf(stderr, "Error: calloc 'new_recovery_cmd'\n");
goto err;
}
/* Set new recovery command appending to previous value */
if (old_recovery_cmd) {
strcpy(new_recovery_cmd, old_recovery_cmd);
strcat(new_recovery_cmd, " ");
}
strcat(new_recovery_cmd, value);
ret = uboot_setenv("recovery_command", new_recovery_cmd);
if (ret)
fprintf(stderr, "Error: setenv 'recovery_command'\n");
free(new_recovery_cmd);
err:
return ret ? -1 : 0;
}
/*
* Function: update_firmware
* Description: configure recovery commands to update the firmware
*/
int update_firmware(const char *swu_path)
{
char *fwupdate_cmd;
int file_prefix_len = 0;
int ret = -1;
/* Verify input parameter */
if (!swu_path) {
fprintf(stderr, "Error: NULL 'swu_path'\n");
goto err;
}
/* If file is local reset the path */
if (!access(swu_path, F_OK)) {
file_prefix_len = strlen(FILE_PREFIX);
swu_path = basename(swu_path);
}
fwupdate_cmd =
calloc(1,
strlen("update_package=") + file_prefix_len +
strlen(swu_path) + 1);
if (!fwupdate_cmd) {
fprintf(stderr, "Error: calloc 'fwupdate_cmd'\n");
goto err;
}
sprintf(fwupdate_cmd, "update_package=%s%s",
file_prefix_len ? FILE_PREFIX : "", swu_path);
ret = append_recovery_command(fwupdate_cmd);
free(fwupdate_cmd);
err:
return ret ? -1 : 0;
}
/*
* Function: reboot_recovery
* Description: reboot into recovery mode
*/
int reboot_recovery(unsigned int reboot_timeout)
{
int ret = 0;
sync();
/* Configure system to boot into recovery mode */
ret = uboot_setenv("boot_recovery", "yes");
if (ret) {
fprintf(stderr, "Error: setenv 'boot_recovery'\n");
goto err;
}
printf("\nThe recovery commands have been properly configured and "
"the system will reboot into recovery mode in %d seconds "
"(^C to cancel).\n\n", reboot_timeout);
fflush(stdout);
sleep(reboot_timeout);
reboot(RB_AUTOBOOT);
err:
return ret;
}
/*
* Function: wipe_update_partition
* Description: configure recovery commands to format 'update' partition
*/
int wipe_update_partition(void)
{
return append_recovery_command("wipe_update");
}

View File

@ -0,0 +1,13 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: recovery
Description: recovery functionality library
Version:1.0
Requires:
Libs: -L${libdir} -lrecovery
Libs.private: -lubootenv
Cflags: -I${includedir}/librecovery -I${includedir}

View File

@ -0,0 +1,47 @@
#
# 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.
#
PROGRAM := recovery-reboot
GIT_REVISION := $(shell git rev-parse --verify --short=7 HEAD 2>/dev/null)
CFLAGS += -Wall -DGIT_REVISION=\"$(if $(GIT_REVISION),-g$(GIT_REVISION))\"
#
# In general, when a library is installed in the toolchain the correct way to
# set the flags would be:
#
# CFLAGS += $(shell pkg-config --cflags recovery)
# LDLIBS += $(shell pkg-config --libs --static recovery)
#
# But in this case as we want to use the library not installed and from the
# local build directory, we adjust manually the flags.
#
CFLAGS += -I../include
LDFLAGS += -L../lib
LDLIBS += -lrecovery -lubootenv
all: $(PROGRAM)
.PHONY: install
install: $(PROGRAM)
install -d $(DESTDIR)/usr/bin
install -m 0755 $(PROGRAM) $(DESTDIR)/usr/bin/
ln -sf $(PROGRAM) $(DESTDIR)/usr/bin/update-firmware
.PHONY: clean
clean:
-rm -f *.o $(PROGRAM)

View File

@ -0,0 +1,198 @@
/*
* 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: Reboot into recovery mode setting recovery commands
*
*/
#define _GNU_SOURCE /* For GNU version of basename */
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <recovery.h>
#define VERSION "0.1" GIT_REVISION
#define REBOOT_TIMEOUT 10
#define CMD_RECOVERY "recovery-reboot"
#define CMD_UPDATEFW "update-firmware"
#define RECOVERY_USAGE \
"Reboot into recovery mode setting recovery commands.\n" \
"Copyright(c) Digi International Inc.\n" \
"\n" \
"Version: %s\n" \
"\n" \
"Usage: %s [options] [<SWU-package-path>]\n\n" \
" -u --update-firmware Perform firmware update\n" \
" -w --wipe-update-partition Wipe 'update' partition\n" \
" -T --reboot-timeout=<N> Reboot after N seconds (default %d)\n" \
" --help Print help and exit\n" \
"\n" \
"<SWU-package-path> Absolute path to the firmware update package\n" \
"\n"
#define UPDATEFW_USAGE \
"Update the firmware using the recovery reboot.\n" \
"Copyright(c) Digi International Inc.\n" \
"\n" \
"Version: %s\n" \
"\n" \
"Usage: %s [options] <SWU-package-path>\n\n" \
" -T --reboot-timeout=<N> Reboot after N seconds (default %d)\n" \
" --help Print help and exit\n" \
"\n" \
"<SWU-package-path> Absolute path to the firmware update package\n" \
"\n"
/* Check if application was called as update-firmware */
#define IS_UPDATEFW(cmd) (!strcmp(cmd, CMD_UPDATEFW))
/* Actual command name */
static char *cmd_name;
/* Command line options */
static char *swu_package;
static int wipe_update;
static int update_fw;
static int reboot_timeout = REBOOT_TIMEOUT;
/*
* Function: usage_and_exit
* Description: show usage information and exit with 'exitval' return value
*/
static void usage_and_exit(int exitval)
{
if (IS_UPDATEFW(cmd_name))
fprintf(stdout, UPDATEFW_USAGE, VERSION, CMD_UPDATEFW,
REBOOT_TIMEOUT);
else
fprintf(stdout, RECOVERY_USAGE, VERSION, CMD_RECOVERY,
REBOOT_TIMEOUT);
exit(exitval);
}
/*
* Function: parse_options
* Description: parse command line options
*/
static void parse_options(int argc, char *argv[])
{
static int opt_index, opt;
static const char *short_options = "uwT:";
static const struct option long_options[] = {
{"update-firmware", no_argument, NULL, 'u'},
{"wipe-update-partition", no_argument, NULL, 'w'},
{"reboot-timeout", required_argument, NULL, 'T'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
};
char *endptr;
if (argc == 1)
usage_and_exit(EXIT_SUCCESS);
while (1) {
opt =
getopt_long(argc, argv, short_options, long_options,
&opt_index);
if (opt == -1)
break;
switch (opt) {
case 'u':
update_fw = 1;
break;
case 'w':
wipe_update = 1;
break;
case 'T':
reboot_timeout = (int)strtol(optarg, &endptr, 10);
if (*endptr) {
printf("Error: incorrect timeout argument\n");
exit(EXIT_FAILURE);
}
break;
case 'h':
usage_and_exit(EXIT_SUCCESS);
break;
default:
usage_and_exit(EXIT_FAILURE);
break;
}
}
/* If command is 'update-firmware' reset the options */
if (IS_UPDATEFW(cmd_name)) {
update_fw = 1;
wipe_update = 0;
}
if (update_fw) {
if (argc == (optind + 1)) {
swu_package = argv[optind];
} else {
printf("Error: missing SWU package argument\n");
exit(EXIT_FAILURE);
}
}
}
int main(int argc, char *argv[])
{
int ret = 0;
cmd_name = basename(argv[0]);
if (!cmd_name) {
printf("Error: basename command\n");
goto out;
}
/* Read and parse command line */
parse_options(argc, argv);
if (swu_package) {
/* Configure recovery commands to update the firmware */
ret = update_firmware(swu_package);
if (ret) {
printf("Error: update_firmware\n");
goto out;
}
}
if (wipe_update) {
/* Configure recovery commands to format 'update' partition */
ret = wipe_update_partition();
if (ret) {
printf("Error: wipe_update_partition\n");
goto out;
}
}
/* Reboot to recovery */
ret = reboot_recovery(reboot_timeout);
if (ret) {
printf("Error: reboot_recovery\n");
goto out;
}
out:
return ret;
}

View File

@ -4,19 +4,9 @@ SUMMARY = "Trustfence command line tool"
SECTION = "console/tools"
LICENSE = "CLOSED"
SRC_URI = "file://trustfence-tool"
SRC_URI = "${DIGI_PKG_SRC}/${BP}.tar.gz"
S = "${WORKDIR}"
SRC_URI[md5sum] = "dfbe0f7a5c2d16c5abafae14eb33d592"
SRC_URI[sha256sum] = "e335fc7080fb35ad198319c06ec31c77d9d2fe63219b9adc1ffc1e686e1534ae"
INSANE_SKIP_${PN} = "already-stripped"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install() {
install -d ${D}${base_sbindir}
install -m 0755 trustfence-tool ${D}${base_sbindir}
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "(ccimx6|ccimx6ul)"
inherit bin_package

View File

@ -0,0 +1,29 @@
# Copyright (C) 2017, Digi International Inc.
SUMMARY = "Digi's device cloud connector"
SECTION = "libs"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
DEPENDS = "confuse openssl recovery-utils zlib"
SRC_URI = "${DIGI_PKG_SRC}/${BP}.tar.gz"
SRC_URI[md5sum] = "db366b0358c1b47f6380080ce75d91e4"
SRC_URI[sha256sum] = "5ecd4b1830fea7746e005465b6eef30f118302147861eb4074cf717fffbdf9d5"
S = "${WORKDIR}/${PN}-${PV}"
inherit pkgconfig
do_install() {
oe_runmake DESTDIR=${D} install
}
PACKAGES =+ "${PN}-cert"
FILES_${PN}-cert = "${sysconfdir}/ssl/certs/Digi_Int-ca-cert-public.crt"
CONFFILES_${PN} += "${sysconfdir}/cc.conf"
RDEPENDS_${PN} = "${PN}-cert"

View File

@ -0,0 +1,31 @@
# Copyright (C) 2017, Digi International Inc.
SUMMARY = "Digi's device cloud connector"
SECTION = "libs"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
DEPENDS = "confuse openssl recovery-utils zlib"
SRCBRANCH = "master"
SRCREV = "${AUTOREV}"
SRC_URI = "gitsm://git@stash.digi.com/cc/cc_dey.git;protocol=ssh;branch=${SRCBRANCH}"
S = "${WORKDIR}/git"
inherit pkgconfig
do_install() {
oe_runmake DESTDIR=${D} install
}
PACKAGES =+ "${PN}-cert"
FILES_${PN}-cert = "${sysconfdir}/ssl/certs/Digi_Int-ca-cert-public.crt"
CONFFILES_${PN} += "${sysconfdir}/cc.conf"
RDEPENDS_${PN} = "${PN}-cert"
DEFAULT_PREFERENCE = "-1"

View File

@ -0,0 +1,16 @@
SUMMARY = "DEY examples: ADC test application"
SECTION = "examples"
LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
SRC_URI = "file://adc_sample"
S = "${WORKDIR}/adc_sample"
do_install() {
install -d ${D}${bindir}
install -m 0755 adc_sample ${D}${bindir}
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "(ccimx6ul)"

View File

@ -0,0 +1,20 @@
SUMMARY = "DEY examples: Device cloud test applications"
SECTION = "examples"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
DEPENDS = "cloudconnector"
SRC_URI = "file://cloudconnector_test"
S = "${WORKDIR}/cloudconnector_test"
inherit pkgconfig
do_install() {
oe_runmake DESTDIR=${D} install
}
RDEPENDS_${PN} = "cloudconnector-cert"
COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul)"

View File

@ -0,0 +1,11 @@
CFLAGS = -Wall -g -D_GNU_SOURCE
all: adc_sample
adc_sample: adc_sample.o iio_utils.o
%.o: %.c iio_utils.h
.PHONY: clean
clean:
rm -f *.o adc_sample

View File

@ -0,0 +1,337 @@
/*
* ConnectCore 6UL ADC sample application.
*
* Copyright (c) 2016 Digi International Inc.
* All rights reserved.
*
* Partially 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 <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <poll.h>
#include <sys/ioctl.h>
#include "iio_utils.h"
#define ARRAY_SIZE(v) (sizeof(v) / sizeof((v)[0]))
#define BUFFER_LEN 20
#define ADC_SAMPLE_USAGE \
"Usage:\n" \
"adc_sample -t ADC_type -c channel [options]\n\n"
#define ADC_SAMPLE_FULL_USAGE \
"Usage:\n" \
"adc_sample -t ADC_type -c channel [options]\n\n" \
"Options:\n" \
" -t : ADC_type ('MX6UL', 'MCA')\n" \
" -c : channel number to read from\n" \
" -n : Number of samples (default: 1)\n" \
" -d : Delay (in ms) between samples (default: 1000)\n" \
" -v : Show output in V (otherwise raw ADC value is shown)\n" \
" -h : help\n\n"
enum adc_type {
ADC_TYPE_UNKNOWN,
ADC_TYPE_MX6UL,
ADC_TYPE_MCA
};
struct adc_data {
enum adc_type type;
const char *name;
const char *dev_name;
unsigned int nbits;
};
struct adc_data adc_list[] = {
{
.type = ADC_TYPE_MX6UL,
.name = "MX6UL",
.dev_name = "2198000.adc",
.nbits = 12,
}, {
.type = ADC_TYPE_MCA,
.name = "MCA",
.dev_name = "mca-cc6ul-adc",
.nbits = 12,
}
};
typedef struct adc {
struct adc_data *data;
char *chrdev_name;
char *sysfs_file;
char *sysfs_dir;
int dev_num;
unsigned long channel;
double voltage_scale;
} adc_t;
static void show_usage(int full)
{
fprintf(stdout, "%s", full ?
ADC_SAMPLE_FULL_USAGE : ADC_SAMPLE_USAGE);
}
static struct adc_data *get_adc_data(const char *type_str)
{
struct adc_data *data = NULL;
int i;
for (i = 0; i < ARRAY_SIZE(adc_list); i++) {
if (!strcmp(adc_list[i].name, type_str)) {
data = &adc_list[i];
break;
}
}
return data;
}
static int read_adc_sample_sysfs(adc_t *adc, long int *val)
{
int fd, ret;
char buffer[BUFFER_LEN];
fd = open(adc->sysfs_file, O_RDONLY);
if (fd < 0) {
fprintf(stdout, "%s: failed to open %s\n",
__func__, adc->sysfs_file);
ret = fd;
goto just_ret;
}
ret = read(fd, buffer, BUFFER_LEN);
if (ret < 0) {
fprintf(stdout, "%s: failed to read ADC sample from %s (%d)\n",
__func__, adc->sysfs_file, ret);
goto close_ret;
}
if (ret == 0) {
fprintf(stdout, "%s: no data available in %s\n",
__func__, adc->sysfs_file);
ret = -ENODATA;
goto close_ret;
}
*val = strtol(buffer, NULL, 10);
ret = 0;
close_ret:
close(fd);
just_ret:
return ret;
}
static int read_voltage_scale(adc_t *adc, double *val)
{
int fd, ret;
char buffer[BUFFER_LEN];
char *temp;
/* Read the voltage scale from the sysfs */
ret = asprintf(&temp, "%s/in_voltage_scale", adc->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 voltage scale from %s (%d)\n",
__func__, temp, ret);
goto close_fd;
}
if (ret == 0) {
fprintf(stdout, "%s: no data available in %s\n", __func__, temp);
ret = -ENODATA;
goto close_fd;
}
*val = atof(buffer);
close_fd:
close(fd);
free_temp:
free(temp);
return ret;
}
int main(int argc, char **argv)
{
adc_t *adc;
unsigned long nsamples = 1;
unsigned long delay_ms = 1000;
long sample_val;
bool raw = true;
int ret, opt, i;
if (argc <= 2) {
show_usage(0);
return EXIT_FAILURE;
}
adc = malloc(sizeof(adc_t));
if (!adc) {
fprintf(stdout, "Failed to allocate memory\n");
ret = -ENOMEM;
goto error_ret;
}
memset(adc, 0, sizeof(adc_t));
adc->channel = ~0;
while ((opt = getopt(argc, argv, "t:n:d:c:vh")) > 0) {
switch (opt) {
case 't':
adc->data = get_adc_data(optarg);
if (!adc->data) {
fprintf(stdout, "Unknown ADC type %s\n", optarg);
show_usage(0);
ret = EXIT_FAILURE;
goto error_ret2;
}
break;
case 'n':
nsamples = strtoul(optarg, NULL, 10);
if (!nsamples) {
fprintf(stdout,
"Invalid number of samples parameter (%s)\n",
optarg);
show_usage(0);
ret = EXIT_FAILURE;
goto error_ret2;
}
break;
case 'd':
delay_ms = strtoul(optarg, NULL, 10);
if (!delay_ms) {
fprintf(stdout,
"Invalid inter sample delay parameter (%s)\n",
optarg);
show_usage(0);
ret = EXIT_FAILURE;
goto error_ret2;
}
break;
case 'c':
adc->channel = strtoul(optarg, NULL, 10);
break;
case 'v':
raw = false;
break;
case 'h':
show_usage(1);
return EXIT_SUCCESS;
default:
show_usage(0);
return EXIT_FAILURE;
}
}
/* Check that the application params provide what we need */
if (!adc->data || adc->data->type == ADC_TYPE_UNKNOWN) {
fprintf(stdout, "ADC type must be provided\n");
show_usage(1);
ret = EXIT_FAILURE;
goto error_ret2;
}
if (adc->channel == ~0) {
fprintf(stdout, "ADC channel must be provided\n");
show_usage(1);
ret = EXIT_FAILURE;
goto error_ret2;
}
adc->dev_num = find_type_by_name(adc->data->dev_name, "iio:device");
if (adc->dev_num < 0) {
fprintf(stdout, "Failed to find iio:device for %s\n",
adc->data->dev_name);
ret = -ENODEV;
goto error_ret2;
}
ret = asprintf(&adc->chrdev_name, "/dev/iio:device%d", adc->dev_num);
if (ret < 0) {
fprintf(stdout, "Failed to allocate memory\n");
ret = -ENOMEM;
goto error_ret2;
}
ret = asprintf(&adc->sysfs_dir, "/sys/bus/iio/devices/iio:device%d",
adc->dev_num);
if (ret < 0) {
fprintf(stdout, "Failed to allocate memory\n");
ret = -ENOMEM;
goto error_ret3;
}
ret = asprintf(&adc->sysfs_file, "%s/in_voltage%lu_raw",
adc->sysfs_dir, adc->channel);
if (ret < 0) {
fprintf(stdout, "Failed to allocate memory\n");
ret = -ENOMEM;
goto error_ret4;
}
if (!raw) {
ret = read_voltage_scale(adc, &adc->voltage_scale);
if (ret < 0) {
goto error_ret5;
}
}
for (i = 0; i < nsamples; i++) {
ret = read_adc_sample_sysfs(adc, &sample_val);
if (ret)
break;
if (raw) {
fprintf(stdout, "Sample %i: 0x%04x\n",
i, (unsigned int)sample_val);
} else {
fprintf(stdout, "Sample %i: %.2f V\n",
i, sample_val * adc->voltage_scale / 1000);
}
usleep(delay_ms * 1000);
}
error_ret5:
free(adc->sysfs_file);
error_ret4:
free(adc->sysfs_dir);
error_ret3:
free(adc->chrdev_name);
error_ret2:
free(adc);
error_ret:
return ret;
}

View File

@ -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 <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <dirent.h>
#include <errno.h>
#include <ctype.h>
#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", &current_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,
&current->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", &current->index);
fclose(sysfsfp);
free(filename);
/* Find the scale */
ret = iioutils_get_param_float(&current->scale,
"scale",
device_dir,
current->name,
current->generic_name);
if (ret < 0)
goto error_cleanup_array;
ret = iioutils_get_param_float(&current->offset,
"offset",
device_dir,
current->name,
current->generic_name);
if (ret < 0)
goto error_cleanup_array;
ret = iioutils_get_type(&current->is_signed,
&current->bytes,
&current->bits_used,
&current->shift,
&current->mask,
&current->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 */

View File

@ -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 <stdint.h>
/* 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_ */

View File

@ -0,0 +1,27 @@
#
# 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.
#
SUBDIRS := device_request_listener upload_data_points upload_file
all: $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
.PHONY: clean install
clean install:
for a in $(SUBDIRS); do $(MAKE) -C $$a $@; done

View File

@ -0,0 +1,38 @@
#
# 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.
#
PROGRAM := device_request_listener
CFLAGS += -Wall
CFLAGS += $(shell pkg-config --cflags cloudconnector)
LDLIBS += $(shell pkg-config --libs --static cloudconnector)
all: $(PROGRAM)
OBJS = device_request.o main.o
$(PROGRAM): $(OBJS)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
.PHONY: install
install: $(PROGRAM)
install -d $(DESTDIR)/usr/bin
install -m 0755 $(PROGRAM) $(DESTDIR)/usr/bin/
.PHONY: clean
clean:
-rm -f *.o $(PROGRAM)

View File

@ -0,0 +1,88 @@
/*
* 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
* =======================================================================
*/
#include <signal.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include "device_request.h"
#define MAX_RESPONSE_SIZE 256
#if !(defined UNUSED_ARGUMENT)
#define UNUSED_ARGUMENT(a) (void)(a)
#endif
/*
* get_time_cb() - Data callback for 'get_time' device requests
*
* @target: Target ID of the device request (get_time).
* @transport: Communication transport used by the device request.
* @request_buffer_info: Buffer containing the device request.
* @response_buffer_info: Buffer to store the answer of the request.
*
* Logs information about the received request and executes the corresponding
* command.
*/
void get_time_cb(char const *const target,
ccapi_transport_t const transport,
ccapi_buffer_info_t const *const request_buffer_info,
ccapi_buffer_info_t *const response_buffer_info)
{
UNUSED_ARGUMENT(request_buffer_info);
log_debug("get_time_cb(): target='%s' - transport='%d'", target, transport);
response_buffer_info->buffer = malloc(sizeof(char) * MAX_RESPONSE_SIZE + 1);
if (response_buffer_info->buffer == NULL) {
log_error("%s\n", "get_time_cb(): response_buffer_info malloc error");
return;
}
time_t t = time(NULL);
response_buffer_info->length = snprintf(response_buffer_info->buffer,
MAX_RESPONSE_SIZE, "Time: %s", ctime(&t));
}
/*
* get_time_status_cb() - Status callback for 'get_time' device requests
*
* @target: Target ID of the device request (get_time)
* @transport: Communication transport used by the device request.
* @response_buffer_info: Buffer containing the response data.
* @receive_error: The error status of the receive process.
*
* This callback is executed when the response process has finished. It doesn't
* matter if everything worked or there was an error during the process.
*
* Cleans and frees the response buffer.
*/
void get_time_status_cb(char const *const target,
ccapi_transport_t const transport,
ccapi_buffer_info_t *const response_buffer_info,
ccapi_receive_error_t receive_error)
{
log_debug(
"get_time_status_cb(): target='%s' - transport='%d' - error='%d'",
target, transport, receive_error);
/* Free the response buffer */
if (response_buffer_info != NULL)
free(response_buffer_info->buffer);
}

View File

@ -0,0 +1,35 @@
/*
* 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
* =======================================================================
*/
#ifndef DEVICE_REQUEST_H_
#define DEVICE_REQUEST_H_
#include <cloudconnector/cloudconnector.h>
#define TARGET_GET_TIME "get_time"
void get_time_cb(char const *const target, ccapi_transport_t const transport,
ccapi_buffer_info_t const *const request_buffer_info,
ccapi_buffer_info_t *const response_buffer_info);
void get_time_status_cb(char const *const target,
ccapi_transport_t const transport,
ccapi_buffer_info_t *const response_buffer_info,
ccapi_receive_error_t receive_error);
#endif /* DEVICE_REQUEST_H_ */

View File

@ -0,0 +1,106 @@
/*
* 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
* =======================================================================
*/
#include <cloudconnector.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "device_request.h"
static void sigint_handler(int signum)
{
log_debug("sigint_handler(): received signal %d to close Cloud connection.\n", signum);
exit(0);
}
static void graceful_shutdown(void)
{
stop_cloud_connection();
wait_for_ccimp_threads();
}
static void add_sigkill_signal(void)
{
struct sigaction new_action;
struct sigaction old_action;
atexit(graceful_shutdown);
/* Setup signal hander. */
new_action.sa_handler = sigint_handler;
sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
sigaction(SIGINT, NULL, &old_action);
if (old_action.sa_handler != SIG_IGN)
sigaction(SIGINT, &new_action, NULL);
}
/*
* Use the following SCI request to test this example (insert your Device ID):
*
* <sci_request version="1.0">
* <data_service>
* <targets>
* <device id="00000000-00000000-00000000-00000000"/>
* </targets>
* <requests>
* <device_request target_name="get_time"/>
* </requests>
* </data_service>
* </sci_request>
*
*/
int main(void)
{
cc_init_error_t init_error;
cc_start_error_t start_error;
ccapi_receive_error_t receive_error;
add_sigkill_signal();
init_error = init_cloud_connection(NULL);
if (init_error != CC_INIT_ERROR_NONE) {
log_error("Cannot initialize cloud connection, error %d\n", init_error);
return EXIT_FAILURE;
}
start_error = start_cloud_connection();
if (start_error != CC_START_ERROR_NONE) {
log_error("Cannot start cloud connection, error %d\n", start_error);
return EXIT_FAILURE;
}
receive_error = ccapi_receive_add_target(TARGET_GET_TIME, get_time_cb,
get_time_status_cb, 0);
if (receive_error != CCAPI_RECEIVE_ERROR_NONE) {
log_error("Cannot register target '%s', error %d\n", TARGET_GET_TIME,
receive_error);
return EXIT_FAILURE;
}
printf("Waiting for Device Cloud request...\n");
printf("Press a key to exit\n");
getchar();
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,38 @@
#
# 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.
#
PROGRAM := upload_data_points
CFLAGS += -Wall
CFLAGS += $(shell pkg-config --cflags cloudconnector)
LDLIBS += $(shell pkg-config --libs --static cloudconnector)
all: $(PROGRAM)
OBJS = data_point.o main.o
$(PROGRAM): $(OBJS)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
.PHONY: install
install: $(PROGRAM)
install -d $(DESTDIR)/usr/bin
install -m 0755 $(PROGRAM) $(DESTDIR)/usr/bin/
.PHONY: clean
clean:
-rm -f *.o $(PROGRAM)

View File

@ -0,0 +1,143 @@
/*
* 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
* =======================================================================
*/
#include <limits.h>
#include <stdio.h>
#include <time.h>
#include "data_point.h"
#define STREAM_NAME "incremental"
/*
* get_incremental() - Retrieves an incremental value each time
*/
static int get_incremental(void)
{
static int incremental = -1;
if (incremental == INT_MAX)
incremental = 0;
else
incremental++;
log_debug("Incremental = %d\n", incremental);
return incremental;
}
/*
* get_timestamp() - Get the current timestamp of the system
*
* Return: The timestamp of the system.
*/
static ccapi_timestamp_t *get_timestamp(void)
{
ccapi_timestamp_t *timestamp = NULL;
size_t len = strlen("2016-09-27T07:07:09.546Z") + 1;
char *date = NULL;
time_t now;
timestamp = (ccapi_timestamp_t*) malloc(sizeof(ccapi_timestamp_t));
if (timestamp == NULL)
return NULL;
date = (char*) malloc(sizeof(char) * len);
if (date == NULL) {
free(timestamp);
return NULL;
}
time(&now);
if (strftime(date, len, "%FT%TZ", gmtime(&now)) > 0) {
timestamp->iso8601 = date;
} else {
free(date);
timestamp->iso8601 = NULL;
}
return timestamp;
}
ccapi_dp_error_t init_data_stream(ccapi_dp_collection_handle_t *dp_collection)
{
ccapi_dp_collection_handle_t collection;
ccapi_dp_error_t dp_error;
dp_error = ccapi_dp_create_collection(&collection);
if (dp_error != CCAPI_DP_ERROR_NONE) {
log_error("ccapi_dp_create_collection() error %d\n", dp_error);
return dp_error;
} else {
*dp_collection = collection;
}
dp_error = ccapi_dp_add_data_stream_to_collection_extra(collection,
STREAM_NAME, "int32 ts_iso", "counts", NULL);
if (dp_error != CCAPI_DP_ERROR_NONE) {
log_error("ccapi_dp_add_data_stream_to_collection_extra() error %d\n",
dp_error);
free(collection);
}
return dp_error;
}
ccapi_dp_error_t add_data_point(ccapi_dp_collection_handle_t dp_collection)
{
ccapi_dp_error_t dp_error;
ccapi_timestamp_t *timestamp = get_timestamp();
dp_error = ccapi_dp_add(dp_collection, STREAM_NAME, get_incremental(), timestamp);
if (dp_error != CCAPI_DP_ERROR_NONE) {
log_error("ccapi_dp_add() failed with error: %d\n", dp_error);
}
if (timestamp != NULL) {
if (timestamp->iso8601 != NULL) {
free((char *) timestamp->iso8601);
timestamp->iso8601 = NULL;
}
free(timestamp);
timestamp = NULL;
}
return dp_error;
}
ccapi_dp_error_t send_data_stream(ccapi_dp_collection_handle_t dp_collection)
{
ccapi_dp_error_t dp_error;
log_debug("%s", "Sending Data Stream with new incremental value\n");
dp_error = ccapi_dp_send_collection(CCAPI_TRANSPORT_TCP, dp_collection);
if (dp_error != CCAPI_DP_ERROR_NONE) {
log_error("ccapi_dp_send_collection() error %d\n", dp_error);
}
return dp_error;
}
ccapi_dp_error_t destroy_data_stream(ccapi_dp_collection_handle_t dp_collection)
{
log_debug("%s", "Destroying Data Stream\n");
return ccapi_dp_destroy_collection(dp_collection);
}

View File

@ -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
* =======================================================================
*/
#ifndef DATA_POINT_H_
#define DATA_POINT_H_
#include <cloudconnector/cloudconnector.h>
ccapi_dp_error_t init_data_stream(ccapi_dp_collection_handle_t *dp_collection);
ccapi_dp_error_t add_data_point(ccapi_dp_collection_handle_t dp_collection);
ccapi_dp_error_t send_data_stream(ccapi_dp_collection_handle_t dp_collection);
ccapi_dp_error_t destroy_data_stream(ccapi_dp_collection_handle_t dp_collection);
#endif /* DATA_POINT_H_ */

View File

@ -0,0 +1,116 @@
/*
* 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
* =======================================================================
*/
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <cloudconnector/cloudconnector.h>
#include "data_point.h"
#define DP_SLEEP_TIME 5
#define DP_NUMBER 10
static int running = 1;
static ccapi_dp_collection_handle_t dp_collection;
static void sigint_handler(int signum)
{
log_debug("sigint_handler(): received signal %d to close Cloud connection.\n", signum);
exit(0);
}
static void graceful_shutdown(void)
{
if (running == 1) {
destroy_data_stream(dp_collection);
}
running = 0;
stop_cloud_connection();
wait_for_ccimp_threads();
}
static void add_sigkill_signal(void)
{
struct sigaction new_action;
struct sigaction old_action;
atexit(graceful_shutdown);
/* Setup signal hander. */
new_action.sa_handler = sigint_handler;
sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
sigaction(SIGINT, NULL, &old_action);
if (old_action.sa_handler != SIG_IGN)
sigaction(SIGINT, &new_action, NULL);
}
int main(void)
{
cc_init_error_t init_error;
cc_start_error_t start_error;
ccapi_dp_error_t dp_error;
int i;
add_sigkill_signal();
init_error = init_cloud_connection(NULL);
if (init_error != CC_INIT_ERROR_NONE) {
log_error("Cannot initialize cloud connection, error %d\n", init_error);
return EXIT_FAILURE;
}
start_error = start_cloud_connection();
if (start_error != CC_START_ERROR_NONE) {
log_error("Cannot start cloud connection, error %d\n", start_error);
return EXIT_FAILURE;
}
dp_error = init_data_stream(&dp_collection);
if (dp_error != CCAPI_DP_ERROR_NONE) {
log_error("Cannot initialize data stream, error %d\n", start_error);
return EXIT_FAILURE;
}
running = CCAPI_TRUE;
while (running != CCAPI_FALSE) {
/* Collect DP_NUMBER data points sampled each DP_SLEEP_TIME seconds */
for (i = 0; i < DP_NUMBER; i++) {
dp_error = add_data_point(dp_collection);
if (dp_error != CCAPI_DP_ERROR_NONE) {
log_error("Cannot add data point, error %d\n", start_error);
i--;
}
sleep(DP_SLEEP_TIME);
}
/* Send the block of collected data points */
dp_error = send_data_stream(dp_collection);
if (dp_error != CCAPI_DP_ERROR_NONE)
log_error("Cannot send data stream, error %d\n", start_error);
}
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,38 @@
#
# 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.
#
PROGRAM := upload_file
CFLAGS += -Wall
CFLAGS += $(shell pkg-config --cflags cloudconnector)
LDLIBS += $(shell pkg-config --libs --static cloudconnector)
all: $(PROGRAM)
OBJS = main.o
$(PROGRAM): $(OBJS)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
.PHONY: install
install: $(PROGRAM)
install -d $(DESTDIR)/usr/bin
install -m 0755 $(PROGRAM) $(DESTDIR)/usr/bin/
.PHONY: clean
clean:
-rm -f *.o $(PROGRAM)

View File

@ -0,0 +1,87 @@
/*
* 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
* =======================================================================
*/
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <cloudconnector/cloudconnector.h>
#define UNUSED_ARGUMENT(a) (void)(a)
#define STREAM_NAME "examples/uploaded_file"
#define UPLOAD_FILE "/etc/build"
static void sigint_handler(int signum)
{
log_debug("sigint_handler(): received signal %d to close Cloud connection.\n", signum);
exit(0);
}
static void graceful_shutdown(void)
{
stop_cloud_connection();
wait_for_ccimp_threads();
}
static void add_sigkill_signal(void)
{
struct sigaction new_action;
struct sigaction old_action;
atexit(graceful_shutdown);
/* Setup signal hander. */
new_action.sa_handler = sigint_handler;
sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
sigaction(SIGINT, NULL, &old_action);
if (old_action.sa_handler != SIG_IGN)
sigaction(SIGINT, &new_action, NULL);
}
int main(int argc, char *argv[])
{
cc_init_error_t init_error;
cc_start_error_t start_error;
ccapi_dp_b_error_t send_error;
UNUSED_ARGUMENT(argc);
add_sigkill_signal();
init_error = init_cloud_connection(NULL);
if (init_error != CC_INIT_ERROR_NONE) {
log_error("Cannot initialize cloud connection, error %d\n", init_error);
return EXIT_FAILURE;
}
start_error = start_cloud_connection();
if (start_error != CC_START_ERROR_NONE) {
log_error("Cannot start cloud connection, error %d\n", start_error);
return EXIT_FAILURE;
}
send_error = ccapi_dp_binary_send_file(CCAPI_TRANSPORT_TCP, UPLOAD_FILE, STREAM_NAME);
if (send_error != CCAPI_DP_B_ERROR_NONE) {
log_error("ccapi_dp_binary_send_file() failed, error %d\n", send_error);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}

View File

@ -30,6 +30,7 @@ RDEPENDS_${PN}_append_ccimx6 = "\
${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-bt", "", d)} \
${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-btconfig", "", d)} \
dey-examples-can \
dey-examples-cloudconnector \
${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-hdp", "", d)} \
${@bb.utils.contains("MACHINE_FEATURES", "accel-graphics", "dey-examples-opengles", "", d)} \
dey-examples-v4l2 \
@ -38,7 +39,9 @@ RDEPENDS_${PN}_append_ccimx6 = "\
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-can \
dey-examples-cloudconnector \
${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-hdp", "", d)} \
dey-examples-tamper \
"

Some files were not shown because too many files have changed in this diff Show More