Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @devrandom
9 changes: 9 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2017-02-14
----------

- VirtualBox launches are now headless. You can use the VirtualBox Manager to open the console UI if needed.
- Debian on VirtualBox is supported via Vagrant Cloud images
- Note that Debian on kvm is currently not supported because vmbuilder fails in the grub install stage
- git submodule support - any submodules are cloned and checked out
- Note that lxc-execute in Ubuntu 17.10 has a showstopper bug in stdin handling

2015-12-12
----------

Expand Down
28 changes: 23 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,45 @@ echo "ok"
SCRIPT

archs = ["amd64", "i386"]
suites = ["precise", "quantal", "raring", "saucy", "trusty"]
ubuntu_suites = ["precise", "quantal", "raring", "saucy", "trusty", "xenial", "bionic"]
debian_suites = ["jessie", "stretch"]

if ARGV[0] == "up" and ARGV.length == 1
puts "Specify a name of the form 'suite-architecture'"
puts " suites: " + suites.join(', ')
puts " ubuntu suites: " + ubuntu_suites.join(', ')
puts " debian suites (x86_64 only): " + debian_suites.join(', ')
puts " architectures: " + archs.join(', ')
Process.exit 1
end

Vagrant.configure("2") do |config|
# vagrant 1.9.1 (Ubuntu 17.10) compat
if Vagrant::DEFAULT_SERVER_URL =~ /hashicorp/
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
end

Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: $script
config.vm.network :forwarded_port, id: "ssh", guest: 22, host: 2223

suites.each do |suite|
debian_suites.each do |suite|
name = "#{suite}-amd64"
box = "debian/#{suite}64"

config.vm.define name do |config|
config.vm.box = box
config.vm.provider :virtualbox do |vb|
vb.name = "Gitian-#{name}"
end
end
end

ubuntu_suites.each do |suite|
archs.each do |arch|
name = "#{suite}-#{arch}"

config.vm.define name do |config|
config.vm.box = name
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/#{suite}/current/#{suite}-server-cloudimg-#{arch}-vagrant-disk1.box"
config.vm.box_url = "https://cloud-images.ubuntu.com/#{suite}/current/#{suite}-server-cloudimg-#{arch}-vagrant.box"
config.vm.provider :virtualbox do |vb|
vb.name = "Gitian-#{name}"
end
Expand Down
3 changes: 2 additions & 1 deletion bin/gbuild
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ OptionParser.new do |opts|
end
end.parse!

if !ENV["USE_LXC"] and !File.exist?("/dev/kvm")
if !ENV["USE_LXC"] and !ENV["USE_VBOX"] and !File.exist?("/dev/kvm")
$stderr.puts "\n************* WARNING: kvm not loaded, this will probably not work out\n\n"
end

Expand Down Expand Up @@ -284,6 +284,7 @@ build_desc["remotes"].each do |remote|
commit = `cd inputs/#{dir} && git log --format=%H -1 #{commit}`.strip
raise "error looking up commit for tag #{remote["commit"]}" unless $?.exitstatus == 0
system!("cd inputs/#{dir} && git checkout -q #{commit}")
system!("cd inputs/#{dir} && git submodule update --init --recursive --force")
in_sums << "git:#{commit} #{dir}"
end

Expand Down
10 changes: 10 additions & 0 deletions bin/make-base-vm
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ elif [ $DISTRO = "debian" ]; then
FLAVOUR=686-pae
fi


LOCALE_PKG=language-pack-en
if [ $DISTRO = "debian" ]; then
LOCALE_PKG=locales
Expand Down Expand Up @@ -159,7 +160,16 @@ if [ $VBOX = "1" ]; then
exit 1
fi

DISTRO_USER_CREATE=0
if [ $DISTRO = "debian" ]; then
# we use a vagrant provider
DISTRO_USER_CREATE=1
fi

vagrant up "$NAME"
if [ $DISTRO_USER_CREATE = "1" ]; then
vagrant ssh "$NAME" -c "sudo useradd -m -s /bin/bash $DISTRO"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to also add the $DISTRO user to sudoers?

Copy link
Copy Markdown
Owner Author

@devrandom devrandom Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's done in gbuild already (although I'm not convinced that's the best place).

fi

vagrant ssh "$NAME" -c "sudo mkdir -p /root/.ssh && sudo chmod 700 /root/.ssh"
vagrant ssh "$NAME" -c "sudo sh -c 'cat >> /root/.ssh/authorized_keys'" < var/id_rsa.pub
Expand Down
2 changes: 1 addition & 1 deletion libexec/start-target
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case $VMSW in
true #sudo lxc-start -n gitian -c var/target.log -f lxc.config
;;
VBOX)
VBoxManage startvm "Gitian-${2}" # --type headless
VBoxManage startvm "Gitian-${2}" --type headless
echo "Gitian-${2}" > var/target.vmname
;;
esac