Pre-built environment for Raspberry Pi cross-compiling and NFS booting


#20

I’ve just deployed my first project developed with this workflow on a standalone rPi. The project used slimmed down versions of ofxTimeline and ofxUI, which had previously taken 1-1.5 hours to compile on the pi. Using this workflow, each compile cycle took about 3 minutes.

@eric_gradman I’d like to help add to your read_me for this process. what’s the best way forward for that?


#21

Oh man, that’s cool.
Fork my repository, and send me pull requests!


#22

Thanks a lot for sharing!


#23

this looks awesome! will try it out and report back how it goes!


#24

Thanks A LOT!
It saves so much time compiling oF!

But I’m a newbie and have quite some difficulties to understand:

  1. where to put your project in order to compile them and sync them to the PI
    but especially how to turn the NFS boot “off” on the rpi SD to get a standalone image.
    I don’t really get what do to when you say:
  2. On the Raspberry Pi root partition, alter /etc/fstab and restore the mount point for /
  3. On the Raspberry Pi boot partition, remove the stuff after “rootwait”

do you make a sudo nano on fstab?
where to remove the stuff rootwait ?

Thanks for the help


#25

the stuff after rootwait in cmdline.txt on the /boot partition. (NOT including rootwait)


#26

Thanks for this! I am starting with all this mess of cross compiling with OSX & RPi.

I have seen the “official” guide too (http://openframeworks.cc/setup/raspberrypi/Raspberry-Pi-Cross-compiling-guide.html) and this one also: https://github.com/timknapen/Raspberry

I will try to get this method working… but I have a doubt:
Can I use Parallels? or it must be done with Virtual Box? (I ask this because I tryed to make VB work without success. I get some problems with Ubuntu and Ati graphics)


#27

Yes you can use Parallels! I am using Parallels myself, but I decided to release this with VirtualBox because it’s free.

Substituting this line in your Vagrantfile should make it “just work”

config.vm.box = “parallels/ubuntu-12.04”


#28

ok. I am testing now. I edited the line ou told me and I get this error:

McZ:rpi-build-and-boot manu$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'parallels/ubuntu-12.04' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'parallels/ubuntu-12.04'
    default: URL: https://vagrantcloud.com/parallels/ubuntu-12.04
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

Name: parallels/ubuntu-12.04
Address: https://vagrantcloud.com/parallels/ubuntu-12.04
Requested provider: [:virtualbox]

I changed the wired ip on OSX, and accessing internet by the wifi.
This command should build an Ubuntu image from scratch? … I tested with my installed Ubuntu 14.04 LTS in Parallels running too. I have not changed his ip. Maybe I need to change the ip of the Ubuntu?

Maybe is too hard for me…

EDIT: I just followed all the “oficial” cross compile guide, and I get the PK CONFIG ERRORS…


#29

I am back trying to setup this. I have a more precise question (i hope)…
Must I do the last “Post-Install Setup” step on this https://devopsu.com/guides/ansible-mac-osx.html ?
I mean to configure the servers like this https://devopsu.com/guides/ansible-post-install.html ?
Thanks


#30

OK! finally I made the ‘vagrant up’ command work !! :slight_smile:
The problem was I didn’t was getting access to the internet from the terminal, and then it didn’t found the server.
I solved this sharing in preferences the internet access from the wifi to the wired one.


#31

It sure looks like you’re still using the virtualbox provider… is it running properly in Parallels now?


#32

I am using Virtual Box, to minimize differences with your instructions.

Now I am in the ‘NFS boot your Pi’ step.
It stops after booting a little time, I think it not founds the networked VM.

Should I connect the RPi to the OSX machine directly with a ethernet cable? or must I plug both to the router hub?
I am not sure because I don’t now if the router can handle 2 different masks networks…


#33

it doesn’t matter if you use a switch/hub. it should work either way (unless your router isn’t routing packets properly).

make sure another computer (not a rpi!) on that router can ping the virtual machine.


#34

@moebiussurfing
Some note on getting this Vagrant running with Parallels

first you need this vagrant plugin installed by using this line
vagrant plugin install vagrant-parallels

then get vagrant box for parallels install with this line
vagrant box add parallels/ubuntu-12.04

I also changed this line in Vagrantfile according to @eric_gradman
config.vm.box = "parallels/ubuntu-12.04"

Then when you vagrant up you can avoid calling default provider (VirtualBox) by run
vagrant up --provider parallels


#35

Thanks. I’ll try again all this thing soon. I decided to surrender some time ago.
I was stucked with some python problems. I think there were 2 different python versions “in conflict” or something.
Now I am needing it again because all RPi compiling it’s very slow here.


#36

Thanks for putting this together! This has saved me so much frustration!


#37

I’m running into the same problem. At around 5 seconds into booting the pi says

bootserver=10.0.0.1, rootserver=10.0.0.1, rootpath=

and then nothing, until around 310 seconds:

VFS: Unable to mount root fs via NFS, trying floppy

I don’t have an other machine on the network to try pinging, but (at least) from my (OS X) terminal I can ping the Vagrant (10.0.0.1) machine fine, and vice versa (vagrant pings 10.0.0.2 alright and can also ssh into OS X.)

Any ideas?


#38

is there some option to login as pi user? I cant seem to get write access with this.


#39

You missed a semicolon at the end of the line of the first Acquire. It should be

Acquire::http::proxy "http://10.0.0.1:8888";
Acquire::https::proxy "https://10.0.0.1:8888";

How did you make to get internet access for the RPI? Following your instructions I could do apt-get, but not wget, ping, etc

edit

Replying to myself, I had to do this to route all traffic from the RPI to the internet (Found in https://support.hidemyass.com/hc/en-us/articles/202721486-Using-Linux-Virtual-Machine-instead-of-a-router-for-VPN):

In your Ubuntu VM, assuming that eth0: internet, eth1: your RPI connected via ethernet cable

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -A FORWARD -o eth0 -i eth1 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
sudo iptables-save | sudo tee /etc/iptables.sav

uncomment this line in /etc/sysctl.conf

net.ipv4.ip_forward=1

Also, I removed all references to the proxy, but not sure if that affected… i did many things at the same time, such a bad methodology

Done!