From 58ba04a395d3e5584d5fb4cabc667fba3b47722e Mon Sep 17 00:00:00 2001 From: Nicholas Hutchinson Date: Tue, 4 Dec 2012 11:54:12 +1300 Subject: [PATCH 1/8] Switch to a Raspbian chroot and the official GCC 4.7 toolchain --- Vagrantfile | 8 +- modules/boxes/manifests/devbox.pp | 170 ------------------ .../files/etc/profile.d/raspberry-dev.sh | 1 + .../files/rootfs/etc/apt/sources.list | 2 + .../puppet/modules/raspbian/manifests/init.pp | 10 ++ modules/raspberry_dev/manifests/config.pp | 58 ++++++ modules/raspberry_dev/manifests/init.pp | 26 +++ modules/raspberry_dev/manifests/packages.pp | 9 + modules/raspberry_dev/manifests/qemu.pp | 15 ++ .../manifests/raspbian_chroot.pp | 89 +++++++++ .../raspberry_dev/manifests/scratchbox2.pp | 16 ++ modules/raspberry_dev/manifests/toolchain.pp | 15 ++ puppetmanifests/raspberry-nox.pp | 2 +- 13 files changed, 245 insertions(+), 176 deletions(-) delete mode 100644 modules/boxes/manifests/devbox.pp create mode 100644 modules/raspberry_dev/files/etc/profile.d/raspberry-dev.sh create mode 100644 modules/raspberry_dev/files/rootfs/etc/apt/sources.list create mode 100644 modules/raspberry_dev/files/rootfs/etc/puppet/modules/raspbian/manifests/init.pp create mode 100644 modules/raspberry_dev/manifests/config.pp create mode 100644 modules/raspberry_dev/manifests/init.pp create mode 100644 modules/raspberry_dev/manifests/packages.pp create mode 100644 modules/raspberry_dev/manifests/qemu.pp create mode 100644 modules/raspberry_dev/manifests/raspbian_chroot.pp create mode 100644 modules/raspberry_dev/manifests/scratchbox2.pp create mode 100644 modules/raspberry_dev/manifests/toolchain.pp diff --git a/Vagrantfile b/Vagrantfile index e1dec46..f49bb8d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,10 +8,10 @@ Vagrant::Config.run do |config| config.vm.define :nox do |box| # Every Vagrant virtual environment requires a box to build off of. - box.vm.box = "ubuntu-10.04.3-server-amd64-asq" + box.vm.box = "precise64" # The url from where the 'config.vm.box' box will be fetched if it # doesn't already exist on the user's system. - box.vm.box_url = "http://asquera-share.s3.amazonaws.com/boxes/base/ubuntu-10.04.3-server-amd64-asq.box" + box.vm.box_url = "http://files.vagrantup.com/precise64.box" # Boot with a GUI so you can see the screen. (Default is headless) #box.vm.boot_mode = :gui @@ -22,9 +22,7 @@ Vagrant::Config.run do |config| puppet.manifests_path = "puppetmanifests" puppet.manifest_file = "raspberry-nox.pp" puppet.module_path = "modules" - puppet.options = "" + puppet.options = ["--verbose", "--debug"] end end - - end diff --git a/modules/boxes/manifests/devbox.pp b/modules/boxes/manifests/devbox.pp deleted file mode 100644 index a636607..0000000 --- a/modules/boxes/manifests/devbox.pp +++ /dev/null @@ -1,170 +0,0 @@ -class boxes::devbox { - Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/", "/home/vagrant/raspberry_pi_development/scratchbox2/bin", "/home/vagrant/raspberry_pi_development/qemu/bin" ], timeout => 600 } - - include sysconfig - include sysconfig::sudoers - include apt - include puppet - include ssh::server - - user {"vagrant": - ensure => present, - home => "/home/vagrant" - } -> file {"/home/vagrant": - ensure => directory, - owner => vagrant - } - - user {"root": - ensure => present, - home => "/root" - } -> file {"/root": - ensure => directory, - owner => root - } - - ssh::user {"vagrant": - } - - ssh::user { "root": - home => "/root" - } - - package {"git-core": - ensure => present - } - - # scratchbox build requirements - package {["libsdl1.2-dev", "libncurses5", "libncurses5-dev", "autoconf", "fakeroot", "realpath", "libc6-i386", "libc6-dev-i386"]: - ensure => present - } - - file {"/home/vagrant/src": - ensure => directory, - owner => "vagrant", - group => "vagrant" - } - - file {"/home/vagrant/raspberry_pi_development": - ensure => directory, - owner => "vagrant", - group => "vagrant" - } - - exec {"download-arm-toolchain": - command => "curl https://sourcery.mentor.com/sgpp/lite/arm/portal/package8739/ppc/arm-none-gnueabi/arm-2011.03-41-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 > /home/vagrant/src/arm-2011.03-41-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2", - creates => "/home/vagrant/src/arm-2011.03-41-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2", - require => File["/home/vagrant/src"], - user => vagrant, - group => vagrant - } - - exec {"unpack-arm-toolchain": - command => "tar xjvf /home/vagrant/src/arm-2011.03-41-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -C /home/vagrant/raspberry_pi_development", - creates => "/home/vagrant/raspberry_pi_development/arm-2011.03/", - subscribe => Exec["download-arm-toolchain"], - refreshonly => true, - require => File["/home/vagrant/raspberry_pi_development"], - user => vagrant, - group => vagrant - } - - exec {"download-fedora-rootfs": - command => "curl http://fedora.roving-it.com/rootfs-f14-minimal-RC1.tar.bz2 > /home/vagrant/src/rootfs-f14-minimal-RC1.tar.bz2", - creates => "/home/vagrant/src/rootfs-f14-minimal-RC1.tar.bz2", - require => File["/home/vagrant/src"], - user => vagrant, - group => vagrant - } - - file {"/home/vagrant/raspberry_pi_development/rootfs_f14": - ensure => "directory", - require => File["/home/vagrant/raspberry_pi_development"], - owner => vagrant, - group => vagrant - } - - exec {"unpack-fedora-rootfs": - command => "tar xjvpf /home/vagrant/src/rootfs-f14-minimal-RC1.tar.bz2 -C /home/vagrant/raspberry_pi_development/rootfs_f14", - # creates => "/home/vagrant/raspberry_pi_development/rootfs_f14", - subscribe => Exec["download-fedora-rootfs"], - refreshonly => true, - require => File["/home/vagrant/raspberry_pi_development/rootfs_f14"], - # this must be run as root, we'll chown later - } - - exec {"chown-fedora-rootfs": - command => "chown -R vagrant:vagrant /home/vagrant/raspberry_pi_development/rootfs_f14", - subscribe => Exec["unpack-fedora-rootfs"], - refreshonly => true - } - - exec {"download-scratchbox2": - command => "git clone -q git://gitorious.org/scratchbox2/scratchbox2.git /home/vagrant/src/scratchbox2", - creates => "/home/vagrant/src/scratchbox2", - require => File["/home/vagrant/src"], - user => vagrant, - group => vagrant - } - - exec {"autogen-scratchbox2": - command => "/home/vagrant/src/scratchbox2/autogen.sh", - cwd => "/home/vagrant/src/scratchbox2", - creates => "/home/vagrant/src/scratchbox2/configure", - user => vagrant, - group => vagrant, - subscribe => Exec["download-scratchbox2"], - refreshonly => true - } - - exec {"install-scratchbox2": - command => "make install prefix=/home/vagrant/raspberry_pi_development/scratchbox2", - cwd => "/home/vagrant/src/scratchbox2", - creates => "/home/vagrant/raspberry_pi_development/scratchbox2", - user => vagrant, - group => vagrant, - subscribe => Exec["autogen-scratchbox2"], - refreshonly => true - } - - exec {"download-qemu": - command => "git clone -q git://git.qemu.org/qemu.git /home/vagrant/src/qemu", - creates => "/home/vagrant/src/qemu", - require => File["/home/vagrant/src"], - user => vagrant, - group => vagrant - } - - exec {"configure-qemu": - command => "/home/vagrant/src/qemu/configure --prefix=/home/vagrant/raspberry_pi_development/qemu --target-list=arm-linux-user,arm-softmmu", - cwd => "/home/vagrant/src/qemu/", - creates => "/home/vagrant/src/qemu/config.log", - user => vagrant, - group => vagrant, - subscribe => Exec["download-qemu"], - refreshonly => true - } - - exec {"install-qemu": - command => "make install", - cwd => "/home/vagrant/src/qemu", - creates => "/home/vagrant/raspberry_pi_development/qemu", - user => vagrant, - group => vagrant, - subscribe => Exec["configure-qemu"], - refreshonly => true - } - - exec {"init-scratchbox2": - command => "sb2-init raspberry /home/vagrant/raspberry_pi_development/arm-2011.03/bin/arm-none-linux-gnueabi-gcc", - cwd => "/home/vagrant/raspberry_pi_development/rootfs_f14", - environment => "HOME=/home/vagrant", - creates => "/home/vagrant/.scratchbox2", - subscribe => Exec["install-scratchbox2"], - require => [Exec["install-qemu"], Exec["unpack-fedora-rootfs"]], - refreshonly => true, - user => vagrant, - group => vagrant, - } - -} \ No newline at end of file diff --git a/modules/raspberry_dev/files/etc/profile.d/raspberry-dev.sh b/modules/raspberry_dev/files/etc/profile.d/raspberry-dev.sh new file mode 100644 index 0000000..04c2fe3 --- /dev/null +++ b/modules/raspberry_dev/files/etc/profile.d/raspberry-dev.sh @@ -0,0 +1 @@ +PATH=$PATH:/opt/raspberry-dev/bin \ No newline at end of file diff --git a/modules/raspberry_dev/files/rootfs/etc/apt/sources.list b/modules/raspberry_dev/files/rootfs/etc/apt/sources.list new file mode 100644 index 0000000..4cf60af --- /dev/null +++ b/modules/raspberry_dev/files/rootfs/etc/apt/sources.list @@ -0,0 +1,2 @@ +deb http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi +deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi diff --git a/modules/raspberry_dev/files/rootfs/etc/puppet/modules/raspbian/manifests/init.pp b/modules/raspberry_dev/files/rootfs/etc/puppet/modules/raspbian/manifests/init.pp new file mode 100644 index 0000000..896544e --- /dev/null +++ b/modules/raspberry_dev/files/rootfs/etc/puppet/modules/raspbian/manifests/init.pp @@ -0,0 +1,10 @@ + class raspbian { + + package {['locales', 'dialog']: + ensure => installed + } + + package {['pkg-config', 'libglib2.0-dev']: + ensure => installed + } +} diff --git a/modules/raspberry_dev/manifests/config.pp b/modules/raspberry_dev/manifests/config.pp new file mode 100644 index 0000000..bdae630 --- /dev/null +++ b/modules/raspberry_dev/manifests/config.pp @@ -0,0 +1,58 @@ + +class raspberry_dev::config { + $tools_prefix = '/opt/raspberry-dev' + $debs_dir = '/opt/raspberry-dev/debs' + $bin_dir = '/opt/raspberry-dev/bin' + + $user = 'vagrant' + $sbox2_container_path = '/home/vagrant/raspberry-dev/rootfs' + $sbox2_container_name = 'raspberry' + + $arm_gcc_path = "${bin_dir}/arm-linux-gnueabihf-gcc" + $qemu_path = "${bin_dir}/qemu-arm" + + + file {['/home/vagrant/raspberry-dev', + '/home/vagrant/raspberry-dev/rootfs']: + ensure => directory, + owner => vagrant, + group => vagrant + } + + file {['/opt/', + '/opt/raspberry-dev', + '/opt/raspberry-dev/debs']: + ensure => directory, + } + + file {'/etc/profile.d/raspberry-dev.sh': + source => 'puppet:///modules/raspberry_dev/etc/profile.d/raspberry-dev.sh', + mode => '0755' + } + + user {'vagrant': + ensure => present, + home => '/home/vagrant' + } -> file {'/home/vagrant': + ensure => directory, + owner => vagrant, + group => vagrant + } + + + user {'root': + ensure => present, + home => '/root' + } -> file {'/root': + ensure => directory, + owner => root, + group => root + } + + ssh::user {'vagrant': + } + + ssh::user { 'root': + home => '/root' + } +} diff --git a/modules/raspberry_dev/manifests/init.pp b/modules/raspberry_dev/manifests/init.pp new file mode 100644 index 0000000..6fd97ab --- /dev/null +++ b/modules/raspberry_dev/manifests/init.pp @@ -0,0 +1,26 @@ +# - This is cobbled together from various sources, including: +# - +# - +# - +# - +# - (This is an decent introduction to ScratchBox2) + +class raspberry_dev { + Exec { path => ['/usr/local/bin/', '/bin/', '/sbin/', '/usr/bin/', + '/usr/sbin/', '/opt/vagrant_ruby/bin', + '/opt/raspberry-dev/bin'], + timeout => 600 + } + + include sysconfig + include sysconfig::sudoers + include ssh::server + include apt + + include raspberry_dev::packages + include raspberry_dev::config + include raspberry_dev::toolchain + include raspberry_dev::qemu + include raspberry_dev::scratchbox2 + include raspberry_dev::raspbian_chroot +} \ No newline at end of file diff --git a/modules/raspberry_dev/manifests/packages.pp b/modules/raspberry_dev/manifests/packages.pp new file mode 100644 index 0000000..87d7669 --- /dev/null +++ b/modules/raspberry_dev/manifests/packages.pp @@ -0,0 +1,9 @@ +class raspberry_dev::packages { + $required_packages = ['libncurses5', 'fakeroot', 'debootstrap', 'curl', + 'libstdc++6:i386', 'zlib1g:i386', 'libc6-dev-i386', 'build-essential'] + + package {$required_packages: + ensure => installed, + require => Exec['apt-get update'] + } +} diff --git a/modules/raspberry_dev/manifests/qemu.pp b/modules/raspberry_dev/manifests/qemu.pp new file mode 100644 index 0000000..467758e --- /dev/null +++ b/modules/raspberry_dev/manifests/qemu.pp @@ -0,0 +1,15 @@ +class raspberry_dev::qemu { + $qemu_url = 'http://commondatastorage.googleapis.com/howling-fantods/raspberrypi/raspberry-qemu_1.3.0_amd64.deb' + $qemu_deb_filename = 'raspberry-qemu_1.3.0_amd64.deb' + + exec {'download-qemu': + command => "curl -L ${qemu_url} -o ${qemu_deb_filename}", + cwd => $raspberry_dev::config::debs_dir, + creates => "${raspberry_dev::config::debs_dir}/${qemu_deb_filename}" + + } -> package {'raspberry-qemu': + provider => dpkg, + source => "${raspberry_dev::config::debs_dir}/${qemu_deb_filename}", + ensure => installed + } +} \ No newline at end of file diff --git a/modules/raspberry_dev/manifests/raspbian_chroot.pp b/modules/raspberry_dev/manifests/raspbian_chroot.pp new file mode 100644 index 0000000..e9c97af --- /dev/null +++ b/modules/raspberry_dev/manifests/raspbian_chroot.pp @@ -0,0 +1,89 @@ +# Class: raspberry_dev::scratchbox2 +# +# +class raspberry_dev::raspbian_chroot { + $raspbian_mirror = 'http://archive.raspbian.org/raspbian/' + + $container_init_cmd = "sb2-init -n \ + -c ${raspberry_dev::config::qemu_path} \ + ${raspberry_dev::config::sbox2_container_name} \ + ${raspberry_dev::config::arm_gcc_path}" + + $bootstrap_cmd = + "fakeroot debootstrap --verbose --foreign --variant=scratchbox \ + --arch armhf --keyring /etc/apt/trusted.gpg wheezy \ + ${raspberry_dev::config::sbox2_container_path} ${raspbian_mirror}" + + # without this, sbox2 sees HOME as "/root" for some reason, and all sb2 + # commands fail. + $sbox2_required_env_flags = ["HOME=/home/vagrant"] + + exec {'scratchbox2-init-container': + command => $container_init_cmd, + environment => $sbox2_required_env_flags, + cwd => $raspberry_dev::config::sbox2_container_path, + unless => "sudo -u vagrant sb2-config -l | grep \"^${raspberry_dev::config::sbox2_container_name}$\"", + user => vagrant, + group => vagrant, + + } -> exec {'raspbian-install-key': + command => 'curl http://archive.raspbian.org/raspbian.public.key | apt-key add -', + unless => 'apt-key list | grep "Raspberry Pi Debian"' + + } -> exec {'debootstrap-first-stage': + command => $bootstrap_cmd, + environment => $sbox2_required_env_flags, + creates => "${raspberry_dev::config::sbox2_container_path}/var", + user => vagrant, + group => vagrant, + timeout => 1500, # 25 minutes + + } -> exec {'debootstrap-second-stage': + command => "sb2 -t raspberry ./debootstrap/debootstrap --verbose --second-stage", + environment => $sbox2_required_env_flags, + cwd => $raspberry_dev::config::sbox2_container_path, + user => vagrant, + group => vagrant, + onlyif => "test -f \"${raspberry_dev::config::sbox2_container_path}/debootstrap/debootstrap\"", + # tries => 2 is set because in my experience, debootstrap fails the first + # time round, only to succeed on the second. Hmph. The error is: + # I: Configuring initramfs-tools... + # W: Failure while configuring required packages. + tries => 2, + timeout => 1500, # 25 minutes + + } -> file {"${raspberry_dev::config::sbox2_container_path}/etc/apt/sources.list": + source => "puppet:///modules/raspberry_dev/rootfs/etc/apt/sources.list", + ensure => present, + owner => vagrant, + group => vagrant + + } -> exec {'sandbox-apt-get-update': + command => "sb2 -t ${raspberry_dev::config::sbox2_container_name} -eR apt-get update", + environment => $sbox2_required_env_flags, + cwd => $raspberry_dev::config::sbox2_container_path, + user => vagrant, + group => vagrant, + + } -> exec {'sandbox-install-essentials': + command => "sb2 -t ${raspberry_dev::config::sbox2_container_name} -eR apt-get install puppet --assume-yes", + environment => $sbox2_required_env_flags, + cwd => $raspberry_dev::config::sbox2_container_path, + user => vagrant, + group => vagrant, + + } -> file {"${raspberry_dev::config::sbox2_container_path}/etc/puppet/modules/raspbian": + source => "puppet:///modules/raspberry_dev/rootfs/etc/puppet/modules/raspbian", + recurse => true, + ensure => present, + owner => vagrant, + group => vagrant + + } -> exec {'sandbox-provision': + command => "sb2 -t ${raspberry_dev::config::sbox2_container_name} -eR puppet apply -e \"include raspbian\"", + environment => $sbox2_required_env_flags, + cwd => $raspberry_dev::config::sbox2_container_path, + user => vagrant, + group => vagrant, + } +} diff --git a/modules/raspberry_dev/manifests/scratchbox2.pp b/modules/raspberry_dev/manifests/scratchbox2.pp new file mode 100644 index 0000000..c2e6aff --- /dev/null +++ b/modules/raspberry_dev/manifests/scratchbox2.pp @@ -0,0 +1,16 @@ +class raspberry_dev::scratchbox2 { + $sbox2_url = 'http://commondatastorage.googleapis.com/howling-fantods/raspberrypi/raspberry-scratchbox2_2.3.90_amd64.deb' + $sbox2_deb_filename = 'raspberry-scratchbox2_2.3.90_amd64.deb' + + exec {'download-sbox2': + command => "curl -L ${sbox2_url} -o ${sbox2_deb_filename}", + cwd => $raspberry_dev::config::debs_dir, + creates => "${raspberry_dev::config::debs_dir}/${sbox2_deb_filename}" + + } -> package {'raspberry-scratchbox2': + provider => dpkg, + source => "${raspberry_dev::config::debs_dir}/${sbox2_deb_filename}", + ensure => installed + + } +} \ No newline at end of file diff --git a/modules/raspberry_dev/manifests/toolchain.pp b/modules/raspberry_dev/manifests/toolchain.pp new file mode 100644 index 0000000..4b25185 --- /dev/null +++ b/modules/raspberry_dev/manifests/toolchain.pp @@ -0,0 +1,15 @@ +class raspberry_dev::toolchain { + $toolchain_url = 'http://commondatastorage.googleapis.com/howling-fantods/raspberrypi/raspberry-gcc-toolchain_1.0_i386.deb' + $toolchain_deb_filename = 'raspberry-gcc-toolchain_1.0_i386.deb' + + exec {'download-toolchain': + command => "curl -L ${toolchain_url} -o ${toolchain_deb_filename}", + cwd => $raspberry_dev::config::debs_dir, + creates => "${raspberry_dev::config::debs_dir}/${toolchain_deb_filename}" + + } -> package {'raspberry-gcc-toolchain': + provider => dpkg, + ensure => installed, + source => "${raspberry_dev::config::debs_dir}/${toolchain_deb_filename}" + } +} \ No newline at end of file diff --git a/puppetmanifests/raspberry-nox.pp b/puppetmanifests/raspberry-nox.pp index e9fc85f..34279c2 100644 --- a/puppetmanifests/raspberry-nox.pp +++ b/puppetmanifests/raspberry-nox.pp @@ -1,2 +1,2 @@ -include boxes::devbox \ No newline at end of file +include raspberry_dev \ No newline at end of file From bbb55a80a5021db323479180f15057f5fde76588 Mon Sep 17 00:00:00 2001 From: Nicholas Hutchinson Date: Wed, 19 Dec 2012 16:11:10 +1300 Subject: [PATCH 2/8] Update LICENSE and README --- LICENSE | 2 +- README.md | 132 ++++++++++++++---------------------------------------- 2 files changed, 35 insertions(+), 99 deletions(-) diff --git a/LICENSE b/LICENSE index 68e9012..ff90f3a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011 Florian Gilcher , Felix Gilcher +Copyright (c) 2011-2012 Florian Gilcher , Felix Gilcher , Nicholas Hutchinson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index cbbee59..6ac4062 100644 --- a/README.md +++ b/README.md @@ -1,124 +1,60 @@ # Raspberry Pi Devbox -A virtual machine built for raspberry pi development, based on http://russelldavis.org/2012/01/27/setting-up-a-vm-for-raspberry-pi-development-using-virtualbox-scratchbox2-qemu-part-1/ +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 . -## Words of Caution +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. -Vagrant uses a default user with a default password and a well known keypair for authentication. The default user has superuser access. Running a vagrant box in a configuration that makes it accessible from the outside is a major security risk. The default configuration prevents outside access by using NAT and host-only networking exclusively. Do not tamper with that configuration unless you know what you're doing. If you need to run a vagrant box in a network-accessible configuration at least change the passwords and keypairs. +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. -## Virtualbox +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: + + sb2 -eR apt-get install ... -The basic virtualization-layer is [[Virtualbox | https://www.virtualbox.org/]]. Any current version should do, however the guest additions are pinned to version of the GA release at the time the base box was built (4.1.8). A mismatch between the guest-additions and the virtualbox version may result in strange behavior, mostly affecting shared folders and networking. To update the guest additions follow the instructions in the virtualbox manual. +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: . -## Vagrant +## Installation -[[Vagrant | http://vagrantup.com/]] is the scripting toolkit used to control all interaction with the devbox. Any recent version of vagrant (>= 0.9) should work. +1. Install both VirtualBox and Vagrant. +2. In a terminal, execute `git clone git://github.com/nickhutchinson/raspberry-devbox.git && cd raspberry-devbox` +3. Execute `vagrant up` to launch and provision your Virtual Machine. -A full guide on vagrant can be found on the [[Vagrant site | http://vagrantup.com/docs ]]. As a short primer, the following commands should be sufficient: +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. -* `vagrant up ` start the given box. If the box has not been initialized and created, this will download the basebox as required, bootstrap it and run the provisioner. Running `vagrant up` when the box is already running is a NOOP and has no effect. -* `vagrant halt ` stop the given box. Has no effect if the box is not running. May require an invocation using the `--force` flag (`vagrant halt --force `) if the box crashed, locked up or cannot be accessed via `vagrant ssh` -* `vagrant reload ` stop and start the given box. Runs the provisioner. -* `vagrant provision ` Runs the provisioner. -* `vagrant destroy ` destroys the given box. This is useful if for some reason the box has been damaged or to free diskspace. Running `vagrant up` after running `vagrant destroy` bootstraps a new box. -* `vagrant ssh ` open an ssh connection to the given box. - -By default all boxes are set to boot in headleass mode, that is without a graphical user interface. Gui mode can be enabled by uncommenting the `box.vm.boot_mode = :gui` line in the appropriate section of the vagrantfile. +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`) -## Hardware +After installation has completed, you should find: -At the moment, the devbox only works in 64bit processors with Vanderpool (hardware virtualization, VT-x for Intel, AMD-V for AMD processors) enabled. While the first can be fixed by compiling a 32bit devbox, the latter will lead to an excessive performance penalty. Be aware that even if a processor supports implements VT-x, some notebook vendors deactivate it. Known states: +- In `~/raspberry-dev/rootfs` + - the [Raspbian](http://www.raspbian.org) chroot. +- In `/opt/raspberry-dev` + - 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. + - [QEmu](http://wiki.qemu.org/Main_Page) 1.3.0 + - [ScratchBox2](http://maemo.gitorious.org/scratchbox2) @ git tag 2.3.90 (earlier releases didn't seem to work) -* Dell Latitude: works out of the box - - Some Dell models deactivate VT-x by default, but this can be changed in BIOS -* All Apple notebooks currently available work -* All Intel i3/5/7 processors support VT-x, if not disabled by the vendor. +## VirtualBox +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. -## Puppet - -Package and config-file management is handled by puppet and the vagrant puppet provisioner. The required puppet installation is in the base box, all manifests can be found in the toolbox repository. No puppet installation is needed on the host system. +## Vagrant -## Installation / First Use +[Vagrant](http://vagrantup.com) is the scripting toolkit used to control all interaction with the devbox. A full guide on Vagrant can be found on the [Vagrant site](http://vagrantup.com). As a short primer, the following commands should be sufficient: -* Install Virtualbox and Vagrant. See [[Installing Vagrant | http://vagrantup.com/docs/getting-started/index.html]] for a guide. You may skip the last step. -* Clone the repository using a git client of your choice. Mac users that are not comfortable using the commandline may use [[Github for Mac | http://mac.github.com/]] to download the repository and any updates -* Open the shell of your choice and navigate to the repository -* Run `vagrant up ` to boot the box. See the list of available boxes for the name. +* `vagrant up ` start the given box. If the box has not been initialized and created, this will download the basebox as required, bootstrap it and run the provisioner. Running `vagrant up` when the box is already running is a NOOP and has no effect. +* `vagrant halt ` stop the given box. Has no effect if the box is not running. May require an invocation using the `--force` flag (`vagrant halt --force `) if the box crashed, locked up or cannot be accessed via `vagrant ssh` +* `vagrant reload ` stop and start the given box. Runs the provisioner. +* `vagrant provision ` Runs the provisioner. +* `vagrant destroy ` destroys the given box. This is useful if for some reason the box has been damaged or to free disk space. Running `vagrant up` after running `vagrant destroy` bootstraps a new box. +* `vagrant ssh ` open an ssh connection to the given box. -Vagrant will now download the basebox, bootstrap the environment and run the provisioner for the first time. Since the basebox must be downloaded and some source must be compiled, the first run may take some time depending on your machines speed and network connection. No supervision should be required, running the install over night should be just fine. Future runs will be faster since the software is only installed on the first run. Future runs should not require network connectivity, execpt when destroying and rebuilding a box. - -## Pulling Updates - -Pulling updates is done by updating the repository to get the latest puppet manifests and/or remove the src folder as well as the raspberry_pi_development folder inside the box to trigger a redownload of the src and a rebuild of the packages. After updating the repository the provisioner needs to be triggered by running `vagrant provision ` on the console. This will install any new packages and update config-files as required. The provisioner is also triggered on each fresh boot of the devbox. - -## Help, Something went wrong. - -* Sometimes vagrant fails to mount the shared folders for the puppet provisioner. This usually results in puppet complaining about a missing file or folder. Reloading the box using `vagrant reload ` usually solves this problem. -* Sometimes dependencies between puppet packages are not modeled correctly. This usually results in puppet printing the message "Skipping because of failed dependencies" to the console. This problem usually can be solved by re-running the puppet provisioner using `vagrant provision `. Sometimes multiple runs are required to solve the issue. Please report such issues so that we can fix the dependencies. -* Box does not boot properly and cannot be accessed via `vagrant ssh`: Enable gui mode by uncommenting the `box.vm.boot_mode = :gui` line in the config and reload the box using the `--force` flag. Observe the error messages. - -## Boxes - -### No X (nox) - -Start using `vagrant up nox`. The box does not include an X environment. Instead it allows ssh access and exports the home directory via nfs. This way you can develop using your favorite IDE on your host system. A box that contains a full X11-environment will be provided. - - -## Tips & Tricks - -### Connecting to the Box - -Using `vagrant ssh` is not required to connect to the box. Vagrant uses a regular ssh connection with a special, known keypair. To connect to the box using regular ssh command follow this procedure: - -* Download the default keypair from the [[git repository|https://github.com/mitchellh/vagrant/tree/master/keys/]] and place the private key in a convenient location. `~/.ssh/vagrant` is a suitable location on unix/linux/macos systems. -* Make sure that the key is user-readable only (0600 on unix-style systems) -* Add the following section to the ssh configfile -* use `ssh app-vagrant` to connect to the appserver -* Enable agent-forwarding so you can check out and update the github repositories - -```` -Host app-vagrant # or any other alias - Hostname 33.33.33.20 # ip of the box you want to connect to - User vagrant - PreferredAuthentications publickey - IdentityFile ~/.ssh/vagrant - ForwardAgent yes - StrictHostKeyChecking no - UserKnownHostsFile /dev/null -```` - -This is especially useful in conjunction with the iterm2 stored profiles feature. - -### GIT_* Environment Variables - -The ssh daemon in the box is configured to accept all environment variables starting with `GIT_*`. Setting the variables on the host server allows to send those variables to the environment in the devbox. The git command will use those variables to credit commits to the proper author. The following two bits of configuration are required: - -Add the variables to the shell of your choice, for example in .bashrc: - -```` -export GIT_AUTHOR_EMAIL= -export GIT_AUTHOR_NAME='' -export GIT_COMMITTER_EMAIL= -export GIT_COMMITTER_NAME='' -export GIT_EDITOR=/usr/bin/vim -```` - -Configure ssh to send the env variables to the guest system: +## Puppet -```` -Host app-vagrant - SendEnv GIT_* -```` +Provisioning of the Virtual Machine is handled by [Puppet](http://puppetlabs.com). Take a look at the `raspberry_dev` module. -## Bugs, Fixes, Improvement +## Bugs, fixes, improvements -If you encounter a bug, please file a ticket. If you'd like to help, fork the repository, make your changes and send me a pull request. Please use feature-branches :). +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! ## Todo * all of this is still quite rough -* the path to qemu and scratchbox2 is currently not set up properly, add a 'export PATH="/home/vagrant/raspberry_pi_development/qemu/bin/:/home/vagrant/raspberry_pi_development/scratchbox2/bin:$PATH"' to the .bashrc * improve on the readme -* add hostonly networking and nfs share -* add a second vm that has X From dc0c5291929e471a20ce066192b0b9af8b6233e8 Mon Sep 17 00:00:00 2001 From: Nicholas Hutchinson Date: Wed, 19 Dec 2012 18:12:05 +1300 Subject: [PATCH 3/8] Fix incorrect sb2 command line --- modules/raspberry_dev/manifests/raspbian_chroot.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/raspberry_dev/manifests/raspbian_chroot.pp b/modules/raspberry_dev/manifests/raspbian_chroot.pp index e9c97af..45bc639 100644 --- a/modules/raspberry_dev/manifests/raspbian_chroot.pp +++ b/modules/raspberry_dev/manifests/raspbian_chroot.pp @@ -39,7 +39,7 @@ timeout => 1500, # 25 minutes } -> exec {'debootstrap-second-stage': - command => "sb2 -t raspberry ./debootstrap/debootstrap --verbose --second-stage", + command => "sb2 -t raspberry -eR ./debootstrap/debootstrap --verbose --second-stage", environment => $sbox2_required_env_flags, cwd => $raspberry_dev::config::sbox2_container_path, user => vagrant, @@ -51,7 +51,7 @@ # W: Failure while configuring required packages. tries => 2, timeout => 1500, # 25 minutes - + } -> file {"${raspberry_dev::config::sbox2_container_path}/etc/apt/sources.list": source => "puppet:///modules/raspberry_dev/rootfs/etc/apt/sources.list", ensure => present, From ffa30cf31fdbfbed0b8023cee2abe4a7342e7e18 Mon Sep 17 00:00:00 2001 From: Jerry L Date: Wed, 15 Jun 2016 18:13:42 -0500 Subject: [PATCH 4/8] upgrade to raspbian jessie, wip --- Customfile | 4 ++++ Vagrantfile | 9 +++++++++ modules/raspberry_dev/files/rootfs/etc/apt/sources.list | 4 ++-- modules/raspberry_dev/manifests/raspbian_chroot.pp | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 Customfile diff --git a/Customfile b/Customfile new file mode 100644 index 0000000..d667f7a --- /dev/null +++ b/Customfile @@ -0,0 +1,4 @@ +config.vm.provider "virtualbox" do |v| + v.memory = 3072 + v.cpus = 4 +end diff --git a/Vagrantfile b/Vagrantfile index f49bb8d..382b3c8 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -26,3 +26,12 @@ Vagrant::Config.run do |config| end end end + +Vagrant.configure("2") do |config| + + config.vm.provider "virtualbox" do |v| + v.memory = 4096 + v.cpus = 4 + end + +end diff --git a/modules/raspberry_dev/files/rootfs/etc/apt/sources.list b/modules/raspberry_dev/files/rootfs/etc/apt/sources.list index 4cf60af..3a0e4ca 100644 --- a/modules/raspberry_dev/files/rootfs/etc/apt/sources.list +++ b/modules/raspberry_dev/files/rootfs/etc/apt/sources.list @@ -1,2 +1,2 @@ -deb http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi -deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi +deb http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi +deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi diff --git a/modules/raspberry_dev/manifests/raspbian_chroot.pp b/modules/raspberry_dev/manifests/raspbian_chroot.pp index 45bc639..1365c72 100644 --- a/modules/raspberry_dev/manifests/raspbian_chroot.pp +++ b/modules/raspberry_dev/manifests/raspbian_chroot.pp @@ -11,7 +11,7 @@ $bootstrap_cmd = "fakeroot debootstrap --verbose --foreign --variant=scratchbox \ - --arch armhf --keyring /etc/apt/trusted.gpg wheezy \ + --arch armhf jessie \ ${raspberry_dev::config::sbox2_container_path} ${raspbian_mirror}" # without this, sbox2 sees HOME as "/root" for some reason, and all sb2 From b6f5c5b383d9d1ba4cb2bcc5b69f441a9dbfb938 Mon Sep 17 00:00:00 2001 From: Jerry L Date: Wed, 15 Jun 2016 21:39:02 -0500 Subject: [PATCH 5/8] update to raspbian jessie and latest gcc toolchain (4.8.3) --- Vagrantfile | 2 +- modules/raspberry_dev/manifests/packages.pp | 2 +- .../manifests/raspbian_chroot.pp | 4 +++- modules/raspberry_dev/manifests/toolchain.pp | 20 +++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 382b3c8..c60e080 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,7 +6,7 @@ Vagrant::Config.run do |config| # options are documented and commented below. For a complete reference, # please see the online documentation at vagrantup.com. - config.vm.define :nox do |box| + config.vm.define :nox1 do |box| # Every Vagrant virtual environment requires a box to build off of. box.vm.box = "precise64" # The url from where the 'config.vm.box' box will be fetched if it diff --git a/modules/raspberry_dev/manifests/packages.pp b/modules/raspberry_dev/manifests/packages.pp index 87d7669..74319ac 100644 --- a/modules/raspberry_dev/manifests/packages.pp +++ b/modules/raspberry_dev/manifests/packages.pp @@ -1,6 +1,6 @@ class raspberry_dev::packages { $required_packages = ['libncurses5', 'fakeroot', 'debootstrap', 'curl', - 'libstdc++6:i386', 'zlib1g:i386', 'libc6-dev-i386', 'build-essential'] + 'libstdc++6:i386', 'zlib1g:i386', 'libc6-dev-i386', 'build-essential', 'git'] package {$required_packages: ensure => installed, diff --git a/modules/raspberry_dev/manifests/raspbian_chroot.pp b/modules/raspberry_dev/manifests/raspbian_chroot.pp index 1365c72..5cd3f70 100644 --- a/modules/raspberry_dev/manifests/raspbian_chroot.pp +++ b/modules/raspberry_dev/manifests/raspbian_chroot.pp @@ -29,7 +29,9 @@ } -> exec {'raspbian-install-key': command => 'curl http://archive.raspbian.org/raspbian.public.key | apt-key add -', unless => 'apt-key list | grep "Raspberry Pi Debian"' - + } -> exec {'fix-debootstrap-script': + command => 'ln -s /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/jessie', + unless => 'ls /usr/share/debootstrap/scripts | grep jessie' } -> exec {'debootstrap-first-stage': command => $bootstrap_cmd, environment => $sbox2_required_env_flags, diff --git a/modules/raspberry_dev/manifests/toolchain.pp b/modules/raspberry_dev/manifests/toolchain.pp index 4b25185..d9127ce 100644 --- a/modules/raspberry_dev/manifests/toolchain.pp +++ b/modules/raspberry_dev/manifests/toolchain.pp @@ -1,15 +1,13 @@ class raspberry_dev::toolchain { - $toolchain_url = 'http://commondatastorage.googleapis.com/howling-fantods/raspberrypi/raspberry-gcc-toolchain_1.0_i386.deb' - $toolchain_deb_filename = 'raspberry-gcc-toolchain_1.0_i386.deb' + $toolchain_url = 'https://github.com/raspberrypi/tools' exec {'download-toolchain': - command => "curl -L ${toolchain_url} -o ${toolchain_deb_filename}", + command => "git clone ${toolchain_url}", cwd => $raspberry_dev::config::debs_dir, - creates => "${raspberry_dev::config::debs_dir}/${toolchain_deb_filename}" - - } -> package {'raspberry-gcc-toolchain': - provider => dpkg, - ensure => installed, - source => "${raspberry_dev::config::debs_dir}/${toolchain_deb_filename}" - } -} \ No newline at end of file + creates => "${raspberry_dev::config::debs_dir}/tools" + } -> exec {'install-toolchain': + command => "cp -r arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/* \ + ${raspberry_dev::config::tools_prefix}", + cwd => "${raspberry_dev::config::debs_dir}/tools" + } +} From dcafa6f19d2687ac0c0aa5c9105dd36b3b10b354 Mon Sep 17 00:00:00 2001 From: Jerry L Date: Wed, 15 Jun 2016 21:59:51 -0500 Subject: [PATCH 6/8] Update README.md --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6ac4062..87f4b6a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Raspberry Pi Devbox -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 . +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 and 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). 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. @@ -27,10 +27,17 @@ After installation has completed, you should find: - In `~/raspberry-dev/rootfs` - the [Raspbian](http://www.raspbian.org) chroot. - In `/opt/raspberry-dev` - - 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. + - 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. - [QEmu](http://wiki.qemu.org/Main_Page) 1.3.0 - [ScratchBox2](http://maemo.gitorious.org/scratchbox2) @ git tag 2.3.90 (earlier releases didn't seem to work) +## Example Usage + +* Starting the VM: in the program root directory, run `vagrant up` to start the VM, then `vagrant ssh` to enter it. +* `sb2 make` make using host cross compiler toolchain. +* `sb2 -e make` make using emulated target toolchain. +* `sb2 -eR make install` install in emulation mode as root. + ## VirtualBox 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 +57,5 @@ The basic virtualization layer is [VirtualBox](https://www.virtualbox.org). Any Provisioning of the Virtual Machine is handled by [Puppet](http://puppetlabs.com). Take a look at the `raspberry_dev` module. -## Bugs, fixes, improvements - -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! - -## Todo - -* all of this is still quite rough -* improve on the readme +## Bugs +* Some programs such as aptitude crash with segfault when run in emulation mode. Updated qemu might fix this From 60f0c7be278d3a7e077b4e9a65d99d7852083f8d Mon Sep 17 00:00:00 2001 From: Jerry L Date: Wed, 15 Jun 2016 22:00:13 -0500 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87f4b6a..6234bc6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Raspberry Pi Devbox -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 and 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). +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 , 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). 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. From 0611a0a8167d092532b66c0e73bf8e4761052409 Mon Sep 17 00:00:00 2001 From: Jerry L Date: Wed, 15 Jun 2016 22:06:25 -0500 Subject: [PATCH 8/8] Update README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6234bc6..105e0a9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This VM includes a sandboxed installation ("chroot") of [Raspbian](http://www.ra 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. 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: - + sb2 -eR apt-get install ... 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: . @@ -20,7 +20,7 @@ This executes `apt-get` in the default ScratchBox2 container (in our case, we on 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. -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`) +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` After installation has completed, you should find: @@ -31,6 +31,11 @@ After installation has completed, you should find: - [QEmu](http://wiki.qemu.org/Main_Page) 1.3.0 - [ScratchBox2](http://maemo.gitorious.org/scratchbox2) @ git tag 2.3.90 (earlier releases didn't seem to work) +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`: + + v.memory = 4096 + v.cpus = 4 + ## Example Usage * Starting the VM: in the program root directory, run `vagrant up` to start the VM, then `vagrant ssh` to enter it.