**** BEGIN LOGGING AT Fri Jun 07 02:59:57 2019 Jun 07 08:11:16 Hi, I have a small problem: I would like to deploy some binary files on my target image under a specific path (/opt/eddy/). I've created a small recipe https://pastebin.com/GvsP00Ck which deploys the binary files under / Jun 07 08:11:36 What have I done wrong? Jun 07 08:12:11 I set array in config and trying to use it in do_configure() like this ${@d.getVarFlag("MYVAR","${c}")}, where $c is the variable from the bash. It gives an error. What is wrong? Jun 07 08:19:23 ThomasD13: you do inherit bin_package all the way down, so i think it overwrites some of the things you defined above. see the description of the class here https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#packaging-externally-produced-binaries Jun 07 08:19:58 ThomasD13: and inspect bitbake -e for your recipe, to verify that the effect of your recipe is actually like you intended it to be. Jun 07 08:24:09 LetoThe2nd: Thanks for that hint! I inspect the output of bitbake -e of my recipe, but cannot find with with less the "${D}" variable. But it should come up there, right? I'm still not familiar how to debug bitbake in a effective way Jun 07 08:25:01 ThomasD13: no, its not the D variable. its probably the do_install task, as pointed out in the documentation that i linked to Jun 07 08:29:02 Okay, i searched for "do_install" but it was not found in the output of bitbake -e eddy Jun 07 08:31:25 ahhh, seems I need to force bitbake to execute do_install task Jun 07 08:31:32 ThomasD13: no. Jun 07 08:31:51 ThomasD13: i am almost sure that you jsut need to move the bin_package inheritance upwards. Jun 07 08:38:47 LetoThe2nd: ahhh nice! I think that was the problem. Thank you!! Now I can test further Jun 07 08:40:15 ThomasD13: always remember, recipes are evaluated from top to bottom. this means, you can include/inherit stuff at the top, and then still change it below Jun 07 08:40:29 ThomasD13: and, be sure to really read the doc section i pointed to. :) Jun 07 08:40:39 I wasn't aware of that, thank you for pointing this out Jun 07 08:41:13 ThomasD13: have fun Jun 07 08:50:37 Are there reasons to rather use "install" for creating folders and deploying files on the target, instead of using "cp -r" ? Jun 07 08:52:03 ThomasD13: mosty rights and owner things. see (shameless plug) my SO answer here https://stackoverflow.com/a/47084404/3151114 and the contained link Jun 07 08:54:38 ah okay Jun 07 08:56:13 Interesting, you are also from Bavaria ;) Jun 07 08:56:26 yep Jun 07 09:06:05 is it possible to build one recipe with two options at the same time? Jun 07 09:06:25 no Jun 07 09:06:39 both recipes would write the same packages Jun 07 09:08:11 how can get array value in the bash? ${@d.getVarFlag("ARR","${c}")}, where $c is the bash variable. It gives an error Jun 07 09:08:23 well, yes Jun 07 09:09:12 a fuller example might help show what you're trying to do Jun 07 09:11:29 rburton, https://pastebin.com/e7hqnaMu Jun 07 09:12:59 don't think you could do that in a sh function, write it in python instead? Jun 07 09:13:26 $c isn't going to work to get the sh function because at that point you're already in python scope, which is parsed and evaluated before the sh runs Jun 07 09:13:44 the process is that do_configure() is a big string Jun 07 09:13:58 it is ${} expanded, so ${S} becomes /path/to/work/dor Jun 07 09:14:08 and ${@d.getVar...} is executed Jun 07 09:14:08 oh Jun 07 09:14:34 the output of that expansion is then written to a file, and passed to bash Jun 07 09:16:16 I see. so ${@...} instruction expended before bash, right? Jun 07 09:16:37 yes, all ${} references are expanded inside bitbake before bash sees it Jun 07 09:16:59 ${FOO} is a datastore expansion, ${@...} is arbitrary python Jun 07 09:17:56 is there are hidden arg for do_configure() which I may use to pass 2 parameters (ey,value) from python? Jun 07 09:18:21 how would that work? do_configure is a task Jun 07 09:20:23 so it looks like I'd better write "preprocessor" function for my array to map the python array to two bash arrays and then use this two arrays in _configure and other tasks Jun 07 09:21:40 or write do_configure in python Jun 07 09:22:16 your example still didn't show what you're actually trying to do though Jun 07 09:22:29 ... and two other tasks too :) Jun 07 09:22:57 eg where are you getting the varflag name from? Jun 07 09:23:21 I'm trying to build bootloader like u-boot do: optionally it allows to create an array of configurations in .conf file and builds several versions at the same time Jun 07 09:23:59 write a small py function to return a list that the sh can use? Jun 07 09:24:09 yes Jun 07 09:24:40 that's the idea looks simplest to me Jun 07 09:25:20 variable is come from platform/machine .inc file Jun 07 10:22:30 is there are possibility to add a directory into bblayers.conf that may or may not exist? Jun 07 10:26:41 no Jun 07 10:27:47 rburton, thank you for all your answers :) can you point me to example with the pyhon function defined in the recipe? Jun 07 10:28:47 just do some_function_name() { ... } Jun 07 10:29:05 erm, sorry, python some_function_name() {} Jun 07 10:47:02 unparsed line: 'python exp_K(vname) {' Jun 07 10:55:42 inline functions don't have arguments apart from an implicit datastore Jun 07 10:55:52 inline functions don't have arguments apart from an implicit datastore Jun 07 10:56:04 do you need to pass the name, or can the function just know that Jun 07 10:56:57 oh, fool Jun 07 10:56:59 you can use def Jun 07 10:57:12 def myfuncton(arg, arg): Jun 07 10:57:16 just inline Jun 07 10:57:32 see recipes-connectivity/bluez5/bluez5.inc Jun 07 10:57:52 (we should unify that syntax) Jun 07 11:01:42 thank you Jun 07 13:25:48 dear rburton, sorry for too much questions, I did: https://pastebin.com/dwdWiBbZ Jun 07 13:29:27 dear rburton, sorry for too much questions, I did: https://pastebin.com/dwdWiBbZ Jun 07 13:30:57 X_Ks after K1 expanded to {'key0': 'var0', ...} Jun 07 13:31:15 yes you returned a dict and put it in a string Jun 07 13:31:19 what do you think would happen? Jun 07 13:31:53 but after K2 it gives an error: 'NoneType' object has no attribute 'items' Jun 07 13:33:19 not sure why you don't just write a single big py function to do all the wrangling and just return a string that your sh can handle Jun 07 13:33:53 maybe varFlags is just dict like? Jun 07 13:35:13 it returns none if there are no items found at all Jun 07 13:35:29 not an empty dict Jun 07 13:35:38 now as to why there are none found, that's a good question Jun 07 13:50:36 looks strange. data is the same, but .items() is not the object function Jun 07 13:51:02 why? case, I know shell scripting much better then python :) Jun 07 13:52:15 throw a bb.warn("I got %s", x) before calling items Jun 07 13:52:27 though the error clearly says it got none so that won't help Jun 07 14:00:16 rburton, https://pastebin.com/Hhj1DvuS Jun 07 14:08:24 burton, https://pastebin.com/Hhj1DvuS Jun 07 14:09:04 and after your recommendation: https://pastebin.com/VbuzVGik Jun 07 15:21:05 dear rburton, https://pastebin.com/Hhj1DvuS and after your recommendation: https://pastebin.com/VbuzVGik **** BEGIN LOGGING AT Fri Jun 07 19:32:58 2019 **** ENDING LOGGING AT Sat Jun 08 02:59:57 2019