Skip to content

Instantly share code, notes, and snippets.

@nextsux
Created December 8, 2011 08:57
Show Gist options
  • Save nextsux/1446506 to your computer and use it in GitHub Desktop.
Save nextsux/1446506 to your computer and use it in GitHub Desktop.
SparkleShare-Dashboard on ARMv5 in QEMU

Install emulated ARM box

$ mkdir arm
$ cd arm

(I've installed lenny because squeeze have some issues with installer on arm inside qemu)

$ wget ftp://ftp.debian.org/debian/dists/lenny/main/installer-armel/current/images/versatile/netboot/vmlinuz-2.6.26-2-versatile
$ wget ftp://ftp.debian.org/debian/dists/lenny/main/installer-armel/current/images/versatile/netboot/initrd.gz

$ qemu-img create -f raw hda.img 2G
$ qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-2.6.26-2-versatile -initrd initrd.gz -hda hda.img -append "root=/dev/ram"

... install and shutdown guest ...

$ sudo mount -o loop,offset=32256 hda.img /mnt/tmp/
$ cp /mnt/tmp/boot/initrd.img-2.6.26-2-versatile initrd.system.img
$ sudo umount /mnt/tmp
$ qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-2.6.26-2-versatile -initrd initrd.system.img -hda hda.img -append "root=/dev/sda1"

... upgrade guest to squeeze ...

$ vim /etc/apt/sources.list
  :%s/lenny/squeeze/g
  and remove volatile sources

$ apt-get update
$ apt-get dist-upgrade
$ poweroff

... and get out new kernel and initrd ...

$ sudo mount -o loop,offset=32256 hda.img /mnt/tmp/
$ cp /mnt/tmp/boot/initrd.img-2.6.32-5-versatile initrd.system.img.new
$ cp /mnt/tmp/boot/vmlinuz-2.6.32-5-versatile vmlinuz-2.6.32-5-versatile

$ sudo umount /mnt/tmp

Install node

$ qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.system.img.new -hda hda.img -append "root=/dev/sda1"

(login as root)

$ apt-get install pkg-config libssl-dev build-essential git-core
$ mkdir nodejs
$ cd nodejs
$ git clone git://github.com/joyent/node.git
$ cd node
(I have had some issues building 0.6.5 on arm)
$ git checkout v0.4.12

(made some small patches to be able to compile)

$ vim deps/v8/SConstruct
 on line 139 added "-march=armv5t", "-fno-tree-sink" according to http://code.google.com/p/v8/issues/detail?id=836

$ ./configure --prefix=/opt/node/
$ make
$ make install

$ vim .bashrc
 added at the end:
 export PATH="/opt/node/bin/:$PATH"

Install redis

$ vim /etc/apt/sources.list
 added:
 deb http://backports.debian.org/debian-backports squeeze-backports main

$ apt-get update
$ apt-get -t squeeze-backports install redis-server

... logged out and in again ...

Install NPM

$ apt-get install curl
$ curl http://npmjs.org/install.sh | sh

Install Dashboard

$ git clone git://github.com/hbons/SparkleShare-Dashboard
$ cd SparkleShare-Dashboard
$ npm -d install
$ make run

... voila!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment