You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
# Raspberry Pi Devbox
2
2
3
-
A [Vagrant](http://vagrantup.com) recipe for an Ubuntu 12.04 virtual machine, intented to make C/C++ development for Raspberry Pi a less painful experience. This is a fork of <https://github.com/Asquera/raspberry-devbox>.
3
+
A [Vagrant](http://vagrantup.com) recipe for an Ubuntu 12.04 virtual machine, intented to make C/C++ development for Raspberry Pi a less painful experience. Forked from <https://github.com/nickhutchinson/raspberry-devbox>, updated to use a Raspbian 8 Jessie chroot and the latest [Raspberry Pi cross-compiler toolchain (gcc 4.8.3)](https://github.com/raspberrypi/tools).
4
4
5
5
This VM includes a sandboxed installation ("chroot") of [Raspbian](http://www.raspbian.org), an ARM variant of the Debian Linux distribution optimized for Raspberry Pi. Use of the sandbox is mediated by a cross-compiling tool called [ScratchBox2](http://maemo.gitorious.org/scratchbox2). ScratchBox2 craftily translates the ARM executables bundled with Raspbian such that they run on your Intel box.
6
6
7
7
Why is this so nice? Suppose you have C++ app that you want to build for the Raspberry Pi, but it requires a bunch of third-party libraries. Do you really want to hunt down these libraries, their dependencies, their dependencies dependencies, their dependencies dependencies dependencies and so on, until you're able to build your own app? It should be clear that that way lies madness. Perhaps you'll just copy the headers and libraries from your Raspberry to your Intel box, and point your compiler at those. That might work, but it'll be fragile and annoying.
8
8
9
9
How about we let the Raspbian folks do all the hard work? With ScratchBox2, you can simply apt-get to your heart's content. Just type:
10
-
10
+
11
11
sb2 -eR apt-get install ...
12
12
13
13
This executes `apt-get` in the default ScratchBox2 container (in our case, we only have the one. It's called "raspberry".) The `-e` flag is for chroot (emulated) mode; `-R` runs the command as the equivalent of *root* in the sandboxed environment. For a slightly more thorough explanation of ScratchBox2, see these presentation slides: <http://www.daimi.au.dk/~cvm/sb2.pdf>.
@@ -20,17 +20,29 @@ This executes `apt-get` in the default ScratchBox2 container (in our case, we on
20
20
21
21
Vagrant will now download the basebox, bootstrap the environment and run the provisioner for the first time. Since the basebox and numerous packages must be downloaded, the first run may take some time depending on your network connection. No supervision should be required; running the install overnight should be just fine. Future runs will be much faster, and won't require network connectivity.
22
22
23
-
If like to see words dribble down your screen, you can monitor the bootstrap progress by running `vagrant ssh` to ssh into your VM, and then `tail -F ~/raspberry-dev/rootfs/debootstrap/debootstrap.log`)
23
+
If like to see words dribble down your screen, you can monitor the bootstrap progress by running `vagrant ssh` to ssh into your VM, and then `tail -F ~/raspberry-dev/rootfs/debootstrap/debootstrap.log`
24
24
25
25
After installation has completed, you should find:
26
26
27
27
- In `~/raspberry-dev/rootfs`
28
28
- the [Raspbian](http://www.raspbian.org) chroot.
29
29
- In `/opt/raspberry-dev`
30
-
- the official [GCC 4.7.2 cross-compiler toolchain](https://github.com/raspberrypi/tools): `arm-linux-gnueabihf-gcc`, `arm-linux-gnueabihf-ld` and so on.
30
+
- the official [GCC 4.8.3 cross-compiler toolchain](https://github.com/raspberrypi/tools): `arm-linux-gnueabihf-gcc`, `arm-linux-gnueabihf-ld` and so on.
31
31
-[QEmu](http://wiki.qemu.org/Main_Page) 1.3.0
32
32
-[ScratchBox2](http://maemo.gitorious.org/scratchbox2) @ git tag 2.3.90 (earlier releases didn't seem to work)
33
33
34
+
The default configuration allocates 4 CPU cores and 4 GB of RAM to the VM. This can be configured by editing the following lines in the `Vagrantfile`:
35
+
36
+
v.memory = 4096
37
+
v.cpus = 4
38
+
39
+
## Example Usage
40
+
41
+
* Starting the VM: in the program root directory, run `vagrant up` to start the VM, then `vagrant ssh` to enter it.
42
+
*`sb2 make` make using host cross compiler toolchain.
43
+
*`sb2 -e make` make using emulated target toolchain.
44
+
*`sb2 -eR make install` install in emulation mode as root.
45
+
34
46
## VirtualBox
35
47
36
48
The basic virtualization layer is [VirtualBox](https://www.virtualbox.org). Any current version should do, however the guest additions are pinned to current version at the time the basebox was built (4.2.0). A mismatch between the guest additions and the VirtualBox version may result in strange behaviour, mostly affecting shared folders and networking. To update the guest, additions follow the instructions in the VirtualBox manual.
@@ -50,11 +62,5 @@ The basic virtualization layer is [VirtualBox](https://www.virtualbox.org). Any
50
62
51
63
Provisioning of the Virtual Machine is handled by [Puppet](http://puppetlabs.com). Take a look at the `raspberry_dev` module.
52
64
53
-
## Bugs, fixes, improvements
54
-
55
-
If you encounter a problem, please file a ticket. If you can help improve this Virtual Machine recipe please let me know; I'm very new to Vagrant, Puppet, ScratchBox2 and Raspberry Pi, and barely know what I'm doing!
56
-
57
-
## Todo
58
-
59
-
* all of this is still quite rough
60
-
* improve on the readme
65
+
## Bugs
66
+
* Some programs such as aptitude crash with segfault when run in emulation mode. Updated qemu might fix this
0 commit comments