This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 504ef38
Showing
10 changed files
with
8,991 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*~ | ||
|
||
# ignore vagrant box specific configuration | ||
.vagrant/ | ||
|
||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# this Vagrantfile only works with VirtualBox so we set the default provider here | ||
# so we can skip the --provider virtualbox option | ||
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox' | ||
|
||
# use half of the available memory | ||
def get_memory_setting(host) | ||
divider = 2 | ||
if host =~ /darwin/ | ||
mem = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / divider | ||
elsif host =~ /linux/ | ||
mem = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / divider | ||
else # Windows | ||
mem = `for /F "tokens=2 delims==" %i in ('wmic computersystem get TotalPhysicalMemory /value') do @echo %i`.to_i / 1024 / 1024 / divider | ||
end | ||
return mem | ||
end | ||
|
||
def get_cpu_setting(host) | ||
if host =~ /darwin/ | ||
cpus = `sysctl -n hw.ncpu`.to_i | ||
elsif host =~ /linux/ | ||
cpus = `nproc`.to_i | ||
else # Windows | ||
cpus = `for /F "tokens=2 delims==" %i in ('wmic cpu get NumberOfCores /value') do @echo %i`.to_i | ||
end | ||
return cpus | ||
end | ||
|
||
Vagrant.configure(2) do |config| | ||
config.vm.box = "ubuntu/trusty64" | ||
# a private network is needed for using NFS | ||
config.vm.network :private_network, ip: '192.168.50.50' | ||
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp'] | ||
# config.bindfs.bind_folder "/vagrant", "/vagrant" | ||
config.vm.define "docker-raspbian" do |config| | ||
config.vm.hostname = "docker-raspbian" | ||
config.ssh.forward_agent = true | ||
config.vm.provision "shell", path: "scripts/provision.sh", privileged: false | ||
config.vm.provider "virtualbox" do |vb| | ||
# find out on which host os we are running | ||
host = RbConfig::CONFIG['host_os'] | ||
vb.customize ["modifyvm", :id, "--ioapic", "on"] | ||
vb.memory = get_memory_setting(host) | ||
vb.cpus = get_cpu_setting(host) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh -e | ||
FILES="bootcode.bin fixup.dat fixup_cd.dat fixup_x.dat kernel.img kernel7.img | ||
kernel_cutdown.img kernel_emergency.img kernel7_emergency.img start.elf start_cd.elf start_x.elf" | ||
|
||
printf "Memory split is now set in /boot/config.txt.\n" | ||
printf "You may want to use raspi-config to set it\n" | ||
|
||
|
||
for FN in $FILES; do | ||
# Need to rm first to avoid error "rename involves overwriting ... with | ||
# different file ..., not allowed | ||
rm -f /boot/$FN | ||
dpkg-divert --package rpikernelhack --remove --rename /boot/$FN | ||
sync | ||
done | ||
|
||
|
||
#DEBHELPER# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh -e | ||
FILES="bootcode.bin fixup.dat fixup_cd.dat fixup_x.dat kernel.img kernel7.img | ||
kernel_cutdown.img kernel_emergency.img kernel7_emergency.img start.elf start_cd.elf start_x.elf" | ||
|
||
# dpkg-divert will error out otherwise | ||
mkdir -p /usr/share/rpikernelhack | ||
|
||
for FN in $FILES; do | ||
dpkg-divert --package rpikernelhack --divert /usr/share/rpikernelhack/$FN \ | ||
/boot/$FN | ||
done | ||
|
||
#DEBHELPER# |
Oops, something went wrong.