From 611e2652b61a6ed8ccc4a1e6f941dc12a1e57ba8 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 29 Nov 2016 13:58:32 +0100 Subject: [PATCH 01/84] meta-digi-dey: bump distro version to 2.0-r5 Signed-off-by: Javier Viguera --- README.md | 6 +++++- meta-digi-dey/conf/distro/dey.conf | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 924129067..54ab606b4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/meta-digi-dey/conf/distro/dey.conf b/meta-digi-dey/conf/distro/dey.conf index db74c7149..1eabe420c 100644 --- a/meta-digi-dey/conf/distro/dey.conf +++ b/meta-digi-dey/conf/distro/dey.conf @@ -1,6 +1,6 @@ DISTRO = "dey" DISTRO_NAME = "Digi Embedded Yocto" -DISTRO_VERSION = "2.0-r4" +DISTRO_VERSION = "2.0-r5" DISTRO_CODENAME = "jethro" SDK_VENDOR = "-deysdk" SDK_VERSION := "${@'${DISTRO_VERSION}'}" From 2fee1a85b05a0ce49b119a1e190b1175220b7076 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Tue, 22 Nov 2016 17:33:47 +0100 Subject: [PATCH 02/84] dey-image-tiny-initramfs: use cpio.gz.u-boot.tf image The u-boot header is required for U-Boot to boot the image in secure boot. The cpio.gz.u-boot.tf image gets signed and encrpyted if required. https://jira.digi.com/browse/DEL-3242 Signed-off-by: Diaz de Grenu, Jose --- .../recipes-core/images/dey-image-tiny-initramfs.bb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-core/images/dey-image-tiny-initramfs.bb b/meta-digi-dey/recipes-core/images/dey-image-tiny-initramfs.bb index 0320a61ff..5219354ed 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-tiny-initramfs.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-tiny-initramfs.bb @@ -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 \ No newline at end of file From b30cd6eb2b8bb44258698c6fda3a43c2eab9f583 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Tue, 22 Nov 2016 18:19:19 +0100 Subject: [PATCH 03/84] Revert "meta-digi-arm: Add rootfs.initramfs image generation." This image type is not used anymore. This reverts commit aef38bc2852264fb08da9ca4d4730875b18e2a20. --- meta-digi-arm/classes/image_types_digi.bbclass | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index 03dfd64e7..e79819b44 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -124,18 +124,6 @@ IMAGE_CMD_boot.ubifs() { rm -rf ${TMP_BOOTDIR} } -IMAGE_CMD_rootfs.initramfs() { - # - # Image generation code for image type 'rootfs.initramfs' - # - 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 - # 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 - fi -} -IMAGE_TYPEDEP_rootfs.initramfs = "cpio.gz" - IMAGE_CMD_cpio.gz.u-boot.tf() { # # Image generation code for image type 'cpio.gz.u-boot.tf' From e441b6fec5e464a5f50a2a1c501979bc31df927d Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 30 Nov 2016 14:51:54 +0100 Subject: [PATCH 04/84] trustfence-tool: install tool from tarball Use the static binary from the tarball, which should be common across different platforms and operating systems. https://jira.digi.com/browse/DEL-3261 Signed-off-by: Javier Viguera --- .../ccimx6/trustfence-tool | Bin 15896 -> 0 bytes .../ccimx6ul/trustfence-tool | Bin 16032 -> 0 bytes .../trustfence/trustfence-tool_2.0.bb | 18 ++++-------------- 3 files changed, 4 insertions(+), 14 deletions(-) delete mode 100755 meta-digi-dey/recipes-core/trustfence/trustfence-tool-2.0/ccimx6/trustfence-tool delete mode 100755 meta-digi-dey/recipes-core/trustfence/trustfence-tool-2.0/ccimx6ul/trustfence-tool diff --git a/meta-digi-dey/recipes-core/trustfence/trustfence-tool-2.0/ccimx6/trustfence-tool b/meta-digi-dey/recipes-core/trustfence/trustfence-tool-2.0/ccimx6/trustfence-tool deleted file mode 100755 index 79c9c2face087122ebae16a6e97bbb2f18b39340..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15896 zcmd6OeSB2ao%gwSX2>v1k`bZ?jCz5fL6R^iDj>=QA_NO$L_}K9WRjVXDM@CU3<_O# zI|&J-NDvE(Z#;}`ch|LUWxIXxp~a4h)>>ca<_e*@g=e)f=tCfwE0)>_*guf2>DNP{@!ap}q%@fZ3-;am-c<7Ft+0muLG zXR~ItU$o-krv7I#nH@#D=RSPN6?GWnoPu6=|E||NAv?}cwFmuLRZ8m-liNJ??mK}Z zlz_LFb>ZT?!o@WT7j;)u=s0Sw;dAuIq3w6{*(^pWallH^ri{GKLK$zh@_#1SZOX{& zoO~tDwd-=!v~}T{WH%}b0Mr-Q?F&(BcAM2?lqq(9s$H|HbhO#rF?{#d+Lc%TdBH~` zzj)y1dn+ctH1@Cm`rQx4`$~WE_Zy=(mrXx^SH)#VKNx@gPaX;!d3Voqb0_CY$3F7W z9cTT`16xN<^_Bh485_^O?ceU-y7l(%(!YJ@tkRp_*ju4Y{pkCD)b`apc<`S}x2LKC z>+ZX%R9|sm>(&1}w|LfLy~VC8Z~g0nzq@ulH;``b~r zI`FCg&5pi0iob>STvnWaU{wG3sQ&y>{b{56a#Y{xAEZy8DO~I?D|Aq^9~;$AjOq`L z>i=?7zhPAW2c!Buqx%0cs^2`S|JzZ0##G@Vzxk|?hp_*2VGuR@-ckDg-l*~FQGJ1Y z)WQsOg@|sBB}I3lE7qB86|M0^v{S?r$yjGZB%)ni@h;KW80(I=%$?iV-Q5!IY!!)3 z$!`8>X$yCWaC5vXDH7JS)(ugNbSJyoL8Bwu(H#ZhWEcK}255E08{6Y8;bbh{DY~NJ z2nHkZP07y|Xw5Is-W`o@B!QO17SY<$9`BBdj&M8XlCyBv1`&(5B-;g+LmxCdH;C34 z7LAKU9=p{R2TK=ZpummYn4N6w2**0bZC$ZsRCIS11n-JQ!N`V=c&ClkD3&f?wrFwV zrL|X{ZgGpkrT#bmxxN&axt2Q*O;^Z`=f+}4oh~sAK*GwbzA9$g_H9RuosBkQtqe}W z7%W3FX6%+BS-*9qD$YRy9byf~IK>*lFw7bW_I=h!oFB4A;{Sy8WGsaF=O8J%StD_K zStC*VStGattiezj>+=y`tRX-JYb1A#HTbGzjf7ss8i}`>wI)Q6H8zyltg)fZVT}Yo zpEVM*&Kf~p#~R6`o;5VFoHaI=5Njm&)vU2Gu4RplU_EPWNKLHI79zs>JR#axkA)n1 z%^yw*anhSQGUS#urdu8~OXMBWJN&pApi-Z?BRBrJUAe%>FU&&Q>u3u{`@>H^!x?t8 zha7F`Xus}gA9J*yb+j{%_G6CrAxHZmM?39k-{WZSakK{=@D>~v@w8M38oEqaKL7TeGsZb40((tW>&dBNO%`F~^9Jv-@Q#m+`21p@Svv;wL!lfFe1`+*4;1Es2e`Sf zOe5V@2142Aw%0&-`hM)r&qD|uE(`24Iron?3}JrQukXXW)doV!=Z4(dAhUoD*p7L{ zNe^o8vBBJM&ygWT*&)5!U8eHH{^LrZC+8M>tTjbon;FRTn`NTke0gMKk{U{9UxjRs zs4gQII0#$l#+9IJ0JaOT3LADQVAMeZFs}`(0ql2x1%imJLuo@u=rVBNtzr#4X^1~j zgS8Ht?o5s87Y9v$@Ss_TIa^Rfts)|{MvWrM058)Hny%m-Qq}h2c(BU2U}UDU0JI}B z6tNE}s{->YfaeM}$uY1A#_tTEPx}ye!pO`l^W@*4@TvrUWdQO7n&iT>(%APY#2fM5EF2p%=jAL;`x>5CwBdV}R>3cjjd? z0a_ySq$x6cO_x}2`2Wwr{T)J_c&kJa11Qxf4;AB{CyU;f}H}@;DFSj7$|BgS?pB0&-jKwU@Pp9XfF?Xf9 z_Y=<5Iro+Q{wLCRg6`cS^P-8kJz?f3;sWi^ZqR=7^R&U|u+67SC+%1EuV0ki?|-sD z`$hO9X}`!AI8FPPXuAUNVbLrZCqjG0bZbwU3D{f(+;bZK>S;LQ&nP(!fAch4`4Twu z4(T~zu`wMbijK_8&}Lhc3MFGJp2j4Po798l(|Xa|LuM4dC1tEe0O zm>GFjHE93Jr*>r*!0xm+$~J$~oBJ1J+&RB|^Z31`hPjM{YcEk!;Jx}p4h_>MJS zBF}<`($tr$&c1ovmGS4G!>o{bKVh!sS{6=dd#>`y{92g1_iAbTn1qjkZYkG%f^(lS zUt`{(o-+-Kdv-_h7Fq^z_67Js8$Sqq>=6p^R1|@E zF2@>Pgdnm;VZUMAA;*FEX%{NNyR-yT!f22C&80kr+7%TNbUi{QQH=1QO8mj}$R zU%bKy=m*R-=Z-VHnFFQ^I+!0kVE(FnrQr_M%C${9O(oDL-w;KHs%?}0phu3;dZjxw zRjQ$W>DKNw&Goya=3Zn7v0JK%bhbpRmY$$0*C%$GCE8S36zq|%U@!KEd(D=4{qmBx z{l<>tbq4kB*V0*!HbuHcO1d;vHt9P}Kl)|ZcZKMce$0{QZjTW5-F6q%KrB_eMNNT6))_Y~((7k5l+8+7nOTs8mVeiKJTc2(){F&Rqt13OAUDB1A zBHIq_G(DMJvP|4-o_f9yW0PgYA?OV_`krs+N@Pm5i=EK*ZmGyA(j|Axs^CPk^8{oS zgXV-WZo>ut4|=b|eq9M(`ejMbB^ftvF;yl)&>Li`JT%diMW8WltWgrImX)DFb4g7D za=QzA&+Re^KFGHpd}^TYhHjgurR3{t#~P`xE-{cFkf&?GcaKytrzAL4B6rHo0q7~T zO;%(knvY&tYSdj-Zu=^EC*drK#|oM=rk}{dLX|GIxK-* zXpiaV)#n-l3v)r}3o!>-uvVa2rl3<1=#gb|qM3ya9$#7v-<~Gx5`*UYW%YI0J z*(Z0xH~XYV*JL0y(Ny(5NgGUgLNTcS*>cd_^P43G_3zIN$N|tT*uk%XH`swT*qbdf z?s=yHXDaUJlVyqQhh9|3lDEMw=#+Nw+IHCOavO7?Pd|KM%b4p7A-2g9;OA{HMeYga zZQu^&Z7{h?7$uPF$J60^T0e5G0zV$K^*>qSERom$jjBN#T(G9W@Pu~Aeb6;^O1+n0 zPG#tTrAK}7IQUhM)b-_tTkn^rZtexoeR4M9i8{W1lE)Cx=PlE=#}f zp6r)5>x%L4ul(R?nw+_0g`tA>Pk+7A@W4j?%ytV;15YaS+ehS&Uc;QP2JI*>$DH%Qu0KP@fcfHT0s$w^#TLKlsWnge+Q*tOj4X8KBD?0N$t{ z1+u<&u7J$d^2!OzjS}#!1h&ccU-wE?_JCHO^arL`df!njAn#=PsvA0nkCj8G;d7{) zeyN0zKVZjqRx1W`!PjoAgYUq%!Dp_f2ePEVYoAng*bHlWmX#O^)-;w~XHdU$G6&3e zPxgWidD|t`4D_x~k<1w%PVgD3UMb(JKn#MPGI79+EQ8!u+}28gb$_SAPq1#hXbE)C z3!ZM5(KW~sShobcGUw3GcAj#BuPO49ck1B>wEciQ^+Lb&z(@VsH1Ow^i>A8_57zs5 zW`jZdYmgy(9(dAVL+Tbb>{(K3_+i6uEUkwR_sc5iqG>GTgv|6S#j-(H>t#EuH7vkFS`yr?2r`+_!MybnQhP` z&T){*{2KU&z5c1xZ!jOfISw%*p%1YGw0Fyzt_dSqV-wwa3wtR=S?a#Q3&Y_fi@8}BXe21(AjS}FIcgpHHUomo(yX8O` z&JvKd8sn6MGEy&;cdjTlqPO(QSH`Y@zQH4KJiwt0l-2yhSmUkh`sEvMuY{}vmJF1W zdZDZzRu>uV&-Tgh&Rhun?vQ1ePy3O7${AhbF|uX5TXK?r%1E71&bmda(NxkS zr`I(gZ)}%Z6Y@zxM#!=My;9@Ub18X=QD^DePg@<5S?a?NJ}BouPC$;T+9mg$N1JYw zwCCKQ59`660`@HHm3!wm7_Q)USq}Qjq1&@+MrPGRGr)_?y0P~thqlS)t9#^A(>=zz zY1nHryRt4_X34Lr4OlvLL8kVT+vIniNBqB3k6hEAElJ6&i}G4I3ONxxOYd$O3?4B5 zc6BLz5WLE43FLjRvB4O32zvwes*^v#nG$-aLk#@(9gi_CHIN;bfLy66*=N>6msnHw z$>y5dt}TQ=2gylW!Prd|ggZkKaX@F~bp z0-ZBchLWa>Wbeu%OW!vvZ7^D{qA$U(^*-r> z?p@$tK=-o+{1Izh{$#0=egjZx$&JMz!QzWp1Yp%|+1X+^PdYbEwYoMEp$zQlOp zrIp6v@@2-Q+CsxCQ`o;!ppnA;c?#!L-kYKfA9#z;YlNPL?0Za}50oa{M+A|NFMY~z z;k++`eZbvExq26fK<>NO;M|kwQ{8~`8Hk>0!n2-K&MQ`B@n~?KS0k-H;^aJ`Hd*zT zk&}GBqvNdYrYud{<;8y;Ik`aGh`!kA0sa__7h!C8;gO+=zl@w)}@DXlkr^ZlUmjA1R)!q>FF59c|P|lXjWaQT5Tnu8*ih}XKGX7JHJO;1MOny z{t8!~4ju;|_JHmX@jw@kj}L!Kl))Fpq}6rDj|+WY4tAa(^hl2DlaB{5mwJvME`qox zf9L|$kR`Zp#(D~#gKYvW`VQfG>1Xgb;9Tnk)F&e8M!@ni;@P0kbkJj?W7M~&&FE4Xj9kTz+mnTo7NOt*Ml}6 zGi^Q)$3CvfwXd~x+Xmh8-kkb*h|lAoSMX?DfVqbNV;t|Z;S&L)JqmMZi_P}fc#Prs z>WR^|%mGH*gls%7@MxP>)O?0O{TH5VDu87HBQKhb|H(%qCx2_>`EA$-fISb`FKQKW z3}tJT%i!+`D*V$An`sihA9Ued{T*{oz-3fvXzPe`nSVCz$NKbT+UN4sac2^J+^hesf95`$%XuHs+jmJT^_(jn2^P+^Zl!56Z`C+#ZYiZtlv z{dm30W%=*#AqU4lge=V0&l`YC=s$%yvc9`->Z;R6H_NB>u;c z3-y#a>FkfR=dr&$Z*H9cJ!s?)dVrnXSeHJ^wiPpaU+#xkQ#6Hghk)y`aowT*9PV>` z-{)8&|IGe9v=wm^pVdrK;kU5uBsb`AAMir{b@VmJR0Wy%JX?-;8TUXgzhSx4E$W?(=xv| zeRw7}Rji+Y{NgJ{I}IPJD03Nj9+ab>kuT1Je@~ih<0E%Wnu0cd2{Z6q8PEJy8^|;N zoBn=3=m&6aNaMGLGMpo*JN{OoXt-z5wwd3zePd{<%lL$P;Tn*a&+@OrT(_;q;Y$_4 z=T}-NZB$b)P1sLBzYO=~t85tpV$i$}a)g4|oAh+nh4BiUJ+8CI%kA+1#yM7rvBmZn zWHKMdTp`vNKSa%a;(Cl#LwER%!?(xnGM=6AS)M4vn1(Z2C1eW1C)hp@uyWKDfXx7m z?Q;O5+yS&N0*v)pfVn}xnm)vH5B3YLw^0!%D>Uc`w&7geUgL89E&)EcC%q3oRE$$c z8pcH;lp6$mSw-3iXoI=(z;eS&xE9LcCrDqFhdDszbqfC9{t)LEthEq0FT&@7pf@}o zzZuv#Z(`iZ+j5K_!+0S-zJ~GVFz*=Pk2&DS0LO1#C(>;$F){U9)ON0-_Xd&!<*55>#V%I_X8I?KT+WAsLdOmaUXsKatLuZ&fmJR8*m?N_{gW! zJI;lHyG^c@CO+(j=irB#Klt2;aQx(J!M_T)5MMJ?@b8Dt_?r!4d6JX%ZJ@!tdlzVP z?#rZ!{5S|*x5EarZC+`=IL2-P+yh?7vu>{wgItGz>viBpfV&d7Zpb@q?=Pfr3*hyD zuLfM&@UH^K{poeUp0{DE0ecBB>gzEZ)&LlPv-3djUic#QPM*0Iad{pcGir=E%byxF z*8xYh$2f;`*8oQSDe1K9A>^ZOtG~xw&ss}o4`J>3_S!+feu_2d8^}Em^L+O(?E(J_ zqy0W`12*n7;HJsXWs0aoDMJzBde}2GVVJo$k#-wljQQ<7FM+uM&cz(13HH{BGnhLc zxfwY#$8~w{LVZtVPS^2lF#tIFG4|n0`0e+20Q7j4B|V|9vi3%v-+b^F(qKNI?GoUJ zw=-$}szs!!;vC7-ptkA0haGwIw*Jp2aaMm~BMan}YNFh9nv`O?Dqf33Cuzqr=l zjaqB7z1HecYuy7qQAgAj^-Nv;C+>B}XnFYv8$qAt&dFX~O#$piNsL zzO$5vwq!iA+LL*pNc+rQ z_jAwI(^=^C#69-B3xWTi=u>xU6L^3unniz&p@gn|68KMHk9)2RdrlGV5%Efs?-=Le z{7Qb6z@N-N|Cwv9$&RD#u&3g+Bws0TL3h%#z~xzjxTk>k9@f%e(^**K6xu%8S3fcY z{!e5axLM%x_e|zMzK5U$QaD%Bw=&pYQ#ru1e*t~#w@Tb^D9F>5(4z+ZFi&tT`juZC z@Kiz<)^nJpd7amXu$MyLYAT)8_Z-Btwmalu;E&yN2cGrC1;)U#nd)B?j zxldBw!aFp4U%?|*XFtIDz#FO>tB48|^1}D3_)ZnyU%O^xWMskY%dfa{&fIxd&A%GG zPf>)Ty4;>IMc%Q#asJ|x(!g2cCzPFi&bj3iF^Fr@c@^hhaG^GN%GAnf7hPO6{gN5g zHMKK?vo5`?9y`LqMT_gMU9z-(*>zu8zG7uV==xPRtiEy0O>4jUwQzGwB-*;6E%x<| z?H!%*#5eGM;ig+}+q~tQoSSE32DWk`TDrC*l6VJkQ=+jo-qjIKo(YR}FW4jj_5Tv`+S;K z(~44)_ZZE2Ejz8W0&~%bwqnI%?KD-+?&R#w=xy+rtJlrHVfCtIE0RFXw930JX+9c747t5JtN;uQc$LXxq{q zYk_V~GpFT6cFwbe<|>YP1r2E&^f@Icu(K%K9lc^Ubr6rlIyY$XRxPYei)hVTlF@Fh zIo28O+G4qMVS=+>8tsgBg_BWC>4Gfr4oe}iR?96DUGZCE5%{DPYptF0=FxAQ{=1s!XdYjPys_}kC=}22;GB57IogONI^q!_P(%M48Zosy+Sqzq zwDVTHdYl)7NSsr^=}yMGqUguE8=J$C#%8>;ypiL0Rk<>S6m2yTe}-OI$E0J@nj>CS0i+ijJ8F0CFDv4JYfszk)PuGPZ(dt5!m%%qXE}qf{A=7Wy%h+)FB*d?HE5>U;@xRKdoIUemso2o+Vwe{=Dcqb z2k(P#NVWmPNdtB$_+2EN41aFEZF|cpor}yw@XTxphdUZKTDichULGLr&Qz8&SN^gz(#0?u`i3I1t`=~{FpOf~A z)pZ);uRDsrc(?zwAHd_zz_VV#rxwV>C>@^Ovurat>2q1c2~r30Gu+QP##jC=#oE?& zjzywYwm(BZv_(7UG+N&Zu*y&i_n)DWBJ}Z%Ogj_@*fQ#9)fc=YZ&y| z4Q*QRQiO;Iy*l!(!cJI@_a}$(JsU6nWx;t*Jc17`aE2FdJOiGHn%|P)S&zVZUf>Wf zhS2ACN$mgW(~q*(2(sQJBzhJy35@S@L+!E`Ik`xE_O?|38!h zKdhH7UOZ2$!WVGUwaaU9xDX5RYlH|#!_6_FT!NavZb?oOGm!OcP-WkHgg_4&ge8^tSj11{Cp$Pp5%h~)}}TY-HgAj z=wK+$JS1utu3AxxeLb>S)JEGHTNy!l^u};kS9nVvz0m%83#fx~xFgnrRpX$Rr_$Wr zEs(1_I-;F`k!CoV?20vGJL5_Bzjo0t={@v@{P&h;et%c+Eczer%`Ck9caeF&1jxD= z1H2}q6z~#=hXe>zS|j;C1w2~w&+uKY%edh;n#WKWKfH*?at#W3Bp%}_g1~7)hw%k; z3x{#F1cfn0JjUNq5MtaFu0j)AofSL8W88cSLd(%EtV=ixzoBESvCVi}4xxf*JJ&^5 zd>sY%lGYr?>sH`t=ojcw2F5KdLcB#NjPD14$G9gRb4>wnE866h>oEU3g2@~&T*TwW z`;7u#K6ZgmfPE2 zIPT{yJm%-2FTr~XI9!+X_-22dNi{>keB662SlnS;=U5cng>76Nr#U|{PLKP15m53|Z zAMsBY!arRxZU^vq+p>2aN{+1rCU1iv3VXKS%09F!F)!~c(B{qY02?=oY)ug@n2R^Z zvzIs-m<6Rp>;d2yZqCbo3;wPH{yOyWK7%%I_UCx?0pEwYc~=9@JJ)xo9&1GNuP%;v zi*Qp1?60%E z)$?M>OF#X`$@kp-$XoNa_SgO0`_<^h(Y`cIW z6t`m|%iP6rxr=k;F6u5n*D#fw!)a=dK;30(vpN#@C=;v@b;`(VH111`TISD~Y@IUl zx-3(O%d=%MO4>Sijm=g{asZT9XY1FXRI_y!<8Y79wkKpu786Z%RyPmq-B7XQmXBwD zI{4h<&+aZ6_v?bse)_#nE^!wA>>t+zR~1dZYDdWp$3D5_&YwNuKJtF=@fqXNg$0K` zeR%ZWJ-%V^d{@ygrmVU2!QVZ$VZ-)l;kVx#U3kwQc9$pYnn02Yy(%DPHQn z_tBdRy^H%c-16fYBd>pE<4EiD2R@tqoxK|l{H3ih|EV{=_G#IQ=X=*~969d#ckUR* zp16$8k-b!uqfKqm~RX2MPNF#L9=bOXbNG{ zu!v-^o3i3y>YNM|xGsv(vAWhks7*ZB9*PA;v@IuidoTz_R=0-RvRHLu!J>t8=haQC zm_AhF5{1k1Klo?;N?hhzt~@kdE;n8t3L$k`#Uua;D>B*^F*R%7kE$%kvyM^nR8|yic=Kg?NS~7L?~$VnIu?M1nuY z5{da0mI(3_ERjr3vVHPx$3b&siDYO1TIdaCrtJIrg|^x*kx%0bIRX!oLroS`#RkVt(x#BQWmdQ zQzD6!EuKgTZ;!shW7P)6TQ$W4xa!sN-HBA5NTl3fw`vxjSNp}_;5kJ^G`POA88qR7 z&Nh^A8D|qpxUf?Z3GF9#0XIo#KSrr|5}M7kMgQaA;918E&{h+gL*1fVFo*E$)`eK6 zxjb7geH;A({RZ5EED!X3zBD#`huvtqbK}4R z+}v5DlI~Isq3pC}=RkNme{ai-LkJx%a$_9E7L!-dLYN z5~(*JTc!JeUTKB=!mCXOT@5f5u%aw%8er6c3$P283|={4zXxo;2eH+k(1e68-F>G= zs^CdQ{E2eiojic~%XODHpu0Q=^lFS*k9$jnA{t?hQj|r27pVtytLI^9QFj}BUOhNf znGM?Krzm0%QeX+jmjKV|@yk5e1pT|*XwyE#9WyvJ#XM=n&1)j?C%O;lirX*ej83Eu zUeh68boZx-`(@)emX{kjq}U6(o>K;Gcl=24zk^@;iSQiL(LUn>F6j$TuYqHSJ&Lou z(2k^W1Nd=!kDPf6GQ{wV!E1`}rX%8mKi0wz_TOsR4L{y3#OwQz;X1)rN*Hs*b(<%t zvu#Vhu17#iBwx}+a<^_3D>c`D9N5(v?Ai^Dal3Y4N1w2(EkuoOy@z%(ixT;)cCv!!OR8{NfgoF#KYGJ|K6)m*bK?p@{pm>Cgc- zC^IdndxRKEy;%H-R4H}iJE@<4-=gIiwuq-E9o>MnN={Gvy9xO;Us+Cuc` zHGnw)b9;az`t)^0PR$YN)9=50G4f2W{s)<_x#NAhdU~#A^Y!UgeC@kT%B4Ay zUz0};F4BazPyfjaLbIzbx#4HEn&R%1cTXRo<+(fLud0>+Z@jdruvKyg{5g?Y;oqp+ z(LR5oTaMXlgFpA`p8dCL`RaIS^=y$Y)gpzbQ!3pB25f#$t+rBh>2_}-WmPxIH`f(l zEu19d>*s3@-!8;_5A>Z#mH2w}pIlz375RJg>MLusO2~Fy6ZmxZ>6=$qYxURdkfUUW zeE#y0SU;_DcQM=^Lfr*P-uR zX45S0GP(Zl+qG)UWpyjkt3WSO7!T>4ly>+oiKVktzdT#J629N$k?82g>h=Zv$<} z4*J-|n)I$-pSGx*(~#uTjjd=cD>Tqr%&wNW$^5Y zL+{Mvn+r0{ji%HAH`BFdz<7e0)It}4=_7xZqCd2#5#uS&bv zWazI8{CU7bPWLwNW<&SXx69ilw}1~DbYAIx#NeO)ME)#trxfZ0xx)`R;J>unDCpcP zyVJ8Equ1Y~SNR{&tG#`O{>it^y9xSKWG}{Kc<++4ypQNl-s3WS@aJD&V)&a4cJN`G zwt1tp!7dKUDmpXzM~rpkjnZ7u?Lo(4EpRFH{@Jx`dWT#w?@#kObz?@s< zs$K=TqDxNQyI6C1$H`fqKHcH9NyR%+S|FoK_ULz>wQHyE*dg!xBjR2yL);)9A(sm= zx~x*s9FVtqnpYboH_9TlPj7p-OWJ)KA@fA3xZ!`mwE_2)dkc{dHp z0lx?DF7S>gOZnRcLaXlY(WlQ_r1=Xv<-~r(o16gN5I2y*Dk}{B6!%WK`8}akLQij; zuGIpUF@98OQMXE~&kmoN1R3D(YPWoExuVfl-?*zs6(GRV{pPryQTkGx+IyZ@yOGn;@%? zkJ2oNyXTMHu6fixJ$PRi^2SDKM=qcZnP+A}K5b?gH(mrCW^{(0@^Yb!>wC!_Svst?rc77K>I1dXsInz};-z3Dzsn%S+QdxpnVVgOm zzO++1!2kd1v}hKL-?RO8%?27pKF~Nuzmh2-y5$U?lX9kZudIdN;n@K8J-X1YF>dd@ zZN6sdm8ri!@6!AucSzRDDFt#brjY|t5N0*$r>JEeF zXXlOtUpwXRZl4R^fXs4d%4Ou3ow7>8_TbU#*(rBv*mJ0za?`mb*t>vVPbZ$UCV<~g zSqvW`kMt3NJ`4I3^cibCa<``+It6bE`kV>mG4#{!0{aQB1J#K>o%*x%%Tz%xVEx;% zu1|r@v6j2H%QEzn56;WA`-{2hXPwfEe$Fp?Why_i4eRyR6xVA7y3g<3Dkp-!cOSw0 zahb~VcglkJ7U&vlm%#cAJ97Q-kHngtlqtIpG9-84nW-B-RVEpeCB8nrKC4x6Zzxl+b&C0*M&({;oGgI9az8o>KEQb7UX=T*)TNlGA8Wa1vmt+t zihZny`&_Pnak(e49eZ5t#Q>}MY;deW591sv)^E~A=|Jg5=|)+EawX3!9zJsBfl9lk z9JOfEJae?IS30#KJQsalHWD$G&~Ez`_MFMM{@OLLqdTr2E?ua()j0Oxd|u8xKk*Dn zc(E75zSiQyzL)z0@HA@LQO(L{5Kk9y_vo<0#@WK1{@$(dfk>Cd2KY!kD|q96oIl0W z4zVT-JjZheM#B&Yl6Yo9X@i|}df_L!!kXu6LJ$P2J zriI!?y{4}KU&Zd1bg$Zw&c`{nP1z@$ z#(oB87J3yE6?gvfI zB|I;~?tAnJmC!TlhdrmD>zDNrI5)APbP+#W6334E^T5eNSqPkbly2ZSvL$f}Q2(dv zPoj6!)ia0*dIyhqOb8akvt$Q$+XFMl39NBMKQ-wzph zR#*ktPoaAc^xcT(H0oQ$n33rFmIY^RUSE0~&f2=BTJT%~*>KM2MZYR~(*2;>e~rbc zD{im$BHBEgn*iT=26Yv*N5a-OSTl5RM19x}x<`ozx;WB4{E#SuFN(3ttKWG?c=zDh zIx$9g8`GSheEb8(QqPTu2@jrgJ(#b#5YOV6Pr=!o547kzguh~f-wrtEdIIISZ2!}y z{<(nbS-3R8X914$EyMplnu@uoldRm-4P&SjvQq~U;JVyajcxMNfwsVz1%7XGZetxX zF38FVSVl&iR|>BjgL8$kl+S^&YF5uvfGhlX23D;X>6-NK0zK+FH&+wsL)VpEOA?0jm<= zM}_Qwe*_rqksGrC{f0fz_a6Fi=6iOyEz^Vn&#({hG~m%TbHE$VHF(x)*Z_TRp)Um( z&nk1g{0^|+0OmH~{TpB>0ISCD7%OnwaHdQh@OKWLNxNXTBy7X{N81SG;C|?p=Y|QK zo9E8VUEt#aXi=sCl#GKD6RcXb$?klfr9aZ<9|DJU1@*U4r;SI@ZpeA`b&n@uz21`; z)9-mLWdT3LCv7Y3AQGUP@#E80@Bn$A$@X7>EX>!-PXjK!S}Epti{yWbIGziWJ?TR6 z{267$Yws0`LuYKh9^}05o`G!Ic;qN6VE?3^z&dt9w-sSOtY&0((J#GSY4S-wHQLa{ zR`TulrK^Bz&*IvA-D&*v<$Q>Jk<9N1$5B_rJv=`eYk}XwwqtFeX{-T|e+7LFGL=Fm zp0PKNfemb!N6o|oU#{sHt50S;v) zp4-ba7Oz%>vKV&>?z=b+u`mLB!q3l^Kwpj|`cc|Y7NHa_d)Ps2}mPBr;|btldUCy13}kYAi5Q7@egexNg)QKc;^@(=joIQaM2aanxi zj>j~%=`Fiwn&LMD?0Xb_R2mRlNIZ6P#7JWRU zVjs`6-GEO-TLm0)81N@KM%=AEg_7$-1^UW>kKbFIC&nDW?=Km@Wq$aN3mk_t6v#3a zzQFngz=~0p0CpWtii;SFk7L|(fUhvo{W0K&0p~utG-TCE;;^yb zi!%f0*1H$_U9Mr1;yigNVifb!fBG;+Bz);>0Vj-dy+RoL`98>$hCW2xmoELG_4}5D z_xlAxJXsGP7vf%R4acaDA|Bec4%B~yaW>DRdI9#bHqSP_bfHxnaTT6Hyk4vgcxF|x zXTu!dCH?-4&m1THUSE1*UPk^igM&|=8I9j^vh8)ih0f3BcsrQo4d?C1d3*Jhmth>_ zSOd5dHhk)H@Zg55Dt`w^q`pmj*bQg$hw)n&_PUvQ@iUhJ|GGiv8=3|DyP!AzeuWqw zYo@&%G?;Jqfi`LOlcqPJ^+4BE;PoSuZ5E;LKEUnZg*?yB&J%)MF5p&~>@^3tOMv?k z;%$csely@TfS(5Ztt|W|z_>1*1k9h+&Gmr&8nEX8%jv5OF#djMhu(3Xou=N&Gv^|% zO~oEh?a}kl?}{5|-a|N5z_DbkdI@^t}M;MZn*X#kBx80oV@Yl0$1TL2$Va|01KfK@64nytmPleu zKJ4LwukX)}{qPggl!gzNFn+Oj5Xc`MPexrxDX4?1fJ0xP4psn%c|j0{__)dNsf@2_`|E|(lc-yztbAF!NHQLm2y&b{e=z;pgb z_#=SR2jhU7eg0vvgPk5Ia z>mm7Y!e2;(xq!A?LVjR-KHDmIF9Oe~PT^fHc`pAE)@rWBr1K#0@SBqjx#)ew+(1^R zi;eNp!1;g8wf1kEYvr)HM1Cd@Pa8JZe&~rhqOQ3Aq^>^3^KG7*kZbzr z{aL*XP%nPOBxtxvKk|hw8BaEEk3NO-A*QhRIlL6>D1M(qEZ1mbvT`5?I4iTfjR1@` zp*}em?a3UFuYO^#$GBd56DjERtePG7*~f$D{u6EL&f*6TkmYm0xZhBGx4i`XqgdaL z7h%20$8%vJ?d1NGzJlYikEQ>e0=^CJnT(+Au%5b576KP^$NGTBeFX821MdUQ4VxB% z&-17|X=0Cm>6OZ!CV!Zy%%dSC%`4n5cS@y^8@cpX@Me2aFZ9l-^F*k_#WM@gM)*! zD{s7Mdew}XH_y5St1CG}Ux7|sW3Mc^>gsFM zapNaUoOJEiN+(}8rL4SSs^|J?H(>85=FFW}ecSv6H4AUQW6|OzwZ1!-E?a)r-S@2c z`Zogg4UNI3)y<*%*R-^@g(Kg@dyZ=#cyQhNZ*gpfjVV~hg=lDBABo{z$hDEWrf_>} zAa*e<6kW7-P4r@z@jB(bw=G>-yL6R0DLPYa4>p7!2)3(hg6m;(GflPpn`(Kp8f^|t zyYVKqyiqMzTR?BVF%!lL@gVTcw2YTELB$L+-iFLlH^VdUQ#wsDs2P3@%0jdco@f` zXW{0;c&!tFSo_*&tSQ*m5G;>{!!2T3g{ORV<&643QxMxmM9fgX+7NDS4YW0?cr8Du z5?O_XRK829M%PDUc!gC39oi4?tX4SZg(K_RL#vx(r45tS>d@+ty09%4Y;QAOX$`cX z)llJd-W_a@0(~Zgb~^8h237}IRqy3nwc)ntD)ru35xj;9$-`~sjll;(4Z&O0S*?Lc zB-mKq7HAFLy2|NP)$%6XW!Hr?F85n6_3+=~EfgN7}(icx`kt#_}pJZw|IZGWDUqKE5QZ8XeRc-yC*2 zzeE`Iwv5uiSEPA;G}Hjy3^Au>L^h8zgyt-!aXAgC>~xwX$gwjw5Dnf`Ngae6Lv5?o zaFZHPCpD_|>tn&FS|4f)w68Z@Iyb;vE(o>-+XJy6hO|SLaI2w^P?O=7k@oNdp+@+m z5o=9tGiTCo%>KJNH#{4V=Dw`Sh6E-NbH5QErrr#`5E)|$LH%+*I49n+4%T6c)^MW` zD53w=br>2A)-^pCYT2iJF89?fo-=P!<6p~)IN;oq)|vI7F2x(*MvSoUE9oskUoh4%wduh+$Xn46Zfgpy zHq)7@&JQ478xg*l%wxMrrzM)Y`^SS_QNir zrcki`uW;%!zDXRsm%cjI3=A_3*dgb4je%I;uf}I>Z#boSlBo!usSSZZYuy?nmzilA zewE`o7iG|`87G^~RO1DDXdh`;7&Kcm-!GYQbM)wRCUO_i`$G4W2t<(5o5D`9Y)vQ< z;W&67wMg$X(_Xy1T1EUtgZPVY42Jvw9(NI*@hJecKqiLiaA?iSn#oL`(;`lgI*^~? ze&#-YdSECvYh80+W6;R<7wLz#XaSu%k?4=;A$5a9}x z{H6`(JOcZ99vp}W+WbC>?LU1!7~Z2O!jAeeyCU*XHd+;K9>ok09Dx$&n*zU07?%}) z{dj+#Yp)yq*ozw9Y~kEoJf5!@^$jTb-HD1D`(@$4jonsw5#ZQVg~{gt%Fpvy`=4F> z{w{Yt13CYHxO4olTrh9mOtlnW;!Rd>tia|%%&7!45De6ZgmN9K_UYwwM4mH$jzcN1 zIIS+_65AN1NV!zG+*+($p^UYZDB~4T5pBljDX~DksKBZkY>$WvY>9#ubLK8Aj|Em| zTdUjFR@AQz;nTrTqo`o3IS_3Y6^-lLqU&2TCBCmQda#&t<8e`=4t?#x7UE|rk(L-I z#5X?`vEVxVZ9)TGVdf!GF=y%G3asmm>qJGcxvq&3ltHfxw6_P=XV7!?`x`(Vlmo4y z2Fw};wG5T|XjC9qx3&h`03*#nEY=>X$8yGhRk=L7k>ws^DO!wp3Mxr z%=eiYzXZs*7z4b<;m+Yj5DyU$m}vB5{^amz&5z-`oR@LKZ$(eyX8iCX9&eoE7_mb< z##18#$Bzc%3+M(8<7z%`#uV`wf5$+GahJPtRV;Nz>=2J}^En7DLOnMx;k@}RA7hPm z#@iwYfVa(FR_G^Jl(C&d_5%<(0!bh~U~&iKpl{u%vvo;UEApCey^cN93Bm-P6ZK-86{u>AiS-k)N diff --git a/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb b/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb index 885203ae6..ad6b63fcb 100644 --- a/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb +++ b/meta-digi-dey/recipes-core/trustfence/trustfence-tool_2.0.bb @@ -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 From e7a21cdad0dcc1ddb57ae6c80ee298a9ff1839f7 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 30 Nov 2016 12:01:04 +0100 Subject: [PATCH 05/84] ccimx6ul: suspend: unload wireless module always before suspending The suspend script was unloading the wireless module driver *only* if the interface 'wlan0' was previously up. If the interface is down the module does not unload and the system fails to suspend. This patch removes the module always if it appears in the list of loaded modules. While on it, move the unloading of wireless after the unloading of Bluetooth, to be in line with the reversed order in which they are loaded on the resume_interfaces() call. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-3241 --- .../recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend index a87cdcd65..597b441c2 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend @@ -26,12 +26,15 @@ usage() { } suspend_interfaces() { - if grep -qs '^wlan0' /var/run/ifstate; then - ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod wlan - fi if hcitool -i hci0 dev >/dev/null 2>&1; then hciconfig hci0 down && up_hci0_on_resume="1" && sleep 0.5 fi + if grep -qs '^wlan0' /var/run/ifstate; then + ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 + fi + if grep -qs '^wlan' /proc/modules; then + rmmod wlan + fi } resume_interfaces() { From 368d1ebe56649706773f191a9b997f92df28c7b2 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 30 Nov 2016 12:15:08 +0100 Subject: [PATCH 06/84] ccimx6ul: suspend: do not load the wireless module on resume The loading of the wireless module without proper arguments does nothing. Besides, if the interface was down before going to suspend, there is no need for the wireless module to be loaded. The wireless module will be loaded nevertheless (with proper arguments) when the interface is brought up. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-3241 --- .../recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend index 597b441c2..c13b3502c 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend @@ -39,7 +39,7 @@ suspend_interfaces() { 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 } From 41e320954943079d67fd968f13d40b1df6e700fa Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 30 Nov 2016 13:17:46 +0100 Subject: [PATCH 07/84] ccimx6ul: suspend: remove delays Remove preventive delays during the removal of Bluetooth and Wireless interfaces. Tests revealed they are not needed. Signed-off-by: Hector Palacios --- .../recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend index c13b3502c..d0f16dfa9 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend @@ -27,10 +27,10 @@ usage() { suspend_interfaces() { if hcitool -i hci0 dev >/dev/null 2>&1; then - hciconfig hci0 down && up_hci0_on_resume="1" && sleep 0.5 + hciconfig hci0 down && up_hci0_on_resume="1" fi if grep -qs '^wlan0' /var/run/ifstate; then - ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 + ifdown wlan0 && up_wlan_on_resume="1" fi if grep -qs '^wlan' /proc/modules; then rmmod wlan From cf3f88f03c016f0c3fece3b1d9ec42e69896acad Mon Sep 17 00:00:00 2001 From: Pedro Perez de Heredia Date: Mon, 28 Nov 2016 18:45:20 +0100 Subject: [PATCH 08/84] dey-examples: add adc_sample application for ccimx6ul https://jira.digi.com/browse/DEL-3218 Signed-off-by: Pedro Perez de Heredia --- .../dey-examples/dey-examples-adc.bb | 16 + .../dey-examples/files/adc_sample/Makefile | 11 + .../files/adc_sample/adc_sample.c | 337 +++++++++ .../dey-examples/files/adc_sample/iio_utils.c | 669 ++++++++++++++++++ .../dey-examples/files/adc_sample/iio_utils.h | 71 ++ .../packagegroup-dey-examples.bb | 1 + 6 files changed, 1105 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc.bb create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/Makefile create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.h diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc.bb new file mode 100644 index 000000000..4067bdbac --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-adc.bb @@ -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)" diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/Makefile new file mode 100644 index 000000000..c4193844b --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/Makefile @@ -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 diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c new file mode 100644 index 000000000..a0dbfef07 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/adc_sample.c @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include + +#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; +} diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.c new file mode 100644 index 000000000..6f6452167 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.c @@ -0,0 +1,669 @@ +/* IIO - useful set of util functionality + * + * Copyright (c) 2008 Jonathan Cameron + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ +#ifndef _IIO_UTILS_H +#define _IIO_UTILS_H + +#include +#include +#include +#include +#include +#include +#include +#include "iio_utils.h" + +const char *iio_dir = "/sys/bus/iio/devices/"; + +static char * const iio_direction[] = { + "in", + "out", +}; + +/** + * iioutils_break_up_name() - extract generic name from full channel name + * @full_name: the full channel name + * @generic_name: the output generic channel name + **/ +int iioutils_break_up_name(const char *full_name, + char **generic_name) +{ + char *current; + char *w, *r; + char *working, *prefix = ""; + int i; + + for (i = 0; i < sizeof(iio_direction) / sizeof(iio_direction[0]); i++) + if (!strncmp(full_name, iio_direction[i], + strlen(iio_direction[i]))) { + prefix = iio_direction[i]; + break; + } + + current = strdup(full_name + strlen(prefix) + 1); + working = strtok(current, "_\0"); + + w = working; + r = working; + + while (*r != '\0') { + if (!isdigit(*r)) { + *w = *r; + w++; + } + r++; + } + *w = '\0'; + asprintf(generic_name, "%s_%s", prefix, working); + free(current); + + return 0; +} + +/** + * iioutils_get_type() - find and process _type attribute data + * @is_signed: output whether channel is signed + * @bytes: output how many bytes the channel storage occupies + * @mask: output a bit mask for the raw data + * @be: big endian + * @device_dir: the iio device directory + * @name: the channel name + * @generic_name: the channel type name + **/ +int iioutils_get_type(unsigned *is_signed, + unsigned *bytes, + unsigned *bits_used, + unsigned *shift, + uint64_t *mask, + unsigned *be, + const char *device_dir, + const char *name, + const char *generic_name) +{ + FILE *sysfsfp; + int ret; + DIR *dp; + char *scan_el_dir, *builtname, *builtname_generic, *filename = 0; + char signchar, endianchar; + unsigned padint; + const struct dirent *ent; + + ret = asprintf(&scan_el_dir, FORMAT_SCAN_ELEMENTS_DIR, device_dir); + if (ret < 0) { + ret = -ENOMEM; + goto error_ret; + } + ret = asprintf(&builtname, FORMAT_TYPE_FILE, name); + if (ret < 0) { + ret = -ENOMEM; + goto error_free_scan_el_dir; + } + ret = asprintf(&builtname_generic, FORMAT_TYPE_FILE, generic_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_free_builtname; + } + + dp = opendir(scan_el_dir); + if (dp == NULL) { + ret = -errno; + goto error_free_builtname_generic; + } + while (ent = readdir(dp), ent != NULL) + /* + * Do we allow devices to override a generic name with + * a specific one? + */ + if ((strcmp(builtname, ent->d_name) == 0) || + (strcmp(builtname_generic, ent->d_name) == 0)) { + ret = asprintf(&filename, + "%s/%s", scan_el_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_closedir; + } + sysfsfp = fopen(filename, "r"); + if (sysfsfp == NULL) { + printf("failed to open %s\n", filename); + ret = -errno; + goto error_free_filename; + } + + ret = fscanf(sysfsfp, + "%ce:%c%u/%u>>%u", + &endianchar, + &signchar, + bits_used, + &padint, shift); + if (ret < 0) { + printf("failed to pass scan type description\n"); + ret = -errno; + goto error_close_sysfsfp; + } + *be = (endianchar == 'b'); + *bytes = padint / 8; + if (*bits_used == 64) + *mask = ~0; + else + *mask = (1 << *bits_used) - 1; + if (signchar == 's') + *is_signed = 1; + else + *is_signed = 0; + fclose(sysfsfp); + free(filename); + + filename = 0; + sysfsfp = 0; + } +error_close_sysfsfp: + if (sysfsfp) + fclose(sysfsfp); +error_free_filename: + if (filename) + free(filename); +error_closedir: + closedir(dp); +error_free_builtname_generic: + free(builtname_generic); +error_free_builtname: + free(builtname); +error_free_scan_el_dir: + free(scan_el_dir); +error_ret: + return ret; +} + +int iioutils_get_param_float(float *output, + const char *param_name, + const char *device_dir, + const char *name, + const char *generic_name) +{ + FILE *sysfsfp; + int ret; + DIR *dp; + char *builtname, *builtname_generic; + char *filename = NULL; + const struct dirent *ent; + + ret = asprintf(&builtname, "%s_%s", name, param_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_ret; + } + ret = asprintf(&builtname_generic, + "%s_%s", generic_name, param_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_free_builtname; + } + dp = opendir(device_dir); + if (dp == NULL) { + ret = -errno; + goto error_free_builtname_generic; + } + while (ent = readdir(dp), ent != NULL) + if ((strcmp(builtname, ent->d_name) == 0) || + (strcmp(builtname_generic, ent->d_name) == 0)) { + ret = asprintf(&filename, + "%s/%s", device_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_closedir; + } + sysfsfp = fopen(filename, "r"); + if (!sysfsfp) { + ret = -errno; + goto error_free_filename; + } + fscanf(sysfsfp, "%f", output); + break; + } +error_free_filename: + if (filename) + free(filename); +error_closedir: + closedir(dp); +error_free_builtname_generic: + free(builtname_generic); +error_free_builtname: + free(builtname); +error_ret: + return ret; +} + +/** + * bsort_channel_array_by_index() - reorder so that the array is in index order + * + **/ + +void bsort_channel_array_by_index(struct iio_channel_info **ci_array, + int cnt) +{ + + struct iio_channel_info temp; + int x, y; + + for (x = 0; x < cnt; x++) + for (y = 0; y < (cnt - 1); y++) + if ((*ci_array)[y].index > (*ci_array)[y+1].index) { + temp = (*ci_array)[y + 1]; + (*ci_array)[y + 1] = (*ci_array)[y]; + (*ci_array)[y] = temp; + } +} + +/** + * build_channel_array() - function to figure out what channels are present + * @device_dir: the IIO device directory in sysfs + * @ + **/ +int build_channel_array(const char *device_dir, + struct iio_channel_info **ci_array, + int *counter) +{ + DIR *dp; + FILE *sysfsfp; + int count, i; + struct iio_channel_info *current; + int ret; + const struct dirent *ent; + char *scan_el_dir; + char *filename; + + *counter = 0; + ret = asprintf(&scan_el_dir, FORMAT_SCAN_ELEMENTS_DIR, device_dir); + if (ret < 0) { + ret = -ENOMEM; + goto error_ret; + } + dp = opendir(scan_el_dir); + if (dp == NULL) { + ret = -errno; + goto error_free_name; + } + while (ent = readdir(dp), ent != NULL) + if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), + "_en") == 0) { + ret = asprintf(&filename, + "%s/%s", scan_el_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + goto error_close_dir; + } + sysfsfp = fopen(filename, "r"); + if (sysfsfp == NULL) { + ret = -errno; + free(filename); + goto error_close_dir; + } + fscanf(sysfsfp, "%i", &ret); + if (ret == 1) + (*counter)++; + fclose(sysfsfp); + free(filename); + } + *ci_array = malloc(sizeof(**ci_array) * (*counter)); + if (*ci_array == NULL) { + ret = -ENOMEM; + goto error_close_dir; + } + seekdir(dp, 0); + count = 0; + while (ent = readdir(dp), ent != NULL) { + if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), + "_en") == 0) { + int current_enabled = 0; + + current = &(*ci_array)[count++]; + ret = asprintf(&filename, + "%s/%s", scan_el_dir, ent->d_name); + if (ret < 0) { + ret = -ENOMEM; + /* decrement count to avoid freeing name */ + count--; + goto error_cleanup_array; + } + sysfsfp = fopen(filename, "r"); + if (sysfsfp == NULL) { + free(filename); + ret = -errno; + goto error_cleanup_array; + } + fscanf(sysfsfp, "%i", ¤t_enabled); + fclose(sysfsfp); + + if (!current_enabled) { + free(filename); + count--; + continue; + } + + current->scale = 1.0; + current->offset = 0; + current->name = strndup(ent->d_name, + strlen(ent->d_name) - + strlen("_en")); + if (current->name == NULL) { + free(filename); + ret = -ENOMEM; + goto error_cleanup_array; + } + /* Get the generic and specific name elements */ + ret = iioutils_break_up_name(current->name, + ¤t->generic_name); + if (ret) { + free(filename); + goto error_cleanup_array; + } + ret = asprintf(&filename, + "%s/%s_index", + scan_el_dir, + current->name); + if (ret < 0) { + free(filename); + ret = -ENOMEM; + goto error_cleanup_array; + } + sysfsfp = fopen(filename, "r"); + fscanf(sysfsfp, "%u", ¤t->index); + fclose(sysfsfp); + free(filename); + /* Find the scale */ + ret = iioutils_get_param_float(¤t->scale, + "scale", + device_dir, + current->name, + current->generic_name); + if (ret < 0) + goto error_cleanup_array; + ret = iioutils_get_param_float(¤t->offset, + "offset", + device_dir, + current->name, + current->generic_name); + if (ret < 0) + goto error_cleanup_array; + ret = iioutils_get_type(¤t->is_signed, + ¤t->bytes, + ¤t->bits_used, + ¤t->shift, + ¤t->mask, + ¤t->be, + device_dir, + current->name, + current->generic_name); + } + } + + closedir(dp); + /* reorder so that the array is in index order */ + bsort_channel_array_by_index(ci_array, *counter); + + return 0; + +error_cleanup_array: + for (i = count - 1; i >= 0; i--) + free((*ci_array)[i].name); + free(*ci_array); +error_close_dir: + closedir(dp); +error_free_name: + free(scan_el_dir); +error_ret: + return ret; +} + +/** + * find_type_by_name() - function to match top level types by name + * @name: top level type instance name + * @type: the type of top level instance being sort + * + * Typical types this is used for are device and trigger. + **/ +int find_type_by_name(const char *name, const char *type) +{ + const struct dirent *ent; + int number, numstrlen; + + FILE *nameFile; + DIR *dp; + char thisname[IIO_MAX_NAME_LENGTH]; + char *filename; + + dp = opendir(iio_dir); + if (dp == NULL) { + printf("No industrialio devices available\n"); + return -ENODEV; + } + + while (ent = readdir(dp), ent != NULL) { + if (strcmp(ent->d_name, ".") != 0 && + strcmp(ent->d_name, "..") != 0 && + strlen(ent->d_name) > strlen(type) && + strncmp(ent->d_name, type, strlen(type)) == 0) { + numstrlen = sscanf(ent->d_name + strlen(type), + "%d", + &number); + /* verify the next character is not a colon */ + if (strncmp(ent->d_name + strlen(type) + numstrlen, + ":", + 1) != 0) { + filename = malloc(strlen(iio_dir) + + strlen(type) + + numstrlen + + 6); + if (filename == NULL) { + closedir(dp); + return -ENOMEM; + } + sprintf(filename, "%s%s%d/name", + iio_dir, + type, + number); + nameFile = fopen(filename, "r"); + if (!nameFile) { + free(filename); + continue; + } + free(filename); + fscanf(nameFile, "%s", thisname); + fclose(nameFile); + if (strcmp(name, thisname) == 0) { + closedir(dp); + return number; + } + } + } + } + closedir(dp); + return -ENODEV; +} + +int _write_sysfs_int(char *filename, char *basedir, int val, int verify) +{ + int ret = 0; + FILE *sysfsfp; + int test; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) + return -ENOMEM; + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "w"); + if (sysfsfp == NULL) { + printf("failed to open %s\n", temp); + ret = -errno; + goto error_free; + } + fprintf(sysfsfp, "%d", val); + fclose(sysfsfp); + if (verify) { + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + printf("failed to open %s\n", temp); + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%d", &test); + fclose(sysfsfp); + if (test != val) { + printf("Possible failure in int write %d to %s%s\n", + val, + basedir, + filename); + ret = -1; + } + } +error_free: + free(temp); + return ret; +} + +int write_sysfs_int(char *filename, char *basedir, int val) +{ + return _write_sysfs_int(filename, basedir, val, 0); +} + +int write_sysfs_int_and_verify(char *filename, char *basedir, int val) +{ + return _write_sysfs_int(filename, basedir, val, 1); +} + +int _write_sysfs_string(char *filename, char *basedir, char *val, int verify) +{ + int ret = 0; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed\n"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "w"); + if (sysfsfp == NULL) { + printf("Could not open %s\n", temp); + ret = -errno; + goto error_free; + } + fprintf(sysfsfp, "%s", val); + fclose(sysfsfp); + if (verify) { + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + printf("could not open file to verify\n"); + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%s", temp); + fclose(sysfsfp); + if (strcmp(temp, val) != 0) { + printf("Possible failure in string write of %s " + "Should be %s " + "written to %s\%s\n", + temp, + val, + basedir, + filename); + ret = -1; + } + } +error_free: + free(temp); + + return ret; +} + +/** + * write_sysfs_string_and_verify() - string write, readback and verify + * @filename: name of file to write to + * @basedir: the sysfs directory in which the file is to be found + * @val: the string to write + **/ +int write_sysfs_string_and_verify(char *filename, char *basedir, char *val) +{ + return _write_sysfs_string(filename, basedir, val, 1); +} + +int write_sysfs_string(char *filename, char *basedir, char *val) +{ + return _write_sysfs_string(filename, basedir, val, 0); +} + +int read_sysfs_posint(char *filename, char *basedir) +{ + int ret; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%d\n", &ret); + fclose(sysfsfp); +error_free: + free(temp); + return ret; +} + +int read_sysfs_float(char *filename, char *basedir, float *val) +{ + int ret = 0; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%f\n", val); + fclose(sysfsfp); +error_free: + free(temp); + return ret; +} + +int read_sysfs_string(const char *filename, const char *basedir, char *str) +{ + int ret = 0; + FILE *sysfsfp; + char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + + if (temp == NULL) { + printf("Memory allocation failed"); + return -ENOMEM; + } + sprintf(temp, "%s/%s", basedir, filename); + sysfsfp = fopen(temp, "r"); + if (sysfsfp == NULL) { + ret = -errno; + goto error_free; + } + fscanf(sysfsfp, "%s\n", str); + fclose(sysfsfp); +error_free: + free(temp); + return ret; +} + +#endif /* _IIO_UTILS_H */ diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.h b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.h new file mode 100644 index 000000000..1bc837b2d --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_sample/iio_utils.h @@ -0,0 +1,71 @@ +#ifndef _IIO_UTILS_H_ +#define _IIO_UTILS_H_ + +/* IIO - useful set of util functionality + * + * Copyright (c) 2008 Jonathan Cameron + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include + +/* Made up value to limit allocation sizes */ +#define IIO_MAX_NAME_LENGTH 30 + +#define FORMAT_SCAN_ELEMENTS_DIR "%s/scan_elements" +#define FORMAT_TYPE_FILE "%s_type" + +extern const char *iio_dir; + +/** + * struct iio_channel_info - information about a given channel + * @name: channel name + * @generic_name: general name for channel type + * @scale: scale factor to be applied for conversion to si units + * @offset: offset to be applied for conversion to si units + * @index: the channel index in the buffer output + * @bytes: number of bytes occupied in buffer output + * @mask: a bit mask for the raw output + * @is_signed: is the raw value stored signed + * @enabled: is this channel enabled + **/ +struct iio_channel_info { + char *name; + char *generic_name; + float scale; + float offset; + unsigned index; + unsigned bytes; + unsigned bits_used; + unsigned shift; + uint64_t mask; + unsigned be; + unsigned is_signed; + unsigned location; +}; + +int iioutils_break_up_name(const char *full_name, char **generic_name); +int iioutils_get_type(unsigned *is_signed, unsigned *bytes, + unsigned *bits_used, unsigned *shift, + uint64_t *mask, unsigned *be, + const char *device_dir, const char *name, + const char *generic_name); +int iioutils_get_param_float(float *output, const char *param_name, + const char *device_dir, const char *name, + const char *generic_name); +void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt); +int build_channel_array(const char *device_dir, + struct iio_channel_info **ci_array, int *counter); +int find_type_by_name(const char *name, const char *type); +int write_sysfs_int(char *filename, char *basedir, int val); +int write_sysfs_int_and_verify(char *filename, char *basedir, int val); +int write_sysfs_string_and_verify(char *filename, char *basedir, char *val); +int write_sysfs_string(char *filename, char *basedir, char *val); +int read_sysfs_posint(char *filename, char *basedir); +int read_sysfs_float(char *filename, char *basedir, float *val); +int read_sysfs_string(const char *filename, const char *basedir, char *str); + +#endif /* _IIO_UTILS_H_ */ diff --git a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb index 51e45b619..c7147fb14 100644 --- a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb +++ b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb @@ -38,6 +38,7 @@ 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 \ ${@bb.utils.contains("MACHINE_FEATURES", "bluetooth", "dey-examples-hdp", "", d)} \ dey-examples-tamper \ From 3016520e4fcfecad06f87f1783c1bc21011fda98 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 2 Dec 2016 16:37:31 +0100 Subject: [PATCH 09/84] meta-digi-arm: kernel-module-qualcomm: Update to v4.2.79.63 This brings several upstream bugfixes. https://jira.digi.com/browse/DEL-2573 Signed-off-by: Alex Gonzalez --- .../kernel-module-qualcomm/kernel-module-qualcomm.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index 17a2bdfbe..d2c6de5fb 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -9,9 +9,9 @@ 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} \ From dd7dcc597dbc8aaa1b48bae454b7787acb9ccce4 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Mon, 12 Dec 2016 16:01:47 +0100 Subject: [PATCH 10/84] meta-digi-arm:kernel-module-qualcomm:Pass disconnect event to upper layers. https://jira.digi.com/browse/DEL-3365 Signed-off-by: Alex Gonzalez --- .../kernel-module-qualcomm.bb | 1 + ...ate-disconnect-event-to-upper-layers.patch | 76 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index d2c6de5fb..ba37cd5b9 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -35,6 +35,7 @@ SRC_URI = " \ 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://0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch \ " S = "${WORKDIR}/${PV}" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch new file mode 100644 index 000000000..4d55231dd --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch @@ -0,0 +1,76 @@ +From: Alex Gonzalez +Date: Mon, 12 Dec 2016 16:19:48 +0100 +Subject: [PATCH] qcacld: Indicate disconnect event to upper layers. + +This is to avoid the following warning: + +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 1120 at net/wireless/core.c:1140 cfg80211_netdev_notifier_call+0x3a0/0x574() +Modules linked in: wlan(O-) evbug [last unloaded: wlan] +CPU: 0 PID: 1120 Comm: rmmod Tainted: G O 4.1.15-95656-g4c5caa2cab98-dirty #11 +Hardware name: Freescale i.MX6 Ultralite (Device Tree) +[<80015ae4>] (unwind_backtrace) from [<8001269c>] (show_stack+0x10/0x14) +[<8001269c>] (show_stack) from [<80730464>] (dump_stack+0x84/0xc4) +[<80730464>] (dump_stack) from [<8002d220>] (warn_slowpath_common+0x80/0xb0) +[<8002d220>] (warn_slowpath_common) from [<8002d2ec>] (warn_slowpath_null+0x1c/0x24) +[<8002d2ec>] (warn_slowpath_null) from [<806bdad8>] (cfg80211_netdev_notifier_call+0x3a0/0x574) +[<806bdad8>] (cfg80211_netdev_notifier_call) from [<800462b8>] (notifier_call_chain+0x44/0x84) +[<800462b8>] (notifier_call_chain) from [<8004642c>] (raw_notifier_call_chain+0x18/0x20) +[<8004642c>] (raw_notifier_call_chain) from [<8057f8fc>] (rollback_registered_many+0x2a0/0x3a4) +[<8057f8fc>] (rollback_registered_many) from [<8057fa24>] (rollback_registered+0x24/0x38) +[<8057fa24>] (rollback_registered) from [<80581d24>] (unregister_netdevice_queue+0x54/0xb0) +[<80581d24>] (unregister_netdevice_queue) from [<80581d98>] (unregister_netdev+0x18/0x20) +[<80581d98>] (unregister_netdev) from [<7f02363c>] (hdd_close_all_adapters+0x7c/0xbc [wlan]) +[<7f02363c>] (hdd_close_all_adapters [wlan]) from [<7f025be4>] (hdd_wlan_exit+0x2e4/0x72c [wlan]) +[<7f025be4>] (hdd_wlan_exit [wlan]) from [<7f0260c8>] (__hdd_wlan_exit+0x9c/0xe4 [wlan]) +[<7f0260c8>] (__hdd_wlan_exit [wlan]) from [<7f1c3238>] (ath_hif_sdio_remove+0x54/0xfc [wlan]) +[<7f1c3238>] (ath_hif_sdio_remove [wlan]) from [<7f1c5de0>] (hifDeviceRemoved+0x7c/0x16c [wlan]) +[<7f1c5de0>] (hifDeviceRemoved [wlan]) from [<804e9c8c>] (sdio_bus_remove+0x30/0xf8) +[<804e9c8c>] (sdio_bus_remove) from [<8036f598>] (__device_release_driver+0x70/0xe4) +[<8036f598>] (__device_release_driver) from [<8036fd34>] (driver_detach+0xac/0xb0) +[<8036fd34>] (driver_detach) from [<8036f2f8>] (bus_remove_driver+0x4c/0xa0) +[<8036f2f8>] (bus_remove_driver) from [<7f1c53a8>] (HIFShutDownDevice+0xbc/0x17c [wlan]) +[<7f1c53a8>] (HIFShutDownDevice [wlan]) from [<7f1c36c4>] (hif_unregister_driver+0x28/0x48 [wlan]) +[<7f1c36c4>] (hif_unregister_driver [wlan]) from [<7f1d2fa8>] (hdd_module_exit+0x140/0x18c [wlan]) +[<7f1d2fa8>] (hdd_module_exit [wlan]) from [<8008ae18>] (SyS_delete_module+0x174/0x1b8) +[<8008ae18>] (SyS_delete_module) from [<8000f400>] (ret_fast_syscall+0x0/0x3c) +---[ end trace cb71790dd22e980e ]--- + +https://jira.digi.com/browse/DEL-3365 + +Signed-off-by: Alex Gonzalez +--- + CORE/HDD/src/wlan_hdd_cfg80211.c | 3 +++ + CORE/HDD/src/wlan_hdd_main.c | 5 +++++ + 2 files changed, 8 insertions(+) + +diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c +index 43543a9a473d..ae86c88fcfa5 100644 +--- a/CORE/HDD/src/wlan_hdd_cfg80211.c ++++ b/CORE/HDD/src/wlan_hdd_cfg80211.c +@@ -11038,6 +11038,9 @@ disconnected: + FL("Set HDD connState to eConnectionState_NotConnected")); + pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; + ++ /* indicate disconnected event to nl80211 */ ++ cfg80211_disconnected(pAdapter->dev, WLAN_REASON_UNSPECIFIED, NULL, 0, ++ GFP_KERNEL); + return 0; + } + +diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c +index df5b1065d463..f057f8c177b1 100755 +--- a/CORE/HDD/src/wlan_hdd_main.c ++++ b/CORE/HDD/src/wlan_hdd_main.c +@@ -9536,6 +9536,11 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, + "%s: wait on disconnect_comp_var failed", + __func__); + } ++ else ++ { ++ cfg80211_disconnected(pAdapter->dev, WLAN_REASON_UNSPECIFIED, ++ NULL, 0, GFP_KERNEL); ++ } + } + else + { From 9a5372bcc97a7936ab56b5382a5ad40cab590fe3 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 15 Dec 2016 13:39:10 +0100 Subject: [PATCH 11/84] meta-digi-arm: kernel-module-qualcomm: Print connection mode. Signed-off-by: Alex Gonzalez --- .../kernel-module-qualcomm.bb | 1 + ...nt-con_mode-to-clearly-see-if-in-FTM.patch | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index ba37cd5b9..01f4afe47 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -36,6 +36,7 @@ SRC_URI = " \ file://0017-Add-.gitignore-rules.patch \ file://0018-wlan_hdd_main-initialize-all-adapter-completion-vari.patch \ file://0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch \ + file://0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch \ " S = "${WORKDIR}/${PV}" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch new file mode 100644 index 000000000..7478b9ad3 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch @@ -0,0 +1,26 @@ +From: Alex Gonzalez +Date: Thu, 15 Dec 2016 13:31:12 +0100 +Subject: [PATCH] wdd_hdd_main: Print con_mode to clearly see if in FTM mode. + +We use FTM mode for RF testing. + +Signed-off-by: Alex Gonzalez +--- + CORE/HDD/src/wlan_hdd_main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c +index f057f8c177b1..d83602740b94 100755 +--- a/CORE/HDD/src/wlan_hdd_main.c ++++ b/CORE/HDD/src/wlan_hdd_main.c +@@ -12607,8 +12607,8 @@ static int hdd_driver_init( void) + #ifdef HDD_TRACE_RECORD + MTRACE(hddTraceInit()); + #endif +- pr_info("%s: loading driver v%s\n", WLAN_MODULE_NAME, +- QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR); ++ pr_info("%s: loading driver v%s in mode %d\n", WLAN_MODULE_NAME, ++ QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR, con_mode); + + do { + From 6b1d790c95887eccbc588e65a0a1929237cc2697 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Fri, 2 Dec 2016 15:36:18 +0100 Subject: [PATCH 12/84] meta-digi-arm: linux-dey: create postfunc for trustfence The kernel recipe was modifying the device tree blobs in place within the kernel build temporal directory. This can cause problems after several compilations, only the deployed artifacts should be signed/encrypted. The deployment of the DTBs is done by do_deploy_appends in other layers which are appended after this recipe, so it is required to use a postfunc to do the trustfence related process after the deployment of all the artifacts. https://jira.digi.com/browse/DEL-3388 Signed-off-by: Diaz de Grenu, Jose --- .../recipes-kernel/linux/linux-dey.inc | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey.inc b/meta-digi-arm/recipes-kernel/linux/linux-dey.inc index fc77b74c0..45990474e 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey.inc +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey.inc @@ -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}" From 7fc553a300c6e77cb45faa9e1c15b35edf819c25 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 16 Dec 2016 16:05:51 +0100 Subject: [PATCH 13/84] meta-digi: add 'meta-swupdate' layer to bblayers config file https://jira.digi.com/browse/DEL-3355 Signed-off-by: Javier Viguera --- sdk/config/ccimx6sbc/bblayers.conf.sample | 1 + sdk/config/ccimx6ulsbc/bblayers.conf.sample | 1 + sdk/config/ccimx6ulstarter/bblayers.conf.sample | 1 + 3 files changed, 3 insertions(+) diff --git a/sdk/config/ccimx6sbc/bblayers.conf.sample b/sdk/config/ccimx6sbc/bblayers.conf.sample index 0647c0d8d..5d78bd456 100644 --- a/sdk/config/ccimx6sbc/bblayers.conf.sample +++ b/sdk/config/ccimx6sbc/bblayers.conf.sample @@ -14,6 +14,7 @@ BBLAYERS ?= " \ ##DIGIBASE##/meta-openembedded/meta-networking \ ##DIGIBASE##/meta-openembedded/meta-webserver \ ##DIGIBASE##/meta-qt5 \ + ##DIGIBASE##/meta-swupdate \ ##DIGIBASE##/meta-fsl-arm \ ##DIGIBASE##/meta-fsl-demos \ ##DIGIBASE##/meta-digi/meta-digi-arm \ diff --git a/sdk/config/ccimx6ulsbc/bblayers.conf.sample b/sdk/config/ccimx6ulsbc/bblayers.conf.sample index 0647c0d8d..5d78bd456 100644 --- a/sdk/config/ccimx6ulsbc/bblayers.conf.sample +++ b/sdk/config/ccimx6ulsbc/bblayers.conf.sample @@ -14,6 +14,7 @@ BBLAYERS ?= " \ ##DIGIBASE##/meta-openembedded/meta-networking \ ##DIGIBASE##/meta-openembedded/meta-webserver \ ##DIGIBASE##/meta-qt5 \ + ##DIGIBASE##/meta-swupdate \ ##DIGIBASE##/meta-fsl-arm \ ##DIGIBASE##/meta-fsl-demos \ ##DIGIBASE##/meta-digi/meta-digi-arm \ diff --git a/sdk/config/ccimx6ulstarter/bblayers.conf.sample b/sdk/config/ccimx6ulstarter/bblayers.conf.sample index 0647c0d8d..5d78bd456 100644 --- a/sdk/config/ccimx6ulstarter/bblayers.conf.sample +++ b/sdk/config/ccimx6ulstarter/bblayers.conf.sample @@ -14,6 +14,7 @@ BBLAYERS ?= " \ ##DIGIBASE##/meta-openembedded/meta-networking \ ##DIGIBASE##/meta-openembedded/meta-webserver \ ##DIGIBASE##/meta-qt5 \ + ##DIGIBASE##/meta-swupdate \ ##DIGIBASE##/meta-fsl-arm \ ##DIGIBASE##/meta-fsl-demos \ ##DIGIBASE##/meta-digi/meta-digi-arm \ From 93db03bad78649b9776ee0275f9d0f7f8de8946b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 16 Dec 2016 19:17:51 +0100 Subject: [PATCH 14/84] u-boot-fw-utils: rework patch from meta-swupdate with higher precedence The patch with the same name in 'meta-swupdate' fails to apply cleanly after the patches we have done in meta-digi. So add here a version of the patch that applies cleanly and with higher precedence in the search path (using 'dey' distro override). https://jira.digi.com/browse/DEL-3355 Signed-off-by: Javier Viguera --- ...env-tools-to-be-available-as-library.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/dey/0001-Allow-fw-env-tools-to-be-available-as-library.patch diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/dey/0001-Allow-fw-env-tools-to-be-available-as-library.patch b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/dey/0001-Allow-fw-env-tools-to-be-available-as-library.patch new file mode 100644 index 000000000..527d16070 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/dey/0001-Allow-fw-env-tools-to-be-available-as-library.patch @@ -0,0 +1,27 @@ +From: Stefano Babic +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 +--- + 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 $@ + From 347960c61ca1431a6b0bf68f3b8e2757c24fd39a Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 16 Dec 2016 19:43:35 +0100 Subject: [PATCH 15/84] swupdate: use version 2016.10 There is new functionality in that version that we need for our firmware update solution, so append the git-based recipe and set the revision to the 2016.10 version. Also provide a customized build configuration file. Notice that the defconfig file is actually a full '.config'. It needs to be a full config file because otherwise the anonymous python function in the recipe is not able to gather all the build time dependences. https://jira.digi.com/browse/DEL-3355 Signed-off-by: Javier Viguera --- meta-digi-dey/conf/distro/dey.conf | 3 + .../swupdate/swupdate/defconfig | 83 +++++++++++++++++++ .../swupdate/swupdate_git.bbappend | 15 ++++ 3 files changed, 101 insertions(+) create mode 100644 meta-digi-dey/recipes-support/swupdate/swupdate/defconfig create mode 100644 meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend diff --git a/meta-digi-dey/conf/distro/dey.conf b/meta-digi-dey/conf/distro/dey.conf index 1eabe420c..897753c07 100644 --- a/meta-digi-dey/conf/distro/dey.conf +++ b/meta-digi-dey/conf/distro/dey.conf @@ -50,6 +50,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}" diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig b/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig new file mode 100644 index 000000000..009cfaf4c --- /dev/null +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig @@ -0,0 +1,83 @@ +# +# Automatically generated file; DO NOT EDIT. +# Swupdate Configuration +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Swupdate Settings +# + +# +# General Configuration +# +CONFIG_SCRIPTS=y +# CONFIG_HW_COMPATIBILITY is not set +CONFIG_SW_VERSIONS_FILE="/etc/sw-versions" +CONFIG_MTD=y +# CONFIG_LUA is not set +# CONFIG_FEATURE_SYSLOG is not set + +# +# Build Options +# +# CONFIG_STATIC is not set +CONFIG_CROSS_COMPILE="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_WERROR is not set +# CONFIG_NOCLEANUP is not set +# CONFIG_DOWNLOAD is not set +# CONFIG_HASH_VERIFY is not set +# CONFIG_SIGNED_IMAGES is not set +# CONFIG_ENCRYPTED_IMAGES is not set +# CONFIG_SURICATTA is not set + +# +# Suricatta +# + +# +# Server +# +CONFIG_SURICATTA_SERVER_NONE=y + +# +# hawkBit support needs libcurl and CONFIG_JSON=y +# +# CONFIG_WEBSERVER is not set + +# +# Archival Features +# +CONFIG_GUNZIP=y + +# +# Parser Features +# +CONFIG_LIBCONFIG=y +CONFIG_LIBCONFIGROOT="" +# CONFIG_JSON is not set +# CONFIG_SETSWDESCRIPTION is not set + +# +# Image Handlers +# +CONFIG_UBIVOL=y +CONFIG_UBIBLACKLIST="" +CONFIG_UBIVIDOFFSET=0 +# CONFIG_CFI is not set +# CONFIG_CFIHAMMING1 is not set +CONFIG_RAW=y +CONFIG_SHELLSCRIPTHANDLER=y +# CONFIG_ARCHIVE is not set +# CONFIG_REMOTE_HANDLER is not set +CONFIG_UBOOT=y +CONFIG_UBOOT_FWENV="/etc/fw_env.config" diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend b/meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend new file mode 100644 index 000000000..cc0d47745 --- /dev/null +++ b/meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend @@ -0,0 +1,15 @@ +# Copyright (C) 2016 Digi International + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +# Version 2016.10 +SRCREV = "edd6559728d2e234ebdc03ba1d5444449ae2b92b" +PV = "2016.10+git${SRCPV}" + +do_install_append() { + # The 'progress' command is new starting in version '2016.10', but we + # don't need to do a version check here because the bbappend is version + # specific (PV hardcoded above) + install -d ${D}${bindir}/ + install -m 0755 progress ${D}${bindir}/ +} From 7f092fe4cdcbcf287243246b569944afddb84387 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Fri, 16 Dec 2016 13:02:27 +0100 Subject: [PATCH 16/84] imx-digi-base.inc: build gstreamer plugins for i.MX6UL The i.MX6UL supports some basic multimedia functionality using the pixel pipeline (PXP). Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-2358 --- meta-digi-arm/conf/machine/include/imx-digi-base.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index 883273e87..151948418 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -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" From 2d2afe1286fa2452f806415ffcf3294d2a46d399 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 21 Dec 2016 17:39:29 +0100 Subject: [PATCH 17/84] meta-digi: fix gst1.0-fsl-plugin video sink device Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-3399 --- ...gstimxv4l2-map-dev-video1-to-dev-fb0.patch | 30 +++++++++++++++++++ .../gst1.0-fsl-plugin_4.0.8.bbappend | 5 ++++ 2 files changed, 35 insertions(+) create mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.8/0001-gstimxv4l2-map-dev-video1-to-dev-fb0.patch create mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.8.bbappend diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.8/0001-gstimxv4l2-map-dev-video1-to-dev-fb0.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.8/0001-gstimxv4l2-map-dev-video1-to-dev-fb0.patch new file mode 100644 index 000000000..7f562f8b5 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.8/0001-gstimxv4l2-map-dev-video1-to-dev-fb0.patch @@ -0,0 +1,30 @@ +From: Hector Palacios +Date: Wed, 21 Dec 2016 16:28:05 +0100 +Subject: [PATCH] gstimxv4l2: map /dev/video1 to /dev/fb0 + +On the i.MX6UL, the CSI camera is probed before the video PXP device. +In this case the camera is registered as /dev/video0 and the video device +is registered as /dev/video1. + +In the mappings for video devices we must map /dev/video1 to /dev/fb0 so +that the imxv4l2sink can work with it. + +Signed-off-by: Hector Palacios + +https://jira.digi.com/browse/DEL-3399 +--- + libs/v4l2_core/gstimxv4l2.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libs/v4l2_core/gstimxv4l2.c b/libs/v4l2_core/gstimxv4l2.c +index 02cf68d9cddc..3ec3d6a41e18 100755 +--- a/libs/v4l2_core/gstimxv4l2.c ++++ b/libs/v4l2_core/gstimxv4l2.c +@@ -208,6 +208,7 @@ static guint g_camera_format_PXP[] = { + + static IMXV4l2DeviceMap g_device_maps[] = { + {"/dev/video0", FALSE, "/dev/fb0"}, ++ {"/dev/video1", FALSE, "/dev/fb0"}, + {"/dev/video16", TRUE, "/dev/fb0"}, + {"/dev/video17", FALSE, "/dev/fb0"}, + {"/dev/video18", TRUE, "/dev/fb2"}, diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.8.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.8.bbappend new file mode 100644 index 000000000..833800cae --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.8.bbappend @@ -0,0 +1,5 @@ +# Copyright (C) 2016 Digi International + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" + +SRC_URI += "file://0001-gstimxv4l2-map-dev-video1-to-dev-fb0.patch" From cb46deba3852b73f99a6f9f7090c8365c4294d73 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Fri, 16 Dec 2016 12:59:54 +0100 Subject: [PATCH 18/84] dey-image-qt: build gstreamer for 'ccimx6ulsbc' platform Separately add 'dey-gstreamer' to ccimx6ulsbc platform. This platform does not have 'accel-video' but we want gstreamer for using it with video/camera. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-2358 --- meta-digi-dey/recipes-core/images/dey-image-qt.bb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-digi-dey/recipes-core/images/dey-image-qt.bb b/meta-digi-dey/recipes-core/images/dey-image-qt.bb index 73b435b67..6cd4e2956 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-qt.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-qt.bb @@ -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" From 1496d740d7992afdd5a0e3b4c44720c55bf8d798 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 27 Dec 2016 16:35:34 +0100 Subject: [PATCH 19/84] ccimx6ul: suspend: do not bring hci0 down/up Bringing the Bluetooth interface down and up during suspend is not needed and it even showed problems on the Starter Board where the Bluetooth interface does not come up again after having been brought down in suspend. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-3416 https://jira.digi.com/browse/DEL-3081 --- .../recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend index d0f16dfa9..c89ed5ec1 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend @@ -26,9 +26,6 @@ usage() { } suspend_interfaces() { - if hcitool -i hci0 dev >/dev/null 2>&1; then - hciconfig hci0 down && up_hci0_on_resume="1" - fi if grep -qs '^wlan0' /var/run/ifstate; then ifdown wlan0 && up_wlan_on_resume="1" fi @@ -41,7 +38,6 @@ resume_interfaces() { if ! grep -qs '^wlan0' /var/run/ifstate; then [ -n "${up_wlan_on_resume}" ] && ifup wlan0 fi - [ -n "${up_hci0_on_resume}" ] && hciconfig hci0 up } while getopts "h" c; do From a7ab3e7fa58740735d8973a572a512af3b204a7f Mon Sep 17 00:00:00 2001 From: David Escalona Date: Tue, 13 Dec 2016 11:33:35 +0100 Subject: [PATCH 20/84] recovery: add new bootscript for the recovery image Signed-off-by: David Escalona --- .../u-boot-dey-2015.04/ccimx6/recovery.txt | 49 +++++++++++++++++++ .../ccimx6ulsbc/recovery.txt | 25 ++++++++++ .../ccimx6ulstarter/recovery.txt | 25 ++++++++++ .../recipes-bsp/u-boot/u-boot-dey_2015.04.bb | 17 ++++++- 4 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/recovery.txt create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/recovery.txt create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/recovery.txt diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/recovery.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/recovery.txt new file mode 100644 index 000000000..7df232111 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/recovery.txt @@ -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} diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/recovery.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/recovery.txt new file mode 100644 index 000000000..877abe457 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/recovery.txt @@ -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} diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/recovery.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/recovery.txt new file mode 100644 index 000000000..2c75edf7a --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/recovery.txt @@ -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} diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb index 59596c3c1..e54eac91c 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb @@ -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} } From f13767ecd3fdda42cffe4d71b861a6c3b4923872 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Tue, 13 Dec 2016 11:36:40 +0100 Subject: [PATCH 21/84] recovery: add recipe to generate recovery ramdisk file tree Signed-off-by: David Escalona --- .../recovery/recovery-initramfs.bb | 23 + .../recovery-initramfs-init | 394 ++++++++++++++++++ .../recovery/recovery-initramfs/swupdate.cfg | 7 + 3 files changed, 424 insertions(+) create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-initramfs/swupdate.cfg diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb new file mode 100644 index 000000000..ea706465c --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs.bb @@ -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} = "/" diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init new file mode 100644 index 000000000..c5bed24d9 --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -0,0 +1,394 @@ +#!/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="/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}" +} + +#------------------------------------------------------------------------------ +# 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 - show_error +# +# Shows the given error message in the display. +# +# @param ${1} - Error message to show. +#------------------------------------------------------------------------------ +show_error() { + # DEL-3273 - https://jira.digi.com/browse/DEL-3273 + # Show error in the display + echo "DEL-3273 - Show error in the display" +} + +#------------------------------------------------------------------------------ +# 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}" + show_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 "${device}${i}") + local mount_dir="${USB_MOUNT_DIR}${dev_name}" + mkdir -p "${mount_dir}" + mount "/dev/${dev_name}" "${mount_dir}" 2>/dev/null + 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}" + mount -t auto "${partition_block}" "${2}" >/dev/null 2>&1 + 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 + # Format MTD partition. + ubiformat "/dev/mtd${mtd_num}" >/dev/null 2>&1 + if [ "$?" != "0" ]; then + quit_with_error "Error erasing '/dev/mtd${mtd_num}' block" + fi + # 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 + 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")" + # 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 + log "Partition '${1}' successfully erased!" + else + quit_with_error "Error erasing '${1}' partition" + 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 + +# 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..." + +# 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" + 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})" + trustfence-tool "--newkey${encryption_key:+=${encryption_key}}" + if [ "$?" = "0" ]; then + 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" + if [ -z "${update_package}" ]; then + quit_with_error "Firmware update package not specified" + else + log "Update package location: ${update_package}" + # Mount external disks. + mount_external_disks + # Mount update partition. + mount_partition update "${UPDATE_MOUNT_DIR}" + # 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 diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/swupdate.cfg b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/swupdate.cfg new file mode 100644 index 000000000..2a63bee87 --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/swupdate.cfg @@ -0,0 +1,7 @@ +globals : +{ + verbose = true; + loglevel = 5; + syslog = true; + mtd-blacklist = "0 1 2"; +}; From c68a9d255a67c74befdd520da76a94f0db2faf6d Mon Sep 17 00:00:00 2001 From: David Escalona Date: Tue, 13 Dec 2016 11:37:38 +0100 Subject: [PATCH 22/84] recovery: add recipe to generate the recovery ramdisk image - This recipe generates the recovery ramdisk image with the contents of the recovery ramdisk tree (recovery-initramfs) and other packages. Signed-off-by: David Escalona --- .../images/dey-image-recovery-initramfs.bb | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb diff --git a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb new file mode 100644 index 000000000..b04fca1a2 --- /dev/null +++ b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb @@ -0,0 +1,33 @@ +# Copyright (C) 2016 Digi International. + +DESCRIPTION = "Recovery initramfs image" +LICENSE = "MIT" + +PACKAGE_INSTALL = " \ + busybox \ + 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" From 047849b848ed322a5b89c0a53897f44edaa4c912 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Tue, 13 Dec 2016 11:39:16 +0100 Subject: [PATCH 23/84] recovery: add recovery image types for DEY images generation - Added the new image type 'recovery.vfat' to the DEY images generation process. This new image is a clone of the 'boot.vfat' but including the recovery ramdisk and the recovery boot script. - Added the new image type 'recovery.ubifs' to the DEY images generation process. This new image is similar to the 'boot.ubifs' but including the recovery ramdisk and the recovery boot script. Signed-off-by: David Escalona --- .../classes/image_types_digi.bbclass | 71 +++++++++++++++++++ meta-digi-arm/conf/machine/ccimx6sbc.conf | 2 +- meta-digi-arm/conf/machine/ccimx6ulsbc.conf | 2 +- .../conf/machine/ccimx6ulstarter.conf | 2 +- meta-digi-dey/conf/distro/dey.conf | 3 + 5 files changed, 77 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/classes/image_types_digi.bbclass b/meta-digi-arm/classes/image_types_digi.bbclass index e79819b44..3210922b6 100644 --- a/meta-digi-arm/classes/image_types_digi.bbclass +++ b/meta-digi-arm/classes/image_types_digi.bbclass @@ -124,6 +124,77 @@ IMAGE_CMD_boot.ubifs() { rm -rf ${TMP_BOOTDIR} } +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 'recovery.vfat' + # + # 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}.recovery.vfat ]; then + ln -s ${IMAGE_NAME}.recovery.vfat ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.recovery.vfat + fi +} + +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() { # # Image generation code for image type 'cpio.gz.u-boot.tf' diff --git a/meta-digi-arm/conf/machine/ccimx6sbc.conf b/meta-digi-arm/conf/machine/ccimx6sbc.conf index 4b70319bb..38d494206 100644 --- a/meta-digi-arm/conf/machine/ccimx6sbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6sbc.conf @@ -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" diff --git a/meta-digi-arm/conf/machine/ccimx6ulsbc.conf b/meta-digi-arm/conf/machine/ccimx6ulsbc.conf index cefca191a..eb03ffb63 100644 --- a/meta-digi-arm/conf/machine/ccimx6ulsbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6ulsbc.conf @@ -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" diff --git a/meta-digi-arm/conf/machine/ccimx6ulstarter.conf b/meta-digi-arm/conf/machine/ccimx6ulstarter.conf index 6593173e4..81beaca28 100644 --- a/meta-digi-arm/conf/machine/ccimx6ulstarter.conf +++ b/meta-digi-arm/conf/machine/ccimx6ulstarter.conf @@ -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" diff --git a/meta-digi-dey/conf/distro/dey.conf b/meta-digi-dey/conf/distro/dey.conf index 897753c07..3e73ee11b 100644 --- a/meta-digi-dey/conf/distro/dey.conf +++ b/meta-digi-dey/conf/distro/dey.conf @@ -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" From f4ece3821e22999aa3fb1b685ae8a328e198a72a Mon Sep 17 00:00:00 2001 From: David Escalona Date: Wed, 28 Dec 2016 16:55:18 +0100 Subject: [PATCH 24/84] recovery: init script mount fixes - Added a 5 seconds delay before mounting external disks so they have time to be recognized in the system. - Check if UBI volume is mounted before formatting it. - Check if eMMC block device exists before formatting it. Signed-off-by: David Escalona --- .../recovery-initramfs-init | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index c5bed24d9..e304ec4ad 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -248,6 +248,12 @@ format_ubi_volume() { 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. ubiformat "/dev/mtd${mtd_num}" >/dev/null 2>&1 if [ "$?" != "0" ]; then @@ -277,16 +283,20 @@ format_ubi_volume() { 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")" - # 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 - log "Partition '${1}' successfully erased!" + 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 + log "Partition '${1}' successfully erased!" + else + quit_with_error "Error erasing '${1}' partition" + fi else - quit_with_error "Error erasing '${1}' partition" + quit_with_error "Could not find partition block for '${1}'" fi } @@ -376,6 +386,7 @@ if [ -n "${update_package_bool}" ]; then else log "Update package location: ${update_package}" # Mount external disks. + sleep 5 mount_external_disks # Mount update partition. mount_partition update "${UPDATE_MOUNT_DIR}" From 2a79bc29d0764294a1eba01a59595a1d6ff7be31 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Wed, 28 Dec 2016 16:59:10 +0100 Subject: [PATCH 25/84] swupdate: add patch to include command line support to progress client - This patch comes from the sw-update upstream and adds command line support to the progress client binary. https://github.com/sbabic/swupdate/commit/a11e6f2b8066566d28cef0585be55bcfba6b3b4b https://jira.digi.com/browse/DEL-3356 Signed-off-by: David Escalona --- ...ss_client-add-command-line-parameter.patch | 133 ++++++++++++++++++ .../swupdate/swupdate_git.bbappend | 2 + 2 files changed, 135 insertions(+) create mode 100644 meta-digi-dey/recipes-support/swupdate/swupdate/0001-progress_client-add-command-line-parameter.patch diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/0001-progress_client-add-command-line-parameter.patch b/meta-digi-dey/recipes-support/swupdate/swupdate/0001-progress_client-add-command-line-parameter.patch new file mode 100644 index 000000000..a45429c2f --- /dev/null +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/0001-progress_client-add-command-line-parameter.patch @@ -0,0 +1,133 @@ +From: Stefano Babic +Date: Wed, 30 Nov 2016 18:04:21 +0100 +Subject: [PATCH] progress_client: add command line parameter + +Add command lin eparameter to: +- waiting forever for a connection with SWUpdate +- make psplash optional + +Signed-off-by: Stefano Babic +Signed-off-by: David Escalona +--- + progress_client/progress.c | 67 +++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 60 insertions(+), 7 deletions(-) + +diff --git a/progress_client/progress.c b/progress_client/progress.c +index b057a8f..c587dd6 100644 +--- a/progress_client/progress.c ++++ b/progress_client/progress.c +@@ -34,11 +34,30 @@ + #include + #include + #include ++#include + + #include + + #define PSPLASH_MSG_SIZE 64 + ++static struct option long_options[] = { ++ {"psplash", no_argument, NULL, 'p'}, ++ {"wait", no_argument, NULL, 'w'}, ++ {NULL, 0, NULL, 0} ++}; ++ ++static void usage(char *programname) ++{ ++ fprintf(stdout, "%s (compiled %s)\n", programname, __DATE__); ++ fprintf(stdout, "Usage %s [OPTION]\n", ++ programname); ++ fprintf(stdout, ++ " -w, --wait : wait for a connection with SWUpdate\n" ++ " -p, --psplash : send info to the psplash process\n" ++ " -h, --help : print this help and exit\n" ++ ); ++} ++ + static int psplash_init(char *pipe) + { + int psplash_pipe_fd; +@@ -123,7 +142,8 @@ static void psplash_progress(char *pipe, struct progress_msg *pmsg) + free(buf); + } + +-int main(void) { ++int main(int argc, char **argv) ++{ + int connfd; + struct sockaddr_un servaddr; + struct progress_msg msg; +@@ -135,7 +155,31 @@ int main(void) { + int percent = 0; + char bar[60]; + int filled_len; ++ int opt_w = 0; ++ int opt_p = 0; ++ int c; + ++ /* Process options with getopt */ ++ while ((c = getopt_long(argc, argv, "wph", ++ long_options, NULL)) != EOF) { ++ switch (c) { ++ case 'w': ++ opt_w = 1; ++ break; ++ case 'p': ++ opt_p = 1; ++ break; ++ case 'h': ++ usage(argv[0]); ++ exit(0); ++ break; ++ default: ++ usage(argv[0]); ++ exit(1); ++ break; ++ } ++ } ++ + tmpdir = getenv("TMPDIR"); + if (!tmpdir) + tmpdir = "/tmp"; +@@ -150,10 +194,18 @@ int main(void) { + servaddr.sun_family = AF_LOCAL; + strcpy(servaddr.sun_path, SOCKET_PROGRESS_PATH); + +- ret = connect(connfd, (struct sockaddr *) &servaddr, sizeof(servaddr)); +- if (ret < 0) { +- fprintf(stderr, "no communication with swupdate\n"); +- } ++ /* Connection to SWUpdate */ ++ do { ++ ret = connect(connfd, (struct sockaddr *) &servaddr, sizeof(servaddr)); ++ if (ret == 0) ++ break; ++ if (!opt_w) { ++ fprintf(stderr, "no communication with swupdate\n"); ++ exit(1); ++ } ++ ++ sleep(1); ++ } while (1); + + while (1) { + ret = read(connfd, &msg, sizeof(msg)); +@@ -161,7 +213,7 @@ int main(void) { + close(connfd); + exit(1); + } +- if (!psplash_ok) { ++ if (!psplash_ok && opt_p) { + psplash_ok = psplash_init(psplash_pipe_path); + } + +@@ -193,7 +245,8 @@ int main(void) { + fprintf(stdout, "\n\n%s !\n", msg.status == SUCCESS + ? "SUCCESS" + : "FAILURE"); +- psplash_progress(psplash_pipe_path, &msg); ++ if (psplash_ok) ++ psplash_progress(psplash_pipe_path, &msg); + psplash_ok = 0; + break; + case DONE: diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend b/meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend index cc0d47745..f973e1df0 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend +++ b/meta-digi-dey/recipes-support/swupdate/swupdate_git.bbappend @@ -6,6 +6,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRCREV = "edd6559728d2e234ebdc03ba1d5444449ae2b92b" PV = "2016.10+git${SRCPV}" +SRC_URI += "file://0001-progress_client-add-command-line-parameter.patch" + do_install_append() { # The 'progress' command is new starting in version '2016.10', but we # don't need to do a version check here because the bbappend is version From eede1126ec9148cfc9282ea1eea379a97fff8dba Mon Sep 17 00:00:00 2001 From: David Escalona Date: Thu, 29 Dec 2016 12:33:20 +0100 Subject: [PATCH 26/84] psplash: customize psplash screen with Digi scheme https://jira.digi.com/browse/DEL-3356 Signed-off-by: David Escalona --- ...-psplash-colors-to-match-Digi-scheme.patch | 33 + ...r-replace-progress-bar-with-Digi-one.patch | 104 +++ .../psplash/files/psplash-poky-img.h | 718 ++++++++++++++++++ .../recipes-core/psplash/psplash_git.bbappend | 8 + 4 files changed, 863 insertions(+) create mode 100644 meta-digi-dey/recipes-core/psplash/files/0001-colors-modify-psplash-colors-to-match-Digi-scheme.patch create mode 100644 meta-digi-dey/recipes-core/psplash/files/0002-bar-replace-progress-bar-with-Digi-one.patch create mode 100644 meta-digi-dey/recipes-core/psplash/files/psplash-poky-img.h create mode 100644 meta-digi-dey/recipes-core/psplash/psplash_git.bbappend diff --git a/meta-digi-dey/recipes-core/psplash/files/0001-colors-modify-psplash-colors-to-match-Digi-scheme.patch b/meta-digi-dey/recipes-core/psplash/files/0001-colors-modify-psplash-colors-to-match-Digi-scheme.patch new file mode 100644 index 000000000..b7749273f --- /dev/null +++ b/meta-digi-dey/recipes-core/psplash/files/0001-colors-modify-psplash-colors-to-match-Digi-scheme.patch @@ -0,0 +1,33 @@ +From: David Escalona +Date: Thu, 29 Dec 2016 09:42:26 +0100 +Subject: [PATCH] colors: modify psplash colors to match Digi scheme + +Signed-off-by: David Escalona +--- + 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 diff --git a/meta-digi-dey/recipes-core/psplash/files/0002-bar-replace-progress-bar-with-Digi-one.patch b/meta-digi-dey/recipes-core/psplash/files/0002-bar-replace-progress-bar-with-Digi-one.patch new file mode 100644 index 000000000..b231390b6 --- /dev/null +++ b/meta-digi-dey/recipes-core/psplash/files/0002-bar-replace-progress-bar-with-Digi-one.patch @@ -0,0 +1,104 @@ +From: David Escalona +Date: Thu, 29 Dec 2016 10:45:39 +0100 +Subject: [PATCH] bar: replace progress bar with Digi one + +Signed-off-by: David Escalona +--- + 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") + + diff --git a/meta-digi-dey/recipes-core/psplash/files/psplash-poky-img.h b/meta-digi-dey/recipes-core/psplash/files/psplash-poky-img.h new file mode 100644 index 000000000..15b0c82c6 --- /dev/null +++ b/meta-digi-dey/recipes-core/psplash/files/psplash-poky-img.h @@ -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 Date: Thu, 29 Dec 2016 12:36:05 +0100 Subject: [PATCH 27/84] recovery: add psplash support to recovery - Include psplash package in the recovery initramfs recipe. - Start psplash in the recovery init. - Add new methods to communicate with psplash from the init script. - Show psplash progress information from the init script. - Start progress binary to update psplash during a firmware update. https://jira.digi.com/browse/DEL-3356 Signed-off-by: David Escalona --- .../images/dey-image-recovery-initramfs.bb | 1 + .../recovery-initramfs-init | 41 +++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb index b04fca1a2..42c91b785 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb @@ -5,6 +5,7 @@ LICENSE = "MIT" PACKAGE_INSTALL = " \ busybox \ + psplash \ recovery-initramfs \ swupdate \ trustfence-tool \ diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index e304ec4ad..35b19a125 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -60,6 +60,8 @@ log_warning() { #------------------------------------------------------------------------------ log_error() { log "[ERROR] ${1}" + psplash_message "ERROR: ${1}" + psplash_progress "0" } #------------------------------------------------------------------------------ @@ -85,16 +87,27 @@ read_uboot_var() { } #------------------------------------------------------------------------------ -# Function - show_error +# Function - psplash_message # -# Shows the given error message in the display. +# Shows the given message in the psplash screen. # -# @param ${1} - Error message to show. +# @param ${1} - Message to show. #------------------------------------------------------------------------------ -show_error() { - # DEL-3273 - https://jira.digi.com/browse/DEL-3273 - # Show error in the display - echo "DEL-3273 - Show error in the display" +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 } #------------------------------------------------------------------------------ @@ -116,7 +129,6 @@ reboot_system() { quit_with_error() { clear_uboot_vars log_error "${1}" - show_error "${1}" log "The system will now reboot in ${REBOOT_TIME} seconds" sleep "${REBOOT_TIME}" reboot_system @@ -259,11 +271,13 @@ format_ubi_volume() { if [ "$?" != "0" ]; 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 + psplash_progress "100" log "Partition '${1}' successfully erased!" # Detach MTD partition. ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1 @@ -291,6 +305,7 @@ format_emmc_block() { # 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" @@ -318,6 +333,9 @@ 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 @@ -335,6 +353,7 @@ if [ -n "${rescue}" ]; then fi log "Starting recovery..." +psplash_message "Starting recovery..." # Read the recovery command. read_uboot_var "${ENV_RECOVERY_COMMAND}" COMMAND @@ -364,14 +383,17 @@ 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" @@ -381,6 +403,7 @@ 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 @@ -390,6 +413,8 @@ if [ -n "${update_package_bool}" ]; then mount_external_disks # Mount update partition. mount_partition update "${UPDATE_MOUNT_DIR}" + # Execute the progress binary. + progress -wp & # Execute the software update. swupdate -f "${SW_CONFIG}" -i "${update_package}" if [ "$?" = "0" ]; then From 0b3f878d54df98aa62cb040fa69c677ae856d59d Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 12 Dec 2016 12:50:09 +0100 Subject: [PATCH 28/84] ccimx6ul: synchronize v4.1 kernel defconfig Signed-off-by: Hector Palacios --- .../linux/linux-dey-4.1/ccimx6ul/defconfig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig index fba83f1be..ad0a5084b 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig @@ -213,11 +213,11 @@ 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_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 @@ -250,11 +250,9 @@ CONFIG_SND=y CONFIG_SND_USB_AUDIO=m 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,6 +321,7 @@ 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 From 8d9033138d7c1993f5093b035d6b481398cc1a0a Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 24 Nov 2016 10:35:39 +0100 Subject: [PATCH 29/84] alsa-state: ccimx6ul: add basic asound.conf for imxmax98088 Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-2352 --- .../alsa-state/ccimx6ul/asound.conf | 48 +++---------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.conf b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.conf index b39177ba8..11c4cbba0 100644 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.conf +++ b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.conf @@ -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 From 96f6849668df8314234560ef85897f2d2b8636e4 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Thu, 24 Nov 2016 10:38:16 +0100 Subject: [PATCH 30/84] alsa-state: ccimx6ul: add ALSA asound.state config file The codec MAX98088 present on the ccimx6ulsbc only needs one configuration file that can play and record. The default file enables the interfaces present on the ccimx6ulsbc: - Headphones - Speaker - LineOut (in stereo mode) - LineIN-A - MIC2 Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-2352 --- .../alsa-state/alsa-state.bbappend | 18 +- .../alsa-state/ccimx6ul/asound.inline.state | 127 -- .../ccimx6ul/asound.inline_play.state | 127 -- .../alsa-state/ccimx6ul/asound.micro.state | 127 -- .../ccimx6ul/asound.micro_play.state | 127 -- .../alsa-state/ccimx6ul/asound.play.state | 127 -- .../alsa-state/ccimx6ul/asound.state | 1148 +++++++++++++++++ 7 files changed, 1164 insertions(+), 637 deletions(-) delete mode 100644 meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline.state delete mode 100644 meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline_play.state delete mode 100644 meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro.state delete mode 100644 meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro_play.state delete mode 100644 meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.play.state create mode 100644 meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state.bbappend b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state.bbappend index f58443d54..e21da25b4 100644 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state.bbappend +++ b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state.bbappend @@ -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 } diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline.state b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline.state deleted file mode 100644 index 0d9c9db6b..000000000 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline.state +++ /dev/null @@ -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 - } - } -} diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline_play.state b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline_play.state deleted file mode 100644 index 05a69279e..000000000 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.inline_play.state +++ /dev/null @@ -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 - } - } -} diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro.state b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro.state deleted file mode 100644 index 4d55bc608..000000000 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro.state +++ /dev/null @@ -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 - } - } -} diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro_play.state b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro_play.state deleted file mode 100644 index 4d55bc608..000000000 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.micro_play.state +++ /dev/null @@ -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 - } - } -} diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.play.state b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.play.state deleted file mode 100644 index 4d55bc608..000000000 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.play.state +++ /dev/null @@ -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 - } - } -} diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state new file mode 100644 index 000000000..e5de02092 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state @@ -0,0 +1,1148 @@ +state.imxmax98088 { + control.1 { + iface MIXER + name 'Headphone Volume' + value.0 18 + value.1 18 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -6700 + dbmax 300 + dbvalue.0 -1100 + dbvalue.1 -1100 + } + } + control.2 { + iface MIXER + name 'Speaker Volume' + value.0 16 + value.1 16 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -6200 + dbmax 800 + dbvalue.0 -1000 + dbvalue.1 -1000 + } + } + control.3 { + iface MIXER + name 'Receiver Volume' + value.0 16 + value.1 16 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -6200 + dbmax 800 + dbvalue.0 -1000 + dbvalue.1 -1000 + } + } + control.4 { + iface MIXER + name 'Headphone Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.5 { + iface MIXER + name 'Speaker Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.6 { + iface MIXER + name 'Receiver Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.7 { + iface MIXER + name 'MIC1 Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 31' + } + } + control.8 { + iface MIXER + name 'MIC2 Volume' + value 15 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 31' + } + } + control.9 { + iface MIXER + name 'MIC1 Boost Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 2' + dbmin 0 + dbmax 3000 + dbvalue.0 0 + } + } + control.10 { + iface MIXER + name 'MIC2 Boost Volume' + value 1 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 2' + dbmin 0 + dbmax 3000 + dbvalue.0 2000 + } + } + control.11 { + iface MIXER + name 'INA Volume' + value 4 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.12 { + iface MIXER + name 'INB Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.13 { + iface MIXER + name 'ADCL Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.14 { + iface MIXER + name 'ADCR Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.15 { + iface MIXER + name 'ADCL Boost Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 3' + } + } + control.16 { + iface MIXER + name 'ADCR Boost Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 3' + } + } + control.17 { + iface MIXER + name 'EQ1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.18 { + iface MIXER + name 'EQ2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.19 { + iface MIXER + name 'EX Limiter Mode' + value Off + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Off + item.1 '100Hz' + item.2 '400Hz' + item.3 '600Hz' + item.4 '800Hz' + item.5 '1000Hz' + item.6 '200-400Hz' + item.7 '400-600Hz' + item.8 '400-800Hz' + } + } + control.20 { + iface MIXER + name 'EX Limiter Threshold' + value '0.6' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 '0.6' + item.1 '1.2' + item.2 '1.8' + item.3 '2.4' + item.4 '3.0' + item.5 '3.6' + item.6 '4.2' + item.7 '4.8' + } + } + control.21 { + iface MIXER + name 'DAI1 Filter Mode' + value Music + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Voice + item.1 Music + } + } + control.22 { + iface MIXER + name 'DAI1 DAC Filter' + value Off + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Off + item.1 'fc=258/fs=16k' + item.2 'fc=500/fs=16k' + item.3 'fc=258/fs=8k' + item.4 'fc=500/fs=8k' + item.5 'fc=200' + } + } + control.23 { + iface MIXER + name 'DAI1 ADC Filter' + value Off + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Off + item.1 'fc=258/fs=16k' + item.2 'fc=500/fs=16k' + item.3 'fc=258/fs=8k' + item.4 'fc=500/fs=8k' + item.5 'fc=200' + } + } + control.24 { + iface MIXER + name 'DAI2 DC Block Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.25 { + iface MIXER + name 'ALC Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.26 { + iface MIXER + name 'ALC Threshold' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.27 { + iface MIXER + name 'ALC Multiband' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.28 { + iface MIXER + name 'ALC Release Time' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.29 { + iface MIXER + name 'PWR Limiter Threshold' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.30 { + iface MIXER + name 'PWR Limiter Weight' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.31 { + iface MIXER + name 'PWR Limiter Time1' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.32 { + iface MIXER + name 'PWR Limiter Time2' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.33 { + iface MIXER + name 'THD Limiter Threshold' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.34 { + iface MIXER + name 'THD Limiter Time' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.35 { + iface MIXER + name 'REC Output Mode' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.36 { + iface MIXER + name 'Right ADC Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.37 { + iface MIXER + name 'Right ADC Mixer MIC2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.38 { + iface MIXER + name 'Right ADC Mixer INA1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.39 { + iface MIXER + name 'Right ADC Mixer INA2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.40 { + iface MIXER + name 'Right ADC Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.41 { + iface MIXER + name 'Right ADC Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.42 { + iface MIXER + name 'Left ADC Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.43 { + iface MIXER + name 'Left ADC Mixer MIC2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.44 { + iface MIXER + name 'Left ADC Mixer INA1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.45 { + iface MIXER + name 'Left ADC Mixer INA2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.46 { + iface MIXER + name 'Left ADC Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.47 { + iface MIXER + name 'Left ADC Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.48 { + iface MIXER + name 'Right REC Mixer Left DAC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.49 { + iface MIXER + name 'Right REC Mixer Right DAC1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.50 { + iface MIXER + name 'Right REC Mixer Left DAC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.51 { + iface MIXER + name 'Right REC Mixer Right DAC2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.52 { + iface MIXER + name 'Right REC Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.53 { + iface MIXER + name 'Right REC Mixer MIC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.54 { + iface MIXER + name 'Right REC Mixer INA1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.55 { + iface MIXER + name 'Right REC Mixer INA2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.56 { + iface MIXER + name 'Right REC Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.57 { + iface MIXER + name 'Right REC Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.58 { + iface MIXER + name 'Left REC Mixer Left DAC1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.59 { + iface MIXER + name 'Left REC Mixer Right DAC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.60 { + iface MIXER + name 'Left REC Mixer Left DAC2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.61 { + iface MIXER + name 'Left REC Mixer Right DAC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.62 { + iface MIXER + name 'Left REC Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.63 { + iface MIXER + name 'Left REC Mixer MIC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.64 { + iface MIXER + name 'Left REC Mixer INA1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.65 { + iface MIXER + name 'Left REC Mixer INA2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.66 { + iface MIXER + name 'Left REC Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.67 { + iface MIXER + name 'Left REC Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.68 { + iface MIXER + name 'Right SPK Mixer Left DAC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.69 { + iface MIXER + name 'Right SPK Mixer Right DAC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.70 { + iface MIXER + name 'Right SPK Mixer Left DAC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.71 { + iface MIXER + name 'Right SPK Mixer Right DAC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.72 { + iface MIXER + name 'Right SPK Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.73 { + iface MIXER + name 'Right SPK Mixer MIC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.74 { + iface MIXER + name 'Right SPK Mixer INA1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.75 { + iface MIXER + name 'Right SPK Mixer INA2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.76 { + iface MIXER + name 'Right SPK Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.77 { + iface MIXER + name 'Right SPK Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.78 { + iface MIXER + name 'Left SPK Mixer Left DAC1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.79 { + iface MIXER + name 'Left SPK Mixer Right DAC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.80 { + iface MIXER + name 'Left SPK Mixer Left DAC2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.81 { + iface MIXER + name 'Left SPK Mixer Right DAC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.82 { + iface MIXER + name 'Left SPK Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.83 { + iface MIXER + name 'Left SPK Mixer MIC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.84 { + iface MIXER + name 'Left SPK Mixer INA1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.85 { + iface MIXER + name 'Left SPK Mixer INA2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.86 { + iface MIXER + name 'Left SPK Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.87 { + iface MIXER + name 'Left SPK Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.88 { + iface MIXER + name 'Right HP Mixer Left DAC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.89 { + iface MIXER + name 'Right HP Mixer Right DAC1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.90 { + iface MIXER + name 'Right HP Mixer Left DAC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.91 { + iface MIXER + name 'Right HP Mixer Right DAC2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.92 { + iface MIXER + name 'Right HP Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.93 { + iface MIXER + name 'Right HP Mixer MIC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.94 { + iface MIXER + name 'Right HP Mixer INA1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.95 { + iface MIXER + name 'Right HP Mixer INA2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.96 { + iface MIXER + name 'Right HP Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.97 { + iface MIXER + name 'Right HP Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.98 { + iface MIXER + name 'Left HP Mixer Left DAC1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.99 { + iface MIXER + name 'Left HP Mixer Right DAC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.100 { + iface MIXER + name 'Left HP Mixer Left DAC2 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.101 { + iface MIXER + name 'Left HP Mixer Right DAC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.102 { + iface MIXER + name 'Left HP Mixer MIC1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.103 { + iface MIXER + name 'Left HP Mixer MIC2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.104 { + iface MIXER + name 'Left HP Mixer INA1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.105 { + iface MIXER + name 'Left HP Mixer INA2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.106 { + iface MIXER + name 'Left HP Mixer INB1 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.107 { + iface MIXER + name 'Left HP Mixer INB2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } +} From dacfe128b68b245fe890fd1b5feec5a9096d1a7a Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Thu, 22 Dec 2016 16:06:45 +0100 Subject: [PATCH 31/84] meta-digi-dey: swupdate: add recipes for update packages These recipes allow to generate the .swu update packages to be used with SWUpdate. The packages can be generated using: bitbake dey-image-qt-swu bitbake core-image-base-swu https://jira.digi.com/browse/DEL-3272 Signed-off-by: Diaz de Grenu, Jose --- .../swu-images/core-image-base-swu.bb | 33 +++++++++++++++++++ .../swu-images/dey-image-qt-swu.bb | 33 +++++++++++++++++++ .../swu-images/files/ccimx6/sw-description | 17 ++++++++++ .../swu-images/files/ccimx6ul/sw-description | 17 ++++++++++ 4 files changed, 100 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb create mode 100644 meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb create mode 100644 meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description create mode 100644 meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description diff --git a/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb b/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb new file mode 100644 index 000000000..fbfb9f967 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb @@ -0,0 +1,33 @@ +# Copyright (C) 2016 Digi International. +SUMMARY = "Generate update package for SWUpdate" +SECTION = "base" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = "file://sw-description" + +inherit swupdate + +IMAGE_DEPENDS = "core-image-base" + +SWUPDATE_IMAGES = "core-image-base" + +SOFTWARE_VERSION ?= "0.0.1" + +BOOTFS_EXT ?= ".boot.vfat" +BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" +ROOTFS_EXT ?= ".ext4" +ROOTFS_EXT_ccimx6ul ?= ".ubifs" + +python () { + img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "core-image-base", img_fstypes) +} + +do_unpack[postfuncs] += "fill_description" + +fill_description() { + sed -i -e "s,##BOOTIMG_NAME##,core-image-base-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTIMG_NAME##,core-image-base-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" +} diff --git a/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb b/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb new file mode 100644 index 000000000..7932c1949 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb @@ -0,0 +1,33 @@ +# Copyright (C) 2016 Digi International. +SUMMARY = "Generate update package for SWUpdate" +SECTION = "base" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = "file://sw-description" + +inherit swupdate + +IMAGE_DEPENDS = "dey-image-qt" + +SWUPDATE_IMAGES = "dey-image-qt-${GRAPHICAL_BACKEND}" + +SOFTWARE_VERSION ?= "0.0.1" + +BOOTFS_EXT ?= ".boot.vfat" +BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" +ROOTFS_EXT ?= ".ext4" +ROOTFS_EXT_ccimx6ul ?= ".ubifs" + +python () { + img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "dey-image-qt-" + d.getVar('GRAPHICAL_BACKEND', True), img_fstypes) +} + +do_unpack[postfuncs] += "fill_description" + +fill_description() { + sed -i -e "s,##BOOTIMG_NAME##,dey-image-qt-${GRAPHICAL_BACKEND}-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTIMG_NAME##,dey-image-qt-${GRAPHICAL_BACKEND}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" +} diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description new file mode 100644 index 000000000..7f23803ef --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description @@ -0,0 +1,17 @@ +software = +{ + version = "##SW_VERSION##"; + + images: ( + { + filename = "##BOOTIMG_NAME##"; + device = "/dev/mmcblk0p1"; + types = "raw"; + }, + { + filename = "##ROOTIMG_NAME##"; + device = "/dev/mmcblk0p3"; + types = "raw"; + } + ); +} diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description new file mode 100644 index 000000000..46002c6d0 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description @@ -0,0 +1,17 @@ +software = +{ + version = "##SW_VERSION##"; + + images: ( + { + filename = "##BOOTIMG_NAME##"; + volume = "linux"; + type = "ubivol" + }, + { + filename = "##ROOTIMG_NAME##"; + volume = "rootfs"; + type = "ubivol" + } + ); +} From dbe23328dac7f600793de840f6937c28f2e3a466 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 2 Jan 2017 09:43:48 +0100 Subject: [PATCH 32/84] alsa-state: ccimx6ul: enable speaker right channel The speaker right channel was left disabled in the default configuration. Signed-off-by: Hector Palacios --- .../recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state index e5de02092..128bd3f30 100644 --- a/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state +++ b/meta-digi-arm/recipes-bsp/alsa-state/alsa-state/ccimx6ul/asound.state @@ -758,7 +758,7 @@ state.imxmax98088 { control.69 { iface MIXER name 'Right SPK Mixer Right DAC1 Switch' - value false + value true comment { access 'read write' type BOOLEAN @@ -778,7 +778,7 @@ state.imxmax98088 { control.71 { iface MIXER name 'Right SPK Mixer Right DAC2 Switch' - value false + value true comment { access 'read write' type BOOLEAN From 951f20d36b8575e121a27e5acd7ad68c722a98af Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 2 Jan 2017 13:59:54 +0100 Subject: [PATCH 33/84] pulseaudio: avoid headphone mute when no jack detection Some platforms, like ccimx6ulsbc, don't support jack detection out of the box. PulseAudio will mute the Headphones by default if it believes there is no headphones jack plugged-in. With this patch we tell it to preserve ALSA default value for the headphones controls. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-3435 --- ...headphones-volume-in-platforms-witho.patch | 41 +++++++++++++++++++ .../pulseaudio/pulseaudio_%.bbappend | 7 ++++ 2 files changed, 48 insertions(+) create mode 100644 meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch create mode 100644 meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch new file mode 100644 index 000000000..3652af0e4 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch @@ -0,0 +1,41 @@ +From: Hector Palacios +Date: Mon, 2 Jan 2017 13:11:02 +0100 +Subject: [PATCH] pulseaudio: keep headphones volume in platforms without jack + detection + +Signed-off-by: Hector Palacios +--- + src/modules/alsa/mixer/paths/analog-output-headphones.conf | 4 ++-- + src/modules/alsa/mixer/paths/analog-output-speaker.conf | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf +index b6ee70ba84c5..ddc0918d3a12 100644 +--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf ++++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf +@@ -81,8 +81,8 @@ override-map.2 = all-left,all-right + + [Element Headphone] + required-any = any +-switch = mute +-volume = merge ++switch = on ++volume = ignore + override-map.1 = all + override-map.2 = all-left,all-right + +diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf +index 39193dd8851e..5183be2bbe4f 100644 +--- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf ++++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf +@@ -73,8 +73,8 @@ volume = off + ; This profile path is intended to control the speaker, let's mute headphones + ; else there will be a spike when plugging in headphones + [Element Headphone] +-switch = off +-volume = off ++switch = on ++volume = ignore + + [Element Headphone2] + switch = off diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend new file mode 100644 index 000000000..3ee26fa5c --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -0,0 +1,7 @@ +# Copyright (C) 2017 Digi International + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +SRC_URI_append_ccimx6ulsbc = " file://0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch" + +PACKAGE_ARCH = "${MACHINE_ARCH}" From 034aaa6fb14bc74341bf7839fc7dd59d080f2083 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 3 Jan 2017 10:55:52 +0100 Subject: [PATCH 34/84] psplash: fix init script to avoid running the app without fb This is a clone from the original psplash recipe init script but with the added fix: @@ -25,5 +25,7 @@ read rotation < /etc/rotation fi -/usr/bin/psplash --angle $rotation & +if [ -c "${FBDEV:-/dev/fb0}" ]; then + /usr/bin/psplash --angle $rotation & +fi which avoids running the application when there is no framebuffer in the system. This prevents the following error message during boot: Error opening /dev/fb0: No such file or directory Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-2747 --- .../recipes-core/psplash/files/psplash-init | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 meta-digi-dey/recipes-core/psplash/files/psplash-init diff --git a/meta-digi-dey/recipes-core/psplash/files/psplash-init b/meta-digi-dey/recipes-core/psplash/files/psplash-init new file mode 100755 index 000000000..d3364d371 --- /dev/null +++ b/meta-digi-dey/recipes-core/psplash/files/psplash-init @@ -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 + From f5dac18ae5213649ff37f9198e3e01d76b56a6a4 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 5 Jan 2017 12:00:25 +0100 Subject: [PATCH 35/84] meta-digi-arm: firmware-qualcomm: Match board file and UTF board file. As discovered during certifications preparation work, calibration changes applied only on the bdwlan30.bin file do not take effect. Per QCA guidelines, the bdwlan30.bin and utfbd30.bin files should be the same for the calibration changes to work. This commit removes the current utfbd30.bin file, with an md5sum that matches the original bdwlan30.bin file in QCA's chipcode qca6564-le-1-0-3_qca_device repository, and creates a symbolic link to the actual bdwlan30.bin board file used to certify Digi's module internal antenna. https://jira.digi.com/browse/DEL-3454 Signed-off-by: Alex Gonzalez --- .../firmware-qualcomm/firmware-qualcomm.bb | 2 -- .../firmware-qualcomm/utfbd30.bin | Bin 8124 -> 0 bytes .../kernel-module-qualcomm/qualcomm-pre-up | 6 ++++-- 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/utfbd30.bin diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb index 8a4a37940..517869ccf 100644 --- a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb +++ b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb @@ -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 \ diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/utfbd30.bin b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/utfbd30.bin deleted file mode 100644 index dfd6a46343a97329173ab2ffc1f204268a9e938a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8124 zcmeHMdr(tn7QX?l#Uc_6$Q7aqTq)s^5)eo(C~ZwR@Q4>lavcyTcAJ`KjfV5Mz?i$G9_VH+?n*m5}B(ud1PQ# z3dc*3>Wz|n7L9c$)W88Etq3)Htc&z&=A4k=jfuQ`u(2^8%pZQxT7h9)KIl7l?)2R) z2;-p(yCPA98#g@1|5mSL<~KC-^n88+CSZa*?&< znOk!xdF1H$$b_*aM=g(GfbsE>F>_NXC655$7yv-=0CsbeMkyyok28Q$E@DHCj~q2O z=VZ$_LVd65TcirfdKNgz^dU!m^dDiWa+ix5Y?fv*eY{%Q3VpEU4%?x@76dT6HYw$9 z5NbINwdBd8A^C){70Qift2zeddip@+=E|cOz<#EqOQWIq%D>xBckIyQQMmHL&6_a9 z-`nDs5!K=*(n599gO*|2sAJsqM}8hrD6Syus8;$#ORsH@C|^UAiVdWR+D3O-cG_NY9CRJ!=MWmPjx z^ma>^ZKva9*CFuLip#*a$?f}!>o7l?$QPH8Rg{r7TRLq0j(sj0UqPtEMPvn4N4HpZ z*m@m%T>JT1gj!q-yau{$o|i^siSx-4N>3XtW?P4&-!;VWP&~wIxAi&px(@JDh)i)V zSxC`zt)<1b!_ni~19{buSMSa{z~q$?a9kA3`nqC~7G zjg*=0wDjBdF*D61l;W*qIaNzHTVAkP9lKqx@C%4CaW&aUS?F%dF59r=-_1A3yo};b0s|O&DU&Q8_s0VaJ=!Lj8efg`+<>+jj{Z2;)U9ilLp4HBt|vzy@HBWJ9>^p| zWy~jU0U!Y9L5@ZUd3SZ?0OubqY9Q~j{m@f4348EGpu}e~nZ}eHtxdk2uSu7qP@@6~VB`X)k`*{0! zZ|l-lN@9gvoWlY;WwcO&fPn!3Vub!UwgANYc=>oS9`^v1!c9KQeU=aOYdeH%Bx3Fl zjEAX@Y7vq62JY(44qcs$6yf+U9-v7it{>O0vs+g$ zi57*plS8NmQ6i3WeZZqymMmN;T*-JW{epz)F1;R4VCh;PwG};>waYNqvCgrv`!k*(4?6*VFd-C2lL=HRt+1$Ug^mhWz1z0w9@|<%AdUiF3Y}@m z1s?6H1KzJ~L5wY)A{pLRhR6CMTL$=Ub(Dke{dgi$!tj*9LpcJ8^Qj0$?9@A& znGyj{6p|307OjqN+PquwTJD8{>pCJJ7Ecx`L{*z!NPRhTQaPn{l{~xdxv&(GN>U-+ zo_ZX*Vi5A zAven&Vl8#I{DXq=5Po`A4wai1mn4;?Y(^{|6A{T_-R4)!BcJ|!c#h2=QZ=h4iE0^T5Ly5 z_LtQR3$~u+!I`raQLXHCUL)^?wScqsr6&2r_WPayyq1l__VJ4zeZ%>0=k)b&ozvG` z&S~eBsp+r31-a^x>6veCT${P_{k0kA9O&6=(^qC^roRSpxTe&5r4(tYG Date: Thu, 5 Jan 2017 13:41:25 +0100 Subject: [PATCH 36/84] meta-digi-arm: firmware-qualcomm: Update board calibration files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These have been provided by the embedded hardware team and they are to be used for certification testing. The calibration corresponds to the internal antenna on the module. If using the current external antenna on the CC6UL SBC they work fine, although they could be tweaked to improve. The BDF files provided were generated from the original ones, by running a test tree for output power calibration for QCA6564A-3 chip. This test tree is called ‘FCCSP_Rome3.x_WLAN_CLPC_cal_and_WLAN_BT_Verify_Y8611-H341.xtt’ and it belongs to the Qualcomm Design Package ‘DP25-WL420-100’. The test tree is to be run in the QSPR software tool, part of the QDART software tools set provided by Qualcomm. Signed-off-by: Alex Gonzalez --- .../firmware-qualcomm/bdwlan30_US.bin | Bin 8124 -> 8124 bytes .../firmware-qualcomm/bdwlan30_World.bin | Bin 8124 -> 8124 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/bdwlan30_US.bin b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/bdwlan30_US.bin index 0f583c7139dd78be1205a2cc4cad41010b310ac5..fd6ffaeb37f8ea00d8dde905dfe9de70b13ef3ce 100644 GIT binary patch delta 1913 zcmZ9IOHdPc9LGT*ZxTWX$p$tdVM($eOO{7qS0oQY$U-1l6b*Fcp@>A}xyn-r(5mqX zt4!U>Vy82<(~~o;oo1ZcUV7-Yhu(YJYfqhFYRC4Uhm7s{^Z9+h-~a!O=Z&ZEjiqz> zn?n9XLU_#YZ_UNJ=^Ekr-oeWCP@fMyIy&6X6FC0K)+_+X{h5b1@%n5e|3(?C7N(S#XzskerEmXjnMh*JN(_` zbgZ4O*gpV!=R#qhGYf923ju&VDNmX@BQE{ zerJ!3HPbrq5+O4-f3`9YW~EDB{a&EVPe=?>i_{@+P_?Q(x^80x zK3_8m2a$g4963r|VdmInZYz}(ISC}KlA;Qis!ii93mK#481Mo}7&}Wc)C4ob-rzP; zx5bA=AW!CyfxMDj9x@915ege1hp9`0rCZaX3mW_3b2THd z7YSiBIYeD#uCj~VT53nUmloxA8CL8r0Up$EIahNb<3)it&crj`$Krz`y%d(!DC&z_ zH0`>8A#5H*m|R{Ac-cJQ6_!d&3Y#2N;TodUmoQM3bj|Sb!i$-OH^IV(g(VWBtV-cj zxk}n}UPB0uR-cDEksjzNntN{S_*T8=2{H7%v>`anh4HkkRDL2`teWM* zP40H;k@&QrphzjvNlkK_vQFJtN|yU8d*MFdjgXVCM2WvJarfrxwILceqVm<7LleGk zRA-eP9ew#UF9!^`VRe1{G6355U}JTb4&e~0*j~?EXrR38#m4GPHfnn#1GG7?y}U3* zhtXoZa$$YwGU2tVk3nK#nvS3)xMg938YKdd5>jTez{xb-k809@z6gKeqsVSyrRL z41}fIK8`OF``&N6f9r?K5g4&C*PS-?+Ag4r_#@(L4_ty6u`1F@;S2$adr|`;Q;}ztp_*nx$acQ= z8h)F2;r%&y?74vF<){=b4wwFE%CpFvnnpv1rO!T!EwwyshZEWl0)0Rn5QnsXKyS?_ z>~fd39qO(6$T{C|$NitctT$|WYs*LFq@IFf$n42v(^sc{@d3|(nMpgPTP7G^}#-_`=Bvboe_3fsofW&8>8 z(gUlrVkR)>RlKW~)s?u70n1rOykX1zdB;xyScT{_#TeseJGfvfBF3P1)pE3?$>^<$ cIxaP=wSL<1T^A@W!(cG5KI6U0*ZrXS7xwjSHvj+t delta 1913 zcmZ9JYgZFT9LBL)j~7rWc-iWzDdQy|cu4m8MrtiIXSVK&57AA!(OuS z&-T6BOw|tt;0TK11evF4_QHC@^Qss0!T~glC&(22fh}7L`GNBurx_o3R%7({jR5nQ&1gd{s2;D;my7 z!#3c9x8=og`bb{zpU16`SRsNgWBWK4q_|DcHW;z)j$1U#N?w#|Cp@`P$u5sah>}gl_Dtn#nb{Ma_#ukiGA?#81lmt7B z6!4IzP1#jivK)#EL0H97c-+&e>{s?X6G^e%5tfXt!gSIYGc{dUe;Hdc#ylNLl~Uzg zl9sWY?O{)AdHb}8B|a;a%2>*n@aQhJ+PPf__dS};O{a{A$1ALyLy8l7l-=SGdxw~n zJA^Q%d8^&EF1z^&PrK`gykz6g%D=ap>M?K%LUa{3kxuGocdcO_RSy9bo<H?h3YI|h4`piEx2z`J-$Q`ZDn1OI}DD)Ga~dg(o8!==%C=f`i#3R{2cDQ!EC(&7ak$A*npVcS0gP*k3D_R&ZMd{Fw? z0i9MI&aB>Is0px-hdx{E)W6lx;RZ!p$KWZ{Sgzl$^#C{wkE7H0Jh?`jnQjGyUv0Vm zTjlzzz#(`7oiXtRa$O{JK)ZhXJ)L*zmhZIB0i|JyE7f{gyl3f|D#1ay7?P{BiFqwQ f4~qKjRvY9qwaI6?r&fVlsEUA%lH1r;^H=46Yv;JL diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/bdwlan30_World.bin b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/bdwlan30_World.bin index 4a3e0f66c27eea0a59b5ab79341677437cdba0cf..e3a4b047477f42ac36f1d169f4019a89e33ace5f 100644 GIT binary patch delta 1913 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 d`t4R5 Date: Thu, 29 Dec 2016 18:26:39 +0100 Subject: [PATCH 37/84] meta-digi-dey: pulseaudio: load HDMI sink on hotplug When hotplugging the HDMI cable after booting the target, pulseaudio doesn't load the HDMI sink. This commit fixes this by adding a udev rule and a script that prompts pulseaudio to detect the HDMI sound card and load its sink, as well as making it the default one. If alsa-utils is available, a faulty command is run to load the card without any audio output. Otherwise, module-udev-detect is unloaded and reloaded. This is based on commit fca507d316ded1e3126ba6db265b7fe871550fae. https://jira.digi.com/browse/DEL-2327 Signed-off-by: Gabriel Valcazar --- .../pulseaudio/pulseaudio/hdmi_hotplug.sh | 44 +++++++++++++++++++ .../pulseaudio/pulseaudio_%.bbappend | 11 +++++ 2 files changed, 55 insertions(+) create mode 100644 meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh new file mode 100644 index 000000000..78a29786d --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh @@ -0,0 +1,44 @@ +#!/bin/sh +#=============================================================================== +# +# hdmi_hotplug.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: HDMI hotplug script called from udev on HDMI plug/unplug event +# +#=============================================================================== + +# Find HDMI card number +for card in /sys/class/sound/card*; do + if readlink "${card}/device" | grep -qs hdmi; then + HDMI_CARD="${card##/sys/class/sound/card}" + break + fi +done + +# On HDMI plugin event, if the sink has not been loaded yet, load the +# HDMI audio sink from ALSA +if [ "${EVENT}" = "plugin" ]; then + if ! pactl list sinks | grep -qs "imx-hdmi-soc"; then + if which aplay; then + # Run a command that always fails but loads + # pulseaudio HDMI sink/card as a side effect + aplay / -D "hw:${HDMI_CARD}" + else + # Unload and reload the detection module + pactl unload-module module-udev-detect + pactl load-module module-udev-detect tsched=0 + fi + + # Set HDMI as default sink + pactl set-default-sink "$(pactl list sinks | grep -i 'Name:.*hdmi' | cut -d ' ' -f2)" + fi +fi + diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend index 3ee26fa5c..f83abe9dd 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -3,5 +3,16 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI_append_ccimx6ulsbc = " file://0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch" +SRC_URI_append_ccimx6sbc = " file://hdmi_hotplug.sh" + +do_install_append_ccimx6sbc() { + install -d ${D}${sysconfdir}/udev/scripts + install -m 0755 ${WORKDIR}/hdmi_hotplug.sh ${D}${sysconfdir}/udev/scripts + + cat >> ${D}${base_libdir}/udev/rules.d/90-pulseaudio.rules <<-_EOL_ + + SUBSYSTEM=="platform", KERNEL=="*hdmi_video", ACTION=="change", RUN+="/etc/udev/scripts/hdmi_hotplug.sh" + _EOL_ +} PACKAGE_ARCH = "${MACHINE_ARCH}" From f787a22ef1a529fb26f3212b2a29f9015861b0d5 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 10 Jan 2017 19:35:38 +0100 Subject: [PATCH 38/84] u-boot-fw-utils: add patch with minimal U-Boot environment API Implements functions to get and set variables from U-Boot's environment. https://jira.digi.com/browse/DEL-3358 Signed-off-by: Javier Viguera --- ...-U-Boot-environment-access-functions.patch | 146 ++++++++++++++++++ .../u-boot/u-boot-fw-utils_%.bbappend | 3 + 2 files changed, 149 insertions(+) create mode 100644 meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-Implement-U-Boot-environment-access-functions.patch diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-Implement-U-Boot-environment-access-functions.patch b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-Implement-U-Boot-environment-access-functions.patch new file mode 100644 index 000000000..0a18c6598 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0004-Implement-U-Boot-environment-access-functions.patch @@ -0,0 +1,146 @@ +From: Javier Viguera +Date: Tue, 10 Jan 2017 19:34:26 +0100 +Subject: [PATCH] Implement U-Boot environment access functions + +Signed-off-by: Javier Viguera +--- + 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 ++ ++#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 */ diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend index e06cfdfc9..f584c707a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend @@ -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}/ } From 9c3f8245e13c65efc152e212ada268060531c6ea Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 11 Jan 2017 17:51:07 +0100 Subject: [PATCH 39/84] meta-digi-dey: add new 'recovery-utils' recipe recovery-utils allows to configure recovery commands and reboot into recovery mode. Internal recovery-utils.git SHA1: 5555d4c736e3 https://jira.digi.com/browse/DEL-3358 Signed-off-by: Javier Viguera --- .../packagegroups/packagegroup-dey-core.bb | 1 + .../recipes-core/recovery/recovery-utils.bb | 17 ++ .../recovery-utils/recovery-utils/Makefile | 29 +++ .../recovery-utils/recovery-utils/README.md | 13 ++ .../recovery-utils/include/recovery.h | 50 +++++ .../recovery-utils/lib/Makefile | 35 ++++ .../recovery-utils/lib/recovery.c | 141 +++++++++++++ .../recovery-utils/lib/recovery.pc | 13 ++ .../recovery-utils/recovery-reboot/Makefile | 47 +++++ .../recovery-reboot/recovery-reboot.c | 198 ++++++++++++++++++ 10 files changed, 544 insertions(+) create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils.bb create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/Makefile create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/README.md create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/Makefile create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.pc create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile create mode 100644 meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index 7b6c6baa7..dbe3987d2 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -39,6 +39,7 @@ RDEPENDS_${PN} = "\ modutils-initscripts \ netbase \ os-release \ + recovery-utils \ sysinfo \ usbutils \ ${VIRTUAL-RUNTIME_dev_manager} \ diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils.bb b/meta-digi-dey/recipes-core/recovery/recovery-utils.bb new file mode 100644 index 000000000..d8e2f0009 --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils.bb @@ -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 +} diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/Makefile b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/Makefile new file mode 100644 index 000000000..1fbf05f6a --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/Makefile @@ -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 diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/README.md b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/README.md new file mode 100644 index 000000000..013bd2e1c --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/README.md @@ -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. diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h new file mode 100644 index 000000000..4f7dfddb3 --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h @@ -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 */ diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/Makefile b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/Makefile new file mode 100644 index 000000000..dc2f89823 --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/Makefile @@ -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) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c new file mode 100644 index 000000000..491a443d3 --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c @@ -0,0 +1,141 @@ +/* + * 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 + * + */ + +#include +#include +#include +#include +#include + +#include + +/* + * 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 ret = -1; + + /* Verify input parameter */ + if (!swu_path) { + fprintf(stderr, "Error: NULL 'swu_path'\n"); + goto err; + } + + fwupdate_cmd = + calloc(1, strlen("update_package=") + strlen(swu_path) + 1); + if (!fwupdate_cmd) { + fprintf(stderr, "Error: calloc 'fwupdate_cmd'\n"); + goto err; + } + + sprintf(fwupdate_cmd, "update_package=%s", 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"); +} diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.pc b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.pc new file mode 100644 index 000000000..f5e8cc36b --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.pc @@ -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} diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile new file mode 100644 index 000000000..fbb89852d --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile @@ -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) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c new file mode 100644 index 000000000..d1e49bd44 --- /dev/null +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c @@ -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 +#include +#include +#include + +#include + +#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] []\n\n" \ + " -u --update-firmware Perform firmware update\n" \ + " -w --wipe-update-partition Wipe 'update' partition\n" \ + " -T --reboot-timeout= Reboot after N seconds (default %d)\n" \ + " --help Print help and exit\n" \ + "\n" \ + " 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] \n\n" \ + " -T --reboot-timeout= Reboot after N seconds (default %d)\n" \ + " --help Print help and exit\n" \ + "\n" \ + " 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; +} From 21209d4f3631e094df190614ced8b0e52ed543ea Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Mon, 9 Jan 2017 17:22:37 +0100 Subject: [PATCH 40/84] meta-digi-arm: kernel-module-qualcomm: Pass BUILD_DEBUG_VERSION to kbuild. Otherwise the module is built with debug as that is the Makefile's default. https://jira.digi.com/browse/DEL-3392 Signed-off-by: Alex Gonzalez --- .../kernel-module-qualcomm.bb | 1 + ...BUILD_DEBUG_VERSION-to-kbuild-system.patch | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index 01f4afe47..1d962cfdc 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -37,6 +37,7 @@ SRC_URI = " \ file://0018-wlan_hdd_main-initialize-all-adapter-completion-vari.patch \ file://0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch \ file://0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch \ + file://0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch \ " S = "${WORKDIR}/${PV}" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch new file mode 100644 index 000000000..cb1d3be24 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch @@ -0,0 +1,23 @@ +From: Alex Gonzalez +Date: Mon, 9 Jan 2017 16:51:17 +0100 +Subject: [PATCH] Makefile: Pass BUILD_DEBUG_VERSION to kbuild system. + +https://jira.digi.com/browse/DEL-3392 + +Signed-off-by: Alex Gonzalez +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile b/Makefile +index c05b00f26c57..25cec85a0c1e 100644 +--- a/Makefile ++++ b/Makefile +@@ -16,6 +16,7 @@ KBUILD_OPTIONS += CONFIG_QCA_WIFI_ISOC=0 + KBUILD_OPTIONS += CONFIG_QCA_WIFI_2_0=1 + KBUILD_OPTIONS += $(WLAN_SELECT) + KBUILD_OPTIONS += WLAN_OPEN_SOURCE=$(WLAN_OPEN_SOURCE) ++KBUILD_OPTIONS += BUILD_DEBUG_VERSION=$(BUILD_DEBUG_VERSION) + KBUILD_OPTIONS += $(KBUILD_EXTRA) # Extra config if any + + all: From 6be939c535b605479a4fef705767e0e68e34c2b8 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 16 Dec 2016 17:30:36 +0100 Subject: [PATCH 41/84] meta-digi-arm: firmware-qualcomm: qcom_cfg.ini: Remove unused entries. The following document, JQCA61x4, QCA65x4, and QCA937x Configuration Parameters Specification 80-Y7674-11 Rev. J September 30, 2016 Contains a list of unused configuration arguments in page 29. This commit removes those listed arguments that appeared on the default configuration file to avoid confusion. Signed-off-by: Alex Gonzalez --- .../firmware-qualcomm/wlan/qcom_cfg.ini | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini index fff4052f0..4900c1c45 100644 --- a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini +++ b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini @@ -7,8 +7,6 @@ gEnableRxThread=1 -gEnableIdleScan=0 - # Increase sleep duration (seconds) during IMPS # 0 implies no periodic wake up from IMPS. Periodic wakeup is @@ -29,12 +27,6 @@ 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 +95,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 From 905ac5c4832eeab4ab1a3dae57f49fc23d7cb369 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Mon, 19 Dec 2016 18:29:01 +0100 Subject: [PATCH 42/84] meta-digi-arm: firmware-qualcomm: qcom_cfg.ini: Add debug bitmasks Document as comments the enabling of the debug modules and levels Signed-off-by: Alex Gonzalez --- .../firmware-qualcomm/wlan/qcom_cfg.ini | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini index 4900c1c45..65e9089ad 100644 --- a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini +++ b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini @@ -2,6 +2,33 @@ # 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 From caa932612de24d7f27013750da96665c59971c0e Mon Sep 17 00:00:00 2001 From: Alejandro Navarro Date: Mon, 16 Jan 2017 11:24:18 +0100 Subject: [PATCH 43/84] mca_tool: update checksums for the new version Signed-off-by: Alejandro Navarro https://jira.digi.com/browse/DEL-3499 --- .../recipes-digi/mca/{mca-tool_1.0.bb => mca-tool_1.1.bb} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename meta-digi-arm/recipes-digi/mca/{mca-tool_1.0.bb => mca-tool_1.1.bb} (67%) diff --git a/meta-digi-arm/recipes-digi/mca/mca-tool_1.0.bb b/meta-digi-arm/recipes-digi/mca/mca-tool_1.1.bb similarity index 67% rename from meta-digi-arm/recipes-digi/mca/mca-tool_1.0.bb rename to meta-digi-arm/recipes-digi/mca/mca-tool_1.1.bb index 0374451dc..4335a74b8 100644 --- a/meta-digi-arm/recipes-digi/mca/mca-tool_1.0.bb +++ b/meta-digi-arm/recipes-digi/mca/mca-tool_1.1.bb @@ -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] = "a08dd404f7c5165b6949ae09117a27d3" +SRC_URI[sha256sum] = "6978e481cbd936f03e93f3c566cc506570ebae82b3b499a79da65c3c2d320191" S = "${WORKDIR}/${PKGNAME}-${PV}" From 77d07b8ed702100ee787022a879ab6332fbf92f7 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 16 Jan 2017 17:09:39 +0100 Subject: [PATCH 44/84] packagegroup-dey-gstreamer: remove plugins-bad/ugly for CC6UL The CC6UL has little video capabilities and reduced storage memory so lets remove gstreamer plugins included in -bad and -ugly to reduce the rootfs size. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DUB-713 --- .../packagegroups/packagegroup-dey-gstreamer.bb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-gstreamer.bb b/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-gstreamer.bb index e6840982f..b8bd34829 100644 --- a/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-gstreamer.bb +++ b/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-gstreamer.bb @@ -9,15 +9,17 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" inherit packagegroup MACHINE_GSTREAMER_1_0_EXTRA_INSTALL ?= "" -MACHINE_GSTREAMER_1_0_EXTRA_INSTALL_mx6 ?= "gstreamer1.0-rtsp-server-examples" +MACHINE_GSTREAMER_1_0_EXTRA_INSTALL_mx6 ?= " \ + gstreamer1.0-plugins-bad-meta \ + gstreamer1.0-plugins-ugly-meta \ + gstreamer1.0-rtsp-server-examples \ +" RDEPENDS_${PN} = " \ gstreamer1.0-meta-audio \ gstreamer1.0-meta-video \ gstreamer1.0-plugins-base-meta \ gstreamer1.0-plugins-good-meta \ - gstreamer1.0-plugins-ugly-meta \ - gstreamer1.0-plugins-bad-meta \ ${MACHINE_GSTREAMER_1_0_EXTRA_INSTALL} \ ${MACHINE_GSTREAMER_1_0_PLUGIN} \ " From 5c0627a517860b40b27eaaf899a4518ebbb7d1ea Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 16 Jan 2017 17:13:35 +0100 Subject: [PATCH 45/84] gstreamer1.0-plugins-good: add support for VP8 enc/dec VP8 is an open royalty-free video compression format by Google Inc. Signed-off-by: Hector Palacios --- .../gstreamer/gstreamer1.0-plugins-good_1.4.5.bbappend | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bbappend index e88f07949..76d926783 100644 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bbappend +++ b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bbappend @@ -3,3 +3,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" SRC_URI += "file://aacparse-Fix-aacparse-error-tolerance-issue.patch" + +PACKAGECONFIG_append = " vpx" From 6851ab23e4184bc1e9ab87de1ecad4666491ec17 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 17 Jan 2017 13:28:53 +0100 Subject: [PATCH 46/84] ccimx6ul: synchronize kernel defconfig This updates the kernel configuration to the latest one which disables unused drivers and options to optimize the kernel size. Signed-off-by: Hector Palacios --- .../linux/linux-dey-4.1/ccimx6ul/defconfig | 93 ++++++------------- 1 file changed, 26 insertions(+), 67 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig index ad0a5084b..53b280c93 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig @@ -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,32 +95,19 @@ 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 CONFIG_BLK_DEV_RAM_SIZE=65536 CONFIG_EEPROM_AT24=y 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 +115,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 +134,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 +165,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 +177,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 @@ -214,6 +188,7 @@ CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VIDEO_MXC_OUTPUT=y CONFIG_VIDEO_MXC_CAPTURE=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 @@ -221,22 +196,16 @@ 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,7 +216,8 @@ 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_ESAI=y @@ -261,7 +231,6 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_MXC=y CONFIG_USB_HCD_TEST_MODE=y CONFIG_USB_ACM=m -CONFIG_USB_STORAGE=y CONFIG_USB_CHIPIDEA=y CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_CHIPIDEA_HOST=y @@ -326,24 +295,12 @@ 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 @@ -360,13 +317,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 From 5ff236584da8df5cac6fbccac8cc93890d4efc91 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 17 Jan 2017 10:24:41 +0100 Subject: [PATCH 47/84] meta-digi-dey: add confuse library recipe libConfuse is a configuration file parser library. https://jira.digi.com/browse/DEL-3368 Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-support/confuse/confuse_3.0.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 meta-digi-dey/recipes-support/confuse/confuse_3.0.bb diff --git a/meta-digi-dey/recipes-support/confuse/confuse_3.0.bb b/meta-digi-dey/recipes-support/confuse/confuse_3.0.bb new file mode 100644 index 000000000..c6fe89eda --- /dev/null +++ b/meta-digi-dey/recipes-support/confuse/confuse_3.0.bb @@ -0,0 +1,12 @@ +# Copyright (C) 2017, Digi International Inc. + +SUMMARY = "Configuration file parser library" +SECTION = "libs" +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ef0220292b0cce0a53f5faff0d1f102a" + +SRC_URI = "https://github.com/martinh/libconfuse/releases/download/v${PV}/confuse-${PV}.tar.gz" +SRC_URI[md5sum] = "bf03099ef213647451c70e54ad4b6e81" +SRC_URI[sha256sum] = "f1f326d9443103036d19c32d3f3efec3a85c3b081d99534463668d29992c4648" + +inherit autotools gettext From a63d5e6c31dd0dfad8309a7367d14a602ff26a28 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 17 Jan 2017 10:25:13 +0100 Subject: [PATCH 48/84] meta-digi-dey: add cloud connector recipe This includes library and example application https://jira.digi.com/browse/DEL-3368 Signed-off-by: Javier Viguera --- .../packagegroups/packagegroup-dey-core.bb | 1 + .../cloudconnector/cloudconnector_git.bb | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index dbe3987d2..ab8f2f455 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -32,6 +32,7 @@ RDEPENDS_${PN} = "\ busybox \ busybox-acpid \ busybox-static-nodes \ + cloudconnector-bin \ ${@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)} \ diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb new file mode 100644 index 000000000..d300aacf7 --- /dev/null +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -0,0 +1,30 @@ +# 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 zlib" + +SRCREV = "${AUTOREV}" + +SRC_URI = "gitsm://git@stash.digi.com/cc/cc_dey.git;protocol=ssh" + +S = "${WORKDIR}/git" + +do_install() { + oe_runmake DESTDIR=${D} install +} + +PACKAGES =+ "${PN}-bin ${PN}-cert" + +FILES_${PN}-bin += "${sysconfdir}/cc.conf" +FILES_${PN}-cert = "${sysconfdir}/ssl/certs/Digi_Int-ca-cert-public.crt" + +CONFFILES_${PN}-bin += "${sysconfdir}/cc.conf" + +DEBIAN_NOAUTONAME_${PN}-bin = "1" + +RDEPENDS_${PN} = "${PN}-cert" +RDEPENDS_${PN}-bin = "${PN}-cert" From b3e628dbf3997ad8099be56afc5c0337e003cbfb Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 17 Jan 2017 16:02:09 +0100 Subject: [PATCH 49/84] swupdate: fix typo in description file The attribute supported in the description file is 'type' (in singular), not 'types'. Signed-off-by: Javier Viguera --- .../recipes-digi/swu-images/files/ccimx6/sw-description | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description index 7f23803ef..6dc163358 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description @@ -6,12 +6,12 @@ software = { filename = "##BOOTIMG_NAME##"; device = "/dev/mmcblk0p1"; - types = "raw"; + type = "raw"; }, { filename = "##ROOTIMG_NAME##"; device = "/dev/mmcblk0p3"; - types = "raw"; + type = "raw"; } ); } From 29af4bb0885528d27c3fb05fbcd1ced64131ca09 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 17 Jan 2017 18:23:33 +0100 Subject: [PATCH 50/84] kernel-module-qualcomm: remove virtual/kernel dependence The dependence on virtual/kernel is added implicitly through the module class, so there is no need to add it explicitly. Signed-off-by: Javier Viguera --- .../kernel-module-qualcomm/kernel-module-qualcomm.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index 1d962cfdc..ccb19c12f 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -4,7 +4,6 @@ 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 From 6269b20c9c6648c7503812c4ba7ceb9204a3c456 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 17 Jan 2017 18:24:05 +0100 Subject: [PATCH 51/84] kernel-module-qualcomm: cosmetic, no functional change According to openembedded coding style. Signen-off-by: Javier Viguera --- .../kernel-module-qualcomm/kernel-module-qualcomm.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index ccb19c12f..0ee63dfed 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -5,8 +5,6 @@ DESCRIPTION = "qcacld-2.0 module.bbclass mechanism." LICENSE = "ISC" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d" -inherit module - CAF_MIRROR = "git://codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-2.0" PV = "v4.2.79.63" SRCBRANCH = "caf-wlan/QCA6564_LE_1.0.3_LA.4.2.2.3" @@ -41,6 +39,8 @@ SRC_URI = " \ 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 @@ -50,7 +50,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() { From 9448e9d994e4f3143642cca054dfccb9cfe311b7 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 17 Jan 2017 18:24:37 +0100 Subject: [PATCH 52/84] ccardimx28: add missing leading space for append operator Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/include/ccardimx28.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-arm/conf/machine/include/ccardimx28.inc b/meta-digi-arm/conf/machine/include/ccardimx28.inc index 115fb2a86..b7198a6a6 100644 --- a/meta-digi-arm/conf/machine/include/ccardimx28.inc +++ b/meta-digi-arm/conf/machine/include/ccardimx28.inc @@ -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 ?= "" From c52de54ac033de5a5082ea95413730841e10503b Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 18 Jan 2017 10:52:00 +0100 Subject: [PATCH 53/84] ccimx6ul: synchronize kernel defconfig This re-enables USB mass storage support that was unintentionally removed in commit 6851ab23e4184bc1e9ab87de1ecad4666491ec17. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DUB-713 --- .../recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig index 53b280c93..d00b7da03 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey-4.1/ccimx6ul/defconfig @@ -103,6 +103,9 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=65536 CONFIG_EEPROM_AT24=y CONFIG_EEPROM_AT25=y +CONFIG_SCSI=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y CONFIG_NETDEVICES=y # CONFIG_NET_VENDOR_ARC is not set # CONFIG_NET_CADENCE is not set @@ -231,6 +234,7 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_MXC=y CONFIG_USB_HCD_TEST_MODE=y CONFIG_USB_ACM=m +CONFIG_USB_STORAGE=y CONFIG_USB_CHIPIDEA=y CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_CHIPIDEA_HOST=y From f9096d43e60d91652acf688ad5d27b6b2cc89c6e Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 18 Jan 2017 17:51:26 +0100 Subject: [PATCH 54/84] cloudconnector: prevent certificate package being renamed This avoids the certificate package being generated according to Debian rules (libcloudconnector-cert). Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index d300aacf7..2c5b1f3d4 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -25,6 +25,7 @@ FILES_${PN}-cert = "${sysconfdir}/ssl/certs/Digi_Int-ca-cert-public.crt" CONFFILES_${PN}-bin += "${sysconfdir}/cc.conf" DEBIAN_NOAUTONAME_${PN}-bin = "1" +DEBIAN_NOAUTONAME_${PN}-cert = "1" RDEPENDS_${PN} = "${PN}-cert" RDEPENDS_${PN}-bin = "${PN}-cert" From 255030e94ccfdd1c8fd0f651b23238c91cce5d45 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 18 Jan 2017 17:41:34 +0100 Subject: [PATCH 55/84] meta-digi-arm: firmware-qualcomm: qcom_cfg.ini: Recover gRoamingTime Even though this variable is documented as unused, removing it fails wireless regression tests. https://jira.digi.com/browse/DEL-3501 Signed-off-by: Alex Gonzalez --- .../firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini index 65e9089ad..1aaa184f7 100644 --- a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini +++ b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm/wlan/qcom_cfg.ini @@ -54,6 +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 From 368a3b59901e9bb3303725f639f6ef887284a0bd Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Mon, 2 Jan 2017 15:31:13 +0100 Subject: [PATCH 56/84] meta-digi-dey: add dey-examples-cloud-connector These examples can be used to test Device Cloud functionality. There are three test applications available: * device_request_listener: Listen for requests from the Device Cloud * upload_data_points: Upload test data points to the Device Cloud * upload_file: Uploads the contents of a file as binary data points https://jira.digi.com/browse/DEL-3305 https://jira.digi.com/browse/DEL-3309 https://jira.digi.com/browse/DEL-3397 Signed-off-by: Diaz de Grenu, Jose --- .../dey-examples-cloudconnector.bb | 18 +++ .../files/cloudconnector_test/Makefile | 27 ++++ .../device_request_listener/Makefile | 38 +++++ .../device_request_listener/device_request.c | 88 +++++++++++ .../device_request_listener/device_request.h | 35 +++++ .../device_request_listener/main.c | 106 +++++++++++++ .../upload_data_points/Makefile | 38 +++++ .../upload_data_points/data_point.c | 143 ++++++++++++++++++ .../upload_data_points/data_point.h | 30 ++++ .../upload_data_points/main.c | 116 ++++++++++++++ .../cloudconnector_test/upload_file/Makefile | 38 +++++ .../cloudconnector_test/upload_file/main.c | 86 +++++++++++ .../packagegroup-dey-examples.bb | 2 + 13 files changed, 765 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/Makefile create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile create mode 100644 meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb new file mode 100644 index 000000000..7a1643281 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb @@ -0,0 +1,18 @@ +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" + +do_install() { + oe_runmake DESTDIR=${D} install +} + +RDEPENDS_${PN} = "cloudconnector-cert" + +COMPATIBLE_MACHINE = "(ccimx6$|ccimx6ul)" diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/Makefile new file mode 100644 index 000000000..989acb8a6 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/Makefile @@ -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 diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile new file mode 100644 index 000000000..4ebffe73e --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile @@ -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 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) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c new file mode 100644 index 000000000..cf74e209e --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.c @@ -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 +#include +#include +#include + +#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); +} diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h new file mode 100644 index 000000000..26951204f --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/device_request.h @@ -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 + +#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_ */ diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c new file mode 100644 index 000000000..f2aee82f5 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/main.c @@ -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 +#include +#include +#include +#include + +#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): + * + * + * + * + * + * + * + * + * + * + * + * + */ + +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; +} diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile new file mode 100644 index 000000000..6e01b0f6f --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile @@ -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 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) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c new file mode 100644 index 000000000..b5f9428c9 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.c @@ -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 +#include +#include + +#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); +} diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h new file mode 100644 index 000000000..5b66bb181 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/data_point.h @@ -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 + +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_ */ diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c new file mode 100644 index 000000000..857b07b49 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/main.c @@ -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 +#include +#include +#include + +#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; +} diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile new file mode 100644 index 000000000..3478cf988 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile @@ -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 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) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c new file mode 100644 index 000000000..e7d90c595 --- /dev/null +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c @@ -0,0 +1,86 @@ +/* + * 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 +#include +#include +#include + +#define UNUSED_ARGUMENT(a) (void)(a) + +#define STREAM_NAME "examples/uploaded_file" + +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, argv[0], 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; +} diff --git a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb index c7147fb14..5df5449fb 100644 --- a/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb +++ b/meta-digi-dey/recipes-digi/packagegroups/packagegroup-dey-examples.bb @@ -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 \ @@ -40,6 +41,7 @@ RDEPENDS_${PN}_append_ccimx6ul = "\ ${@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 \ " From 2771549da3bdb92cc6e34522d609f880c524d6cc Mon Sep 17 00:00:00 2001 From: David Escalona Date: Fri, 20 Jan 2017 10:54:16 +0100 Subject: [PATCH 57/84] uboot: install_script: add recovery image and wipe_update to DEY install script https://jira.digi.com/browse/DEL-3513 Signed-off-by: David Escalona --- .../ccimx6/install_linux_fw_sd.txt | 31 ++++++++++++------ .../ccimx6ulsbc/install_linux_fw_sd.txt | 32 +++++++++++++------ .../ccimx6ulstarter/install_linux_fw_sd.txt | 32 +++++++++++++------ 3 files changed, 66 insertions(+), 29 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt index 6b6cad2cd..828a4fff6 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt @@ -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 diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt index 91eedbc14..6e3bb1555 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt @@ -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; @@ -80,6 +83,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 \"\"; @@ -90,16 +105,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 diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt index eaab7a62b..c3e652e8e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt @@ -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; @@ -80,6 +83,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 \"\"; @@ -90,16 +105,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 From b0e241d3a389be4ec3691c31370d4d573616ebe4 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 17:32:33 +0100 Subject: [PATCH 58/84] recovery init: fix device name "i" variable in the nested loop is expanded to the absolute path of the device, so prepending it with the ${device} results in "/dev/sda/dev/sda1" for a 'sda1' partition. Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 35b19a125..c7ce655a0 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -158,7 +158,7 @@ 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 "${device}${i}") + local dev_name=$(basename "${i}") local mount_dir="${USB_MOUNT_DIR}${dev_name}" mkdir -p "${mount_dir}" mount "/dev/${dev_name}" "${mount_dir}" 2>/dev/null From a7a8916018ea9666aa2f088ff179c9c9abe7cdf6 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 17:33:04 +0100 Subject: [PATCH 59/84] recovery init: remove trailing slash from USB_MOUNT_DIR variable Just the same than UPDATE_MOUNT_DIR, which doesn't have a trailing slash. Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index c7ce655a0..eb70e699e 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -22,7 +22,7 @@ ENV_RECOVERY_COMMAND="recovery_command" SW_CONFIG="/etc/swupdate.cfg" -USB_MOUNT_DIR="/run/media/" +USB_MOUNT_DIR="/run/media" UPDATE_MOUNT_DIR="/update" REBOOT_TIME=10 @@ -159,7 +159,7 @@ mount_external_disks() { for device in ${devices}; do for i in ${device}?; do local dev_name=$(basename "${i}") - local mount_dir="${USB_MOUNT_DIR}${dev_name}" + local mount_dir="${USB_MOUNT_DIR}/${dev_name}" mkdir -p "${mount_dir}" mount "/dev/${dev_name}" "${mount_dir}" 2>/dev/null done From 75f2c0002581e8ce2abfaec2f6837ec3493f3399 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 17:33:37 +0100 Subject: [PATCH 60/84] recovery init: pass filesystem type to mount command For block devices we can get the filesystem in the partition using the 'blkid' command. This cleans up some warnings on mounting: EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities EXT4-fs (mmcblk0p4): couldn't mount as ext3 due to feature incompatibilities EXT4-fs (mmcblk0p4): couldn't mount as ext2 due to feature incompatibilities Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index eb70e699e..dbaf970b5 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -161,7 +161,8 @@ mount_external_disks() { local dev_name=$(basename "${i}") local mount_dir="${USB_MOUNT_DIR}/${dev_name}" mkdir -p "${mount_dir}" - mount "/dev/${dev_name}" "${mount_dir}" 2>/dev/null + FSTYPE="$(blkid /dev/${dev_name} | sed -e 's,.*TYPE="\([^"]\+\)".*,\1,g')" + mount -r ${FSTYPE:+-t ${FSTYPE}} "/dev/${dev_name}" "${mount_dir}" done done } @@ -226,7 +227,8 @@ mount_emmc_block() { 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}" - mount -t auto "${partition_block}" "${2}" >/dev/null 2>&1 + 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 From b2abb5bc80b0a803eb2937139f0f1803d9850e83 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 17:34:09 +0100 Subject: [PATCH 61/84] recovery init: search update package in the different partitions Instead of using a hardcoded path to the SWU update package, just get the filename and search the file in the different mounted partitions (giving priority to the internal 'update' partition over other external media). https://jira.digi.com/browse/DEL-3466 Signed-off-by: Javier Viguera --- .../recovery-initramfs-init | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index dbaf970b5..521116ab4 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -317,6 +317,29 @@ format_emmc_block() { 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. @@ -409,12 +432,17 @@ if [ -n "${update_package_bool}" ]; then if [ -z "${update_package}" ]; then quit_with_error "Firmware update package not specified" else - log "Update package location: ${update_package}" - # Mount external disks. + # Give some time for the devices to settle down sleep 5 mount_external_disks - # Mount update partition. 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. From 0cd1c803ce023bdc73db570b997129a7e57842a0 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 17:34:41 +0100 Subject: [PATCH 62/84] recovery-utils: reset URI for local SWU update packages Internal recovery-utils.git SHA1: e30c2a3c9729 https://jira.digi.com/browse/DEL-3466 Signed-off-by: Javier Viguera --- .../recovery-utils/lib/recovery.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c index 491a443d3..6f0e232b5 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c @@ -17,6 +17,8 @@ * */ +#define _GNU_SOURCE /* For GNU version of basename */ + #include #include #include @@ -25,6 +27,8 @@ #include +#define FILE_PREFIX "file://" + /* * Function: append_recovery_command * Description: append configuration to the 'recovery_command' variable @@ -78,6 +82,7 @@ err: int update_firmware(const char *swu_path) { char *fwupdate_cmd; + int file_prefix_len = 0; int ret = -1; /* Verify input parameter */ @@ -86,14 +91,23 @@ int update_firmware(const char *swu_path) 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=") + strlen(swu_path) + 1); + 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", swu_path); + sprintf(fwupdate_cmd, "update_package=%s%s", + file_prefix_len ? FILE_PREFIX : "", swu_path); ret = append_recovery_command(fwupdate_cmd); From 73ebf262de2d993abde064c3115ff695330682c6 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Thu, 12 Jan 2017 10:48:59 +0100 Subject: [PATCH 63/84] meta-digi-dey: pulseaudio: improve HDMI hotplug script The HDMI hotplug script required alsa-utils to be installed in order to work. This commit avoids this by adding a recipe for a small binary that replaces aplay in the script. https://jira.digi.com/browse/DEL-3482 Signed-off-by: Gabriel Valcazar --- .../recipes-multimedia/alsa/card-detect.bb | 21 +++++++++ .../alsa/card-detect/card-detect.c | 47 +++++++++++++++++++ .../packagegroups/packagegroup-dey-audio.bb | 2 + .../pulseaudio/pulseaudio/hdmi_hotplug.sh | 10 +--- .../pulseaudio/pulseaudio_%.bbappend | 3 ++ 5 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 meta-digi-dey/recipes-multimedia/alsa/card-detect.bb create mode 100644 meta-digi-dey/recipes-multimedia/alsa/card-detect/card-detect.c diff --git a/meta-digi-dey/recipes-multimedia/alsa/card-detect.bb b/meta-digi-dey/recipes-multimedia/alsa/card-detect.bb new file mode 100644 index 000000000..b6d44f59a --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/alsa/card-detect.bb @@ -0,0 +1,21 @@ +# Copyright (C) 2017 Digi International. + +SUMMARY = "DEY sound card detection app" +SECTION = "multimedia" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" + +DEPENDS = "alsa-lib" + +SRC_URI = "file://card-detect.c" + +S = "${WORKDIR}" + +do_compile() { + ${CC} -O2 -Wall card-detect.c -o card-detect -lasound +} + +do_install() { + install -d ${D}${bindir} + install -m 0755 card-detect ${D}${bindir} +} diff --git a/meta-digi-dey/recipes-multimedia/alsa/card-detect/card-detect.c b/meta-digi-dey/recipes-multimedia/alsa/card-detect/card-detect.c new file mode 100644 index 000000000..7ead91235 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/alsa/card-detect/card-detect.c @@ -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. + */ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int len, ret = EXIT_SUCCESS; + snd_pcm_t *handle; + char *device; + + if (argc < 2) { + printf("Usage: %s [CARD NUMBER]\n", argv[0]); + return EXIT_FAILURE; + } + + len = strlen("hw:") + strlen(argv[1]) + 1; + device = calloc(1, len); + snprintf(device, len, "hw:%s", argv[1]); + + /* Open the PCM-device in playback mode */ + if (snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, 0) < 0) { + printf("Could't open PCM '%s'\n", device); + ret = EXIT_FAILURE; + } else { + printf("Device %s opened successfully\n", device); + snd_pcm_close(handle); + } + + free(device); + return ret; +} diff --git a/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-audio.bb b/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-audio.bb index 220a0b433..3d29fdea6 100644 --- a/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-audio.bb +++ b/meta-digi-dey/recipes-multimedia/packagegroups/packagegroup-dey-audio.bb @@ -22,3 +22,5 @@ RDEPENDS_${PN} = "\ alsa-states \ ${ALSA_UTILS_PKGS} \ " + +RDEPENDS_${PN}_append_ccimx6sbc = " card-detect" diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh index 78a29786d..8c9726003 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/hdmi_hotplug.sh @@ -27,15 +27,7 @@ done # HDMI audio sink from ALSA if [ "${EVENT}" = "plugin" ]; then if ! pactl list sinks | grep -qs "imx-hdmi-soc"; then - if which aplay; then - # Run a command that always fails but loads - # pulseaudio HDMI sink/card as a side effect - aplay / -D "hw:${HDMI_CARD}" - else - # Unload and reload the detection module - pactl unload-module module-udev-detect - pactl load-module module-udev-detect tsched=0 - fi + card-detect "${HDMI_CARD}" # Set HDMI as default sink pactl set-default-sink "$(pactl list sinks | grep -i 'Name:.*hdmi' | cut -d ' ' -f2)" diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend index f83abe9dd..cdbab483f 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -16,3 +16,6 @@ do_install_append_ccimx6sbc() { } PACKAGE_ARCH = "${MACHINE_ARCH}" + +# The card-detect binary is only necessary for the HDMI hotplug to work on the ccimx6sbc +RDEPENDS_${PN}_append_ccimx6sbc = " card-detect" From 25a5e7c7d3cd5535a6a1106d18bf1f6b23e65e0e Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 18 Jan 2017 10:40:53 +0100 Subject: [PATCH 64/84] meta-digi-dey: pulseaudio: reduce pulseaudio loading time On boot, pulseaudio looks for the sound cards' corresponding profile sets, and uses a default configuration if none is found. This was causing pulseaudio to take up to 5 seconds trying every possible default profile. This commit fixes this by creating a specific profile set for each of the sound cards on the ccimx6sbc so pulseaudio doesn't spend time trying different profiles that don't apply to our platform. It also adds udev rules so pulseaudio knows which configuration to load for each card. https://jira.digi.com/browse/DEL-2218 Signed-off-by: Gabriel Valcazar --- .../pulseaudio/pulseaudio/dey-audio-hdmi.conf | 35 ++++++++++ .../pulseaudio/dey-audio-sgtl5000.conf | 69 +++++++++++++++++++ .../pulseaudio/pulseaudio_%.bbappend | 15 +++- 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-hdmi.conf create mode 100644 meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-sgtl5000.conf diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-hdmi.conf b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-hdmi.conf new file mode 100644 index 000000000..6ae671021 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-hdmi.conf @@ -0,0 +1,35 @@ +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +; Audio profile for Digi ConnectCore 6 HDMI sound card +; +; Copyright (C) 2017 by Digi International Inc. +; +; This device has only one output (analog stereo) +; +; See default.conf for an explanation on the directives used here. + +[General] +auto-profiles = no + +[Mapping analog-stereo] +description = Analog Stereo +device-strings = hw:%f +channel-map = left,right +direction = output + +[Profile output:analog-stereo] +description = Analog Stereo Output +output-mappings = analog-stereo diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-sgtl5000.conf b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-sgtl5000.conf new file mode 100644 index 000000000..7c219776e --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/dey-audio-sgtl5000.conf @@ -0,0 +1,69 @@ +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +; Audio profile for Digi ConnectCore 6 SBC SGTL5000 sound card +; +; Copyright (C) 2017 by Digi International Inc. +; +; This device can operate in either mono or stereo for output, input or duplex +; +; Profile probing is skipped to save time during loading +; +; See default.conf for an explanation on the directives used here. + +[General] +auto-profiles = no + +[Mapping analog-mono] +description = Analog Mono +device-strings = hw:%f +channel-map = mono + +[Mapping analog-stereo] +description = Analog Stereo +device-strings = hw:%f +channel-map = left,right + +[Profile input:analog-mono] +description = Analog Mono Input +input-mappings = analog-mono +skip-probe = yes + +[Profile input:analog-stereo] +description = Analog Stereo Input +input-mappings = analog-stereo +skip-probe = yes + +[Profile output:analog-mono] +description = Analog Mono Output +output-mappings = analog-mono +skip-probe = yes + +[Profile output:analog-mono+input:analog-mono] +description = Analog Mono Duplex +output-mappings = analog-mono +input-mappings = analog-mono +skip-probe = yes + +[Profile output:analog-stereo] +description = Analog Stereo Output +output-mappings = analog-stereo +skip-probe = yes + +[Profile output:analog-stereo+input:analog-stereo] +description = Analog Stereo Duplex +output-mappings = analog-stereo +input-mappings = analog-stereo +skip-probe = yes diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend index cdbab483f..2f322db06 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -3,14 +3,27 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI_append_ccimx6ulsbc = " file://0001-pulseaudio-keep-headphones-volume-in-platforms-witho.patch" -SRC_URI_append_ccimx6sbc = " file://hdmi_hotplug.sh" +SRC_URI_append_ccimx6sbc = " \ + file://hdmi_hotplug.sh \ + file://dey-audio-hdmi.conf \ + file://dey-audio-sgtl5000.conf \ +" do_install_append_ccimx6sbc() { install -d ${D}${sysconfdir}/udev/scripts install -m 0755 ${WORKDIR}/hdmi_hotplug.sh ${D}${sysconfdir}/udev/scripts + install -d ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets + install -m 0644 ${WORKDIR}/dey-audio-hdmi.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets + install -m 0644 ${WORKDIR}/dey-audio-sgtl5000.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets + cat >> ${D}${base_libdir}/udev/rules.d/90-pulseaudio.rules <<-_EOL_ + # Digi ConnectCore 6 SBC HDMI + ATTRS{id}=="imxhdmisoc", ENV{PULSE_PROFILE_SET}="dey-audio-hdmi.conf" + # Digi ConnectCore 6 SBC SGTL5000 + ATTRS{id}=="sgtl5000audio", ENV{PULSE_PROFILE_SET}="dey-audio-sgtl5000.conf" + SUBSYSTEM=="platform", KERNEL=="*hdmi_video", ACTION=="change", RUN+="/etc/udev/scripts/hdmi_hotplug.sh" _EOL_ } From 5d34a217ab191735947d3031f54a884aa116478f Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Thu, 19 Jan 2017 13:38:36 +0100 Subject: [PATCH 65/84] ccimx6sbc: pulseaudio: change module-suspend-on-idle timeout to 0 In pulseaudio, module-suspend-on-idle controls how much time a sink spends in the 'idle' state before going to 'suspended'. This means the ALSA device associated with the sink stays busy for a few seconds after loading or using the sink. This commit adds the timeout=0 parameter when loading module-suspend-on-idle. Now the sink will go to the 'suspended' state right after being loaded or used. https://jira.digi.com/browse/DEL-2218 Signed-off-by: Gabriel Valcazar --- .../recipes-multimedia/pulseaudio/pulseaudio_%.bbappend | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend index 2f322db06..9ebc49186 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -17,6 +17,8 @@ do_install_append_ccimx6sbc() { install -m 0644 ${WORKDIR}/dey-audio-hdmi.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets install -m 0644 ${WORKDIR}/dey-audio-sgtl5000.conf ${D}${datadir}/pulseaudio/alsa-mixer/profile-sets + sed -i -e '/load-module module-suspend-on-idle/{s,$, timeout=0,g}' ${D}${sysconfdir}/pulse/default.pa + cat >> ${D}${base_libdir}/udev/rules.d/90-pulseaudio.rules <<-_EOL_ # Digi ConnectCore 6 SBC HDMI From 87cd5ed4375175ddb209ff5804af6667531b2157 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 16:34:55 +0100 Subject: [PATCH 66/84] cloudconnector: add missing SRCBRANCH variable Having explicitly SRCBRANCH in the recipe allows to override it in the project's config file. Signed-off-by: Javier Viguera --- .../recipes-digi/cloudconnector/cloudconnector_git.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index 2c5b1f3d4..024116826 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -7,9 +7,10 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 DEPENDS = "confuse openssl zlib" +SRCBRANCH = "master" SRCREV = "${AUTOREV}" -SRC_URI = "gitsm://git@stash.digi.com/cc/cc_dey.git;protocol=ssh" +SRC_URI = "gitsm://git@stash.digi.com/cc/cc_dey.git;protocol=ssh;branch=${SRCBRANCH}" S = "${WORKDIR}/git" From 30162ca76c6bc1b4bafe20dd3ec2956a41405148 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 16:14:21 +0100 Subject: [PATCH 67/84] cloudconnector: simplify recipe for static library For the moment the cloudconnector is provided only as static library, so the recipe can be simplified. https://jira.digi.com/browse/DEL-3523 Signed-off-by: Javier Viguera --- .../packagegroups/packagegroup-dey-core.bb | 2 +- .../recipes-digi/cloudconnector/cloudconnector_git.bb | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index ab8f2f455..d8201c7dd 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -32,7 +32,7 @@ RDEPENDS_${PN} = "\ busybox \ busybox-acpid \ busybox-static-nodes \ - cloudconnector-bin \ + 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)} \ diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index 024116826..57c0c679a 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -14,19 +14,16 @@ SRC_URI = "gitsm://git@stash.digi.com/cc/cc_dey.git;protocol=ssh;branch=${SRCBRA S = "${WORKDIR}/git" +inherit pkgconfig + do_install() { oe_runmake DESTDIR=${D} install } -PACKAGES =+ "${PN}-bin ${PN}-cert" +PACKAGES =+ "${PN}-cert" -FILES_${PN}-bin += "${sysconfdir}/cc.conf" FILES_${PN}-cert = "${sysconfdir}/ssl/certs/Digi_Int-ca-cert-public.crt" -CONFFILES_${PN}-bin += "${sysconfdir}/cc.conf" - -DEBIAN_NOAUTONAME_${PN}-bin = "1" -DEBIAN_NOAUTONAME_${PN}-cert = "1" +CONFFILES_${PN} += "${sysconfdir}/cc.conf" RDEPENDS_${PN} = "${PN}-cert" -RDEPENDS_${PN}-bin = "${PN}-cert" From 5d8ea7aa352970b1868693287750ac8a6361fefe Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 16:30:08 +0100 Subject: [PATCH 68/84] dey-examples-cloudconnector: adapt recipe and makefiles to use static library https://jira.digi.com/browse/DEL-3523 Signed-off-by: Javier Viguera --- .../recipes-digi/dey-examples/dey-examples-cloudconnector.bb | 2 ++ .../files/cloudconnector_test/device_request_listener/Makefile | 2 +- .../files/cloudconnector_test/upload_data_points/Makefile | 2 +- .../dey-examples/files/cloudconnector_test/upload_file/Makefile | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb index 7a1643281..e08939826 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-cloudconnector.bb @@ -9,6 +9,8 @@ SRC_URI = "file://cloudconnector_test" S = "${WORKDIR}/cloudconnector_test" +inherit pkgconfig + do_install() { oe_runmake DESTDIR=${D} install } diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile index 4ebffe73e..ac22dafcb 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/device_request_listener/Makefile @@ -19,7 +19,7 @@ PROGRAM := device_request_listener CFLAGS += -Wall CFLAGS += $(shell pkg-config --cflags cloudconnector) -LDLIBS += $(shell pkg-config --libs cloudconnector) +LDLIBS += $(shell pkg-config --libs --static cloudconnector) all: $(PROGRAM) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile index 6e01b0f6f..f30697238 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_data_points/Makefile @@ -19,7 +19,7 @@ PROGRAM := upload_data_points CFLAGS += -Wall CFLAGS += $(shell pkg-config --cflags cloudconnector) -LDLIBS += $(shell pkg-config --libs cloudconnector) +LDLIBS += $(shell pkg-config --libs --static cloudconnector) all: $(PROGRAM) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile index 3478cf988..eed50f3e1 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/Makefile @@ -19,7 +19,7 @@ PROGRAM := upload_file CFLAGS += -Wall CFLAGS += $(shell pkg-config --cflags cloudconnector) -LDLIBS += $(shell pkg-config --libs cloudconnector) +LDLIBS += $(shell pkg-config --libs --static cloudconnector) all: $(PROGRAM) From 6e360e01bd195347e906d6ac69f9113c327c8c27 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Mon, 23 Jan 2017 14:02:29 +0100 Subject: [PATCH 69/84] examples: cloudconnector: fix uploaded file in the upload file example Signed-off-by: David Escalona --- .../dey-examples/files/cloudconnector_test/upload_file/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c index e7d90c595..0f49d2c02 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/cloudconnector_test/upload_file/main.c @@ -24,6 +24,7 @@ #define UNUSED_ARGUMENT(a) (void)(a) #define STREAM_NAME "examples/uploaded_file" +#define UPLOAD_FILE "/etc/build" static void sigint_handler(int signum) { @@ -76,7 +77,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - send_error = ccapi_dp_binary_send_file(CCAPI_TRANSPORT_TCP, argv[0], STREAM_NAME); + 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; From 0bb2cb005d3bdc8759ae751ec6d7b413438079c5 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 18 Jan 2017 12:51:15 +0100 Subject: [PATCH 70/84] meta-digi-arm: ccimx6ul: Use HAVE macros as in other platforms. For consistency, use the HAVE macros instead of grepping the machine features directly. Signed-off-by: Alex Gonzalez --- meta-digi-arm/conf/machine/include/ccimx6ul.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/conf/machine/include/ccimx6ul.inc b/meta-digi-arm/conf/machine/include/ccimx6ul.inc index ffaaeec3a..819cfb730 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6ul.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6ul.inc @@ -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" From 5d332c780097360283a71eb7ac49d08f1d4898ac Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 18 Jan 2017 12:54:14 +0100 Subject: [PATCH 71/84] ccimx6ul: Add P2P support This commit adds a wpa supplicant P2P configuration file and configures the p2p0 interface automatically at pre-up. Signed-off-by: Alex Gonzalez --- .../conf/machine/include/digi-defaults.inc | 2 ++ .../ccimx6ul/wpa_supplicant_p2p.conf | 8 ++++++++ .../wpa-supplicant/wpa-supplicant_%.bbappend | 6 ++++++ .../init-ifupdown-1.0/interfaces.p2p | 10 ++++++++++ .../init-ifupdown/init-ifupdown_1.0.bbappend | 19 ++++++++++++++++++- 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf create mode 100644 meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.p2p diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index 5fbfd1764..754a2a6e7 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -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" diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf new file mode 100644 index 000000000..30a6699e6 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf @@ -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 diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend index 045b39c3e..28bb0c349 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend @@ -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}" diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.p2p b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.p2p new file mode 100644 index 000000000..18a4503cc --- /dev/null +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces.p2p @@ -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 diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend index 06cd4c152..e6ad9edab 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend @@ -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 } From e55d83ba14a0c25118f40aa33d1891360301fc12 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 18 Jan 2017 12:56:01 +0100 Subject: [PATCH 72/84] kernel-module-qualcomm: Bring the module up with the p2p0 interface too The qualcomm wlan driver creates two interfaces at load time, wlan0 and p2p0. Both of them should load the module if not already loaded. Signed-off-by: Alex Gonzalez --- .../kernel-module-qualcomm/qualcomm-pre-up | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up index 53d0e18b0..89efc7e75 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/qualcomm-pre-up @@ -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" From 98808b5938a9de9a0d6fed0a4c01fbf8979fcb46 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 19 Jan 2017 14:04:15 +0100 Subject: [PATCH 73/84] kernel-module-qualcomm: Initialize auxiliary p2p0 interface at boot Remove the commit that removes the p2p0 interface at boot. This interface is the one used to establish p2p connections. Configuring the wlan0 command for p2p does not work. https://jira.digi.com/browse/DEL-3390 Signed-off-by: Alex Gonzalez --- .../kernel-module-qualcomm.bb | 17 +++++++------- ...pile-the-DEBUG-version-inconditiona.patch} | 0 ...o-not-create-an-auxiliar-p2p-on-init.patch | 22 ------------------- ...-most-of-the-relevant-DEBUG-options.patch} | 0 ...d_cfg80211-fix-missing-ifdef-clause.patch} | 0 ....patch => 0016-Add-.gitignore-rules.patch} | 0 ...tialize-all-adapter-completion-vari.patch} | 0 ...te-disconnect-event-to-upper-layers.patch} | 0 ...t-con_mode-to-clearly-see-if-in-FTM.patch} | 0 ...UILD_DEBUG_VERSION-to-kbuild-system.patch} | 0 10 files changed, 8 insertions(+), 31 deletions(-) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0014-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch => 0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch} (100%) delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-create-an-auxiliar-p2p-on-init.patch rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0015-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch => 0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch} (100%) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0016-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch => 0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch} (100%) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0017-Add-.gitignore-rules.patch => 0016-Add-.gitignore-rules.patch} (100%) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0018-wlan_hdd_main-initialize-all-adapter-completion-vari.patch => 0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch} (100%) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch => 0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch} (100%) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch => 0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch} (100%) rename meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/{0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch => 0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch} (100%) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb index 0ee63dfed..1ef977f14 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm.bb @@ -26,15 +26,14 @@ 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://0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch \ - file://0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch \ - file://0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.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}" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-compile-the-DEBUG-version-inconditiona.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-create-an-auxiliar-p2p-on-init.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-create-an-auxiliar-p2p-on-init.patch deleted file mode 100644 index c8498dda3..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0013-Kbuild-do-not-create-an-auxiliar-p2p-on-init.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Isaac Hermida -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 ---- - 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 diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0014-Kbuild-Group-most-of-the-relevant-DEBUG-options.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0015-wlan_hdd_cfg80211-fix-missing-ifdef-clause.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-Add-.gitignore-rules.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-Add-.gitignore-rules.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-Add-.gitignore-rules.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0016-Add-.gitignore-rules.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-wlan_hdd_main-initialize-all-adapter-completion-vari.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-wlan_hdd_main-initialize-all-adapter-completion-vari.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0017-wlan_hdd_main-initialize-all-adapter-completion-vari.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-qcacld-Indicate-disconnect-event-to-upper-layers.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch b/meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0021-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch rename to meta-digi-arm/recipes-kernel/kernel-module-qualcomm/kernel-module-qualcomm/0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch From 02a0b4ab0b7eb7f0c59882dfacbbb26a63234f1f Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 23 Jan 2017 16:12:22 +0100 Subject: [PATCH 74/84] sysinfo: (cosmetic) make 'Version' field a JIRA table header Add missing | char to make 'version' field in JIRA table a header. Signed-off-by: Hector Palacios --- meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo index 541f3b574..046fa4fef 100755 --- a/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo +++ b/meta-digi-dey/recipes-digi/sysinfo/sysinfo/sysinfo @@ -3,7 +3,7 @@ # # sysinfo # -# Copyright (C) 2016 by Digi International Inc. +# Copyright (C) 2016,2017 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -263,7 +263,7 @@ printf "\n\n" echo "-------------------------------------" echo "" - echo "||*Component*|*Version*" + echo "||*Component*||*Version*" echo "|| DUT | SN-${BOARD_SN}, ${MACHINE} ${BOARD_VARIANT} SBCv${BOARD_VERSION} board_ID=${BOARD_ID}." echo "|| U-Boot | ${UBOOT_VERSION}" echo "|| Firmware | ${DISTRO}-${DEY_VERSION}-$(cat /etc/version)" From e3ae7c8ea7eba438dfc050756fb2cd68b759393b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 23 Jan 2017 19:56:28 +0100 Subject: [PATCH 75/84] cloudconnector: add 'recovery-utils' compile time dependence librecovery is needed to build the cloudconnector library. Signed-off-by: Javier Viguera --- meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index 57c0c679a..034aadf57 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -5,7 +5,7 @@ SECTION = "libs" LICENSE = "MPL-2.0" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" -DEPENDS = "confuse openssl zlib" +DEPENDS = "confuse openssl recovery-utils zlib" SRCBRANCH = "master" SRCREV = "${AUTOREV}" From e0d6f4eda4f06f4c48c5e11fd451af6769835af6 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Fri, 20 Jan 2017 14:20:10 +0100 Subject: [PATCH 76/84] automount: add rule to automount update partition https://jira.digi.com/browse/DEL-3512 Signed-off-by: David Escalona --- .../udev/udev-extraconf/automount.rules | 4 ++ .../udev/udev-extraconf/mount_partition.sh | 46 +++++++++++++++++++ .../udev/udev-extraconf_1.1.bbappend | 6 ++- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 meta-digi-arm/recipes-core/udev/udev-extraconf/mount_partition.sh diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules index 8c1b63d48..3e8ee44c3 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/automount.rules @@ -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" diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_partition.sh b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_partition.sh new file mode 100644 index 000000000..05f719b18 --- /dev/null +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_partition.sh @@ -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 diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend index 901ff61dd..662156665 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend @@ -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 From 85efbb87e2e2f99c3bc16cc2971fbdeebc4ad891 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 24 Jan 2017 13:55:19 +0100 Subject: [PATCH 77/84] u-boot-fw-utils: clean compiler warning Modify patch to clean compiler warning: warning: passing argument 1 of 'sysfs_mmcboot_set_protection' discards 'const' qualifier from pointer target type Signed-off-by: Javier Viguera --- ...002-fw_env-add-support-to-unlock-emmc-boot-partition.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0002-fw_env-add-support-to-unlock-emmc-boot-partition.patch b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0002-fw_env-add-support-to-unlock-emmc-boot-partition.patch index f1c50aa56..2450ae412 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0002-fw_env-add-support-to-unlock-emmc-boot-partition.patch +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0002-fw_env-add-support-to-unlock-emmc-boot-partition.patch @@ -8,7 +8,7 @@ Signed-off-by: Javier Viguera 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]; From 6cb94fe22c6c85765bf5cf1a631048ece6130678 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 24 Jan 2017 16:10:18 +0100 Subject: [PATCH 78/84] build.sh: add support to build firmware update packages https://jira.digi.com/browse/DEL-3449 Signed-off-by: Javier Viguera --- sdk/build-github.sh | 13 ++++++++++++- sdk/build.sh | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/sdk/build-github.sh b/sdk/build-github.sh index a61e472ac..d2f16f66e 100755 --- a/sdk/build-github.sh +++ b/sdk/build-github.sh @@ -92,6 +92,17 @@ purge_sstate() { bitbake -k -c cleansstate ${PURGE_PKGS} >/dev/null 2>&1 || true } +# +# For a given image recipe print the SWU recipe (if it exists) +# +# $1: image recipe +# +swu_recipe_name() { + if [ -n "$(find ${YOCTO_INST_DIR}/sources/meta-digi -type f -name "${1}-swu.bb")" ]; then + printf "${1}-swu" + fi +} + # Sanity checks (Jenkins environment) [ -z "${DY_REVISION}" ] && error "DY_REVISION not specified" [ -z "${WORKSPACE}" ] && error "WORKSPACE not specified" @@ -164,7 +175,7 @@ for platform in ${DY_PLATFORMS}; do fi for target in ${platform_targets}; do printf "\n[INFO] Building the ${target} target.\n" - time bitbake ${target} + time bitbake ${target} $(swu_recipe_name ${target}) done purge_sstate ) diff --git a/sdk/build.sh b/sdk/build.sh index 91109fc94..a39856427 100755 --- a/sdk/build.sh +++ b/sdk/build.sh @@ -110,6 +110,17 @@ purge_sstate() { bitbake -k -c cleansstate ${PURGE_PKGS} >/dev/null 2>&1 || true } +# +# For a given image recipe print the SWU recipe (if it exists) +# +# $1: image recipe +# +swu_recipe_name() { + if [ -n "$(find ${YOCTO_INST_DIR}/sources/meta-digi -type f -name "${1}-swu.bb")" ]; then + printf "${1}-swu" + fi +} + # Sanity check (Jenkins environment) [ -z "${DY_PLATFORMS}" ] && error "DY_PLATFORMS not specified" [ -z "${DY_REVISION}" ] && error "DY_REVISION not specified" @@ -237,7 +248,7 @@ for platform in ${DY_PLATFORMS}; do fi for target in ${platform_targets}; do printf "\n[INFO] Building the ${target} target.\n" - time bitbake ${target} + time bitbake ${target} $(swu_recipe_name ${target}) # Build the toolchain for DEY images if [ "${DY_BUILD_TCHAIN}" = "true" ] && echo "${target}" | grep -qs '^\(core\|dey\)-image-[^-]\+$'; then printf "\n[INFO] Building the toolchain for ${target}.\n" From 7cf8aa6e0640ff8b3c6e9f2a4f9ef44acb9553cf Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 24 Jan 2017 18:11:33 +0100 Subject: [PATCH 79/84] recovery init: change default mountpoint for 'update' partition So it matches the same mountpoint used in a normal boot. Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 521116ab4..6399d3822 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -23,7 +23,7 @@ ENV_RECOVERY_COMMAND="recovery_command" SW_CONFIG="/etc/swupdate.cfg" USB_MOUNT_DIR="/run/media" -UPDATE_MOUNT_DIR="/update" +UPDATE_MOUNT_DIR="/mnt/update" REBOOT_TIME=10 From e80d5b021cd311d6bc7102c3ad1fe354028d2ab6 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 24 Jan 2017 19:22:51 +0100 Subject: [PATCH 80/84] recovery init: configure UBIFS update partition to use ZLIB compression Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 6399d3822..1e43d505d 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -279,6 +279,9 @@ format_ubi_volume() { # 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. From 3371ed864c6611bc629cdd3584509a678a2e4a9b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 25 Jan 2017 12:31:48 +0100 Subject: [PATCH 81/84] recovery init: disable interactivity for 'ubiformat' command We have seen corner cases (e.g. when the partition to format has already some corrupted UBI metadata) where ubiformat stops and ask the user for confirmation to do the format. We cannot have such interactivity in the recovery ramdisk so use the '-y' argument to assume yes for all questions. Also use the '-q' (quiet) parameter instead of the '/dev/null' redirections to remove command's output. Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 1e43d505d..302f41dd3 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -269,8 +269,7 @@ format_ubi_volume() { ubidetach -p "/dev/mtd${mtd_num}" >/dev/null 2>&1 fi # Format MTD partition. - ubiformat "/dev/mtd${mtd_num}" >/dev/null 2>&1 - if [ "$?" != "0" ]; then + if ! ubiformat "/dev/mtd${mtd_num}" -q -y; then quit_with_error "Error erasing '/dev/mtd${mtd_num}' block" fi psplash_progress "50" From 2c7e8ade885a7fcba7496da9ff65d4912951e01b Mon Sep 17 00:00:00 2001 From: Alejandro Navarro Date: Wed, 25 Jan 2017 19:43:31 +0100 Subject: [PATCH 82/84] mca_tool: update checksums for version 1.2 Signed-off-by: Alejandro Navarro https://jira.digi.com/browse/DEL-3575 --- .../recipes-digi/mca/{mca-tool_1.1.bb => mca-tool_1.2.bb} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename meta-digi-arm/recipes-digi/mca/{mca-tool_1.1.bb => mca-tool_1.2.bb} (67%) diff --git a/meta-digi-arm/recipes-digi/mca/mca-tool_1.1.bb b/meta-digi-arm/recipes-digi/mca/mca-tool_1.2.bb similarity index 67% rename from meta-digi-arm/recipes-digi/mca/mca-tool_1.1.bb rename to meta-digi-arm/recipes-digi/mca/mca-tool_1.2.bb index 4335a74b8..803d231b7 100644 --- a/meta-digi-arm/recipes-digi/mca/mca-tool_1.1.bb +++ b/meta-digi-arm/recipes-digi/mca/mca-tool_1.2.bb @@ -7,8 +7,8 @@ LICENSE = "CLOSED" PKGNAME = "mca_tool" SRC_URI = "${DIGI_PKG_SRC}/${PKGNAME}-${PV}.tar.gz" -SRC_URI[md5sum] = "a08dd404f7c5165b6949ae09117a27d3" -SRC_URI[sha256sum] = "6978e481cbd936f03e93f3c566cc506570ebae82b3b499a79da65c3c2d320191" +SRC_URI[md5sum] = "eb36b9e98c3ac30372343567c29f385d" +SRC_URI[sha256sum] = "864fdf42ce313e1a55caa654d53d9b9efa0073034914eb7b2e1ecc95f1a4fbf2" S = "${WORKDIR}/${PKGNAME}-${PV}" From e0890e8866851d86944c4ec2bb662f9a8356f999 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 26 Jan 2017 15:34:51 +0100 Subject: [PATCH 83/84] meta-digi-dey: cloudconnector: Build from source tarball. https://jira.digi.com/browse/DEL-3570 Signed-off-by: Alex Gonzalez --- .../cloudconnector/cloudconnector_1.0.bb | 29 +++++++++++++++++++ .../cloudconnector/cloudconnector_git.bb | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_1.0.bb diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_1.0.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_1.0.bb new file mode 100644 index 000000000..0a777f821 --- /dev/null +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_1.0.bb @@ -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" diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index 034aadf57..32afcc5f4 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -27,3 +27,5 @@ FILES_${PN}-cert = "${sysconfdir}/ssl/certs/Digi_Int-ca-cert-public.crt" CONFFILES_${PN} += "${sysconfdir}/cc.conf" RDEPENDS_${PN} = "${PN}-cert" + +DEFAULT_PREFERENCE = "-1" From 9ea7568d8da3d00947551e414a0c22a6a811c598 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 25 Jan 2017 10:31:06 +0100 Subject: [PATCH 84/84] install_linux_fw_sd: erase NAND partitions before update NAND partitions may have pre-existing UBI volume information and that will tell U-Boot to use 'ubiwrite' to keep UBI wear leveling information instead of erasing the NAND partition beforehand. Given that the UBI support in U-Boot is not particularly complete and stable, and specially if the NAND partition table has been changed, this could result into problems during the UBI volume initialization or during the update process. To prevent such problems it is better that the NAND partitions are erased. This loses the UBI wear leveling information but provides a more reliable deployment install script. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DUB-718 --- .../u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt | 3 +++ .../u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt index 6e3bb1555..dd58604c7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt @@ -74,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!\"; @@ -86,6 +87,7 @@ setenv bootcmd " 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!\"; @@ -98,6 +100,7 @@ setenv bootcmd " 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!\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt index c3e652e8e..e6865bd11 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt @@ -74,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!\"; @@ -86,6 +87,7 @@ setenv bootcmd " 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!\"; @@ -98,6 +100,7 @@ setenv bootcmd " 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!\";