nodeJs yocto

cancel
Showing results for 
Search instead for 
Did you mean: 

nodeJs yocto

Jump to solution
4,672 Views
niklasmolin
Senior Contributor I

Hi.

I'm using the nodeJs package when compiling in Yocto environment.

I was trying the node.js object os, to get the CPU information.

But it seems like I get "Segmentation fault" when I use that "function".

This worked when I used the same node.js code in LTIB. I haven't had any time yet to dig down to see what causes the crash.

I just wanted to check if anyone else have had this problem?

Thanks,

Niklas

Labels (3)
0 Kudos
1 Solution
430 Views
niklasmolin
Senior Contributor I

I changed the node version to 0.11.2 (modified the recipe) and now it works (I haven't checked if this works in the 0.10.x version).

In LTIB I used 0.10.x version, so I think this problem is fixed in later version. 

View solution in original post

0 Kudos
13 Replies
430 Views
LeonardoSandova
Specialist I

On this type of failures either

+ Create a 'core dump'  and check the backtrace

+ run your app with strace (strace <your app>)

Leo

0 Kudos
431 Views
niklasmolin
Senior Contributor I

I changed the node version to 0.11.2 (modified the recipe) and now it works (I haven't checked if this works in the 0.10.x version).

In LTIB I used 0.10.x version, so I think this problem is fixed in later version. 

View solution in original post

0 Kudos
430 Views
peteewg
Contributor III

Hi Niklas,

Could you provide details of how you changed the recipe?

I'm new to Yocto, so this would be useful info.

0 Kudos
430 Views
niklasmolin
Senior Contributor I

Hi Peter.

What I did was to copy the current version of the .bb file (in this case nodejs_0.8.18.bb).

Changed the name to the node version I wanted (nodejs_0.11.2.bb).

In the SRC_URI, I removed the "link" to the patch file (make sure it also points to the right location to get the .tar.gz file). What I could see there were changes in the 0.11.2 to fix some of the problem with ARM compilation (the reason for the patch).

But there might be other problems that needs to have a patch ( I haven't played around that much with this version yet, in the Freescale processor).

You also have to change the md5sum and sha256sum. You can either try to find those on the node.js download site or just compile (bitbake) and it will give you error (miss matching md5/sha256 sum). Copy these sums into your new .bb and re-compile.

I haven't tried the 0.10.x version in yocto, so I'm not sure if there needs to be any patches.

0 Kudos
430 Views
LeonardoSandova
Specialist I

it would be good to try this

https://github.com/openwebos/meta-webos/blob/master/recipes-upstreamable/nodejs/nodejs_0.10.15.bb

Recipe is already done. Yocto takes the lastest PV (package version) so you may need to remove the one you created (11).

0 Kudos
430 Views
niklasmolin
Senior Contributor I


The reason why I went direct for the 0.11.x is because we need some of the features that are added in the 0.11.x version (--harmony etc.).

Peter, if you don't need that feature, then go for the one that Leonardo suggested.

0 Kudos
430 Views
peteewg
Contributor III

I will give that a try thanks guys,

I was just going to copy the tarball directly to my imx board and run Make from there, but I guess this is the 'proper' way to include it in an image.

0 Kudos
430 Views
LeonardoSandova
Specialist I

Correct. No native compilation. One easy way to install a package into a running system is building the recipe, then installing the resulting package on target (rpm -i).

Leo

0 Kudos
430 Views
peteewg
Contributor III

Hi Leo,

I'm a bit thick, could you give me an example of installing the package on target?

Just now I rebuild the entire image every time, but if this can save me time then, that would be excellent.

starting to dabble in the recipes, but there is still a long way to go before I can consider myself a novice.

Pete

0 Kudos
430 Views
niklasmolin
Senior Contributor I

Peter,

Do you mean that you want to compile it on the target instead of compile it into the image?

/Niklas

0 Kudos
430 Views
peteewg
Contributor III

Hi Niklas,

I want to compile it on my build machine with the recipe modifications that that you suggested (works great BTW).

But Leo mentioned that I could deploy the package directly with (rpm -i) I was just hoping for a little more info on this.

0 Kudos
430 Views
LeonardoSandova
Specialist I

Peter, for some reason I did not see your question.

One of task of each recipe is to create a package (e.g. rpm), so once you build a recipe go to the recipe working folder and look at the deploy-rpms directory. Then copy the rpm you want (dev, dbg, bin, staticdec, etc) and on the target, install it with rpm -i. You will need a target image with dev tools installed (like the package manager).

Leo

0 Kudos
430 Views
niklasmolin
Senior Contributor I

Hi Peter.

I haven't played around with the "rpm -i", yet. But I think it could be something useful, so I have to look into it.

/Niklas

0 Kudos