If you have an Insignia Infocast 8 (Chumby Silvermoon), this will get you up and running with Node.js.
- On the device, tap the Insignia logo for the about dialog.
- Tap the pi icon on the top right of the about dialog.
- Tap the SSHD button in the "Do you believe in the users?" dialog.
- You can now
ssh root@chumby
-- the IP address is on the dialog.
So easy. Just type make
and agree to the download.
From now on, we will be working in /mnt/storage
.
Flash sure does soak up a lot of memory.
stop_control_panel
Python is needed to compile Node.js.
cd /mnt/storage
mkdir python
cd python
wget http://files.chumby.com/languages/python/python2.6-chumby.tgz
tar xzf python2.6-chumby.tgz
mount -oremount,rw /
ln -s /mnt/storage/python/bin/python /usr/bin/python
ln -s /mnt/storage/python/lib/python2.6 /usr/lib/python2.6
mount -oremount,ro /
GCC takes up a ton of memory while building V8. I recommend stopping non-essential services (see above) and enabling swap.
This will create and use a 256M swapfile:
dd if=/dev/zero of=/mnt/storage/swap bs=1M count=256
mkswap /mnt/storage/swap
swapon /mnt/storage/swap
More information: http://wiki.chumby.com/index.php/Chumby_One_tips_and_tricks
cd /mnt/storage
mkdir node
wget http://nodejs.org/dist/node-v0.4.11.tar.gz
tar xzf node-v0.4.11.tar.gz
cd node-v0.4.11
The Silvermoon toolchain defines inotify and epoll headers, but these features are not enabled in the running kernel.
Additionally, a bad check for sync_file_range causes it to be used; however, it does not work.
- In
deps/libeio/wscript
, remove thecheck_cc
call for HAVE_SYNC_FILE_RANGE. - In
deps/libev/wscript
, remove thecheck_cc
calls for inotify and epoll.
If you are using a Chumby One or 3.5 inch Infocast, adjust the march setting using the next section.
The compile will take quite a long time, mostly on V8.
./configure --without-ssl --without-snapshot
CCFLAGS="-fno-tree-sink -march=armv5te" CXXFLAGS="-march=armv5te" make
mount -oremount,rw /
make install
mount -oremount,ro /
Run gcc -v
, you will see output similar to:
Using built-in specs.
Target: arm-angstrom-linux-gnueabi
Configured with: /home/user/oe/tmp/work/armv5te-angstrom-linux-gnueabi/ <snip>
The arch to use is after /tmp/work/
and before the dash.
More information about the bad GCC default: http://fastr.github.com/articles/Node.js-on-OpenEmbedded.html
If you encounter an error like this while compiling:
/mnt/storage/node/node-v0.4.11/deps/v8/src/arm/assembler-arm-inl.h: In member function 'v8::internal::MaybeObject* v8::internal::CallStubCompiler::CompileCallConstant(v8::internal::Object*, v8::internal::JSObject*, v8::internal::JSFunction*, v8::internal::String*, v8::internal::CheckType)':/mnt/storage/node/node-v0.4.11/deps/v8/src/arm/assembler-arm-inl.h:259: internal compiler error: in simplify_subreg, at simplify-rtx.c:4922
This appears to be a transient error. Try running the build again.
After a successful compile, you may see this output when running a Node program or the REPL:
pure virtual method called
terminate method called without an active exception
Aborted
This is caused by a GCC bug in GCC 4.3.x. You must specify the CCFLAG -fno-tree-sink
while compiling to fix.
More information: nodejs/node-v0.x-archive#883
If you encounter this error while compiling:
g++: Internal error: Killed (program cc1plus)
Your system might be out of memory during compilation. Make sure swap is enabled. See above.
For information: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34882
If you encounter this error while compiling:
deps/v8/src/arm/macro-assembler-arm.cc:59:3: error: #error "For thumb inter-working we require an architecture which supports blx"
Your compiler may be using the wrong arch setting. Make sure you passed the arch in CCFLAGS, see above.
See: http://code.google.com/p/v8/issues/detail?id=836
Set the --no-snapshot
option when you ./configure Node.js.
This does not work. To try anyway:
Edit the mksnapshot line to look like this, grep for Snapshot to find it.
vi deps/v8/src/SConscript
env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LOGFILE" --log-snapshot-positions --noenable_armv7 --noenable_vfp3')
You are adding the two disable flags. Now make again.