Skip to content

Commit d520618

Browse files
committed
Merge #166: virtualbox improvements
d0127cc Release notes (Devrandom) 923c711 add CODEOWNERS (Devrandom) cac395d git submodule support (Devrandom) 496f45d support Debian / virtualbox via Vagrant Cloud (Devrandom) ead388a headless vbox (Devrandom) 7338dc5 do not complain about kvm if in VBOX mode (Devrandom)
2 parents e2172de + d0127cc commit d520618

6 files changed

Lines changed: 46 additions & 7 deletions

File tree

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @devrandom

RELEASE_NOTES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2017-02-14
2+
----------
3+
4+
- VirtualBox launches are now headless. You can use the VirtualBox Manager to open the console UI if needed.
5+
- Debian on VirtualBox is supported via Vagrant Cloud images
6+
- Note that Debian on kvm is currently not supported because vmbuilder fails in the grub install stage
7+
- git submodule support - any submodules are cloned and checked out
8+
- Note that lxc-execute in Ubuntu 17.10 has a showstopper bug in stdin handling
9+
110
2015-12-12
211
----------
312

Vagrantfile

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,45 @@ echo "ok"
1212
SCRIPT
1313

1414
archs = ["amd64", "i386"]
15-
suites = ["precise", "quantal", "raring", "saucy", "trusty"]
15+
ubuntu_suites = ["precise", "quantal", "raring", "saucy", "trusty", "xenial", "bionic"]
16+
debian_suites = ["jessie", "stretch"]
1617

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

24-
Vagrant.configure("2") do |config|
26+
# vagrant 1.9.1 (Ubuntu 17.10) compat
27+
if Vagrant::DEFAULT_SERVER_URL =~ /hashicorp/
28+
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
29+
end
2530

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

29-
suites.each do |suite|
35+
debian_suites.each do |suite|
36+
name = "#{suite}-amd64"
37+
box = "debian/#{suite}64"
38+
39+
config.vm.define name do |config|
40+
config.vm.box = box
41+
config.vm.provider :virtualbox do |vb|
42+
vb.name = "Gitian-#{name}"
43+
end
44+
end
45+
end
46+
47+
ubuntu_suites.each do |suite|
3048
archs.each do |arch|
3149
name = "#{suite}-#{arch}"
3250

3351
config.vm.define name do |config|
3452
config.vm.box = name
35-
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/#{suite}/current/#{suite}-server-cloudimg-#{arch}-vagrant-disk1.box"
53+
config.vm.box_url = "https://cloud-images.ubuntu.com/#{suite}/current/#{suite}-server-cloudimg-#{arch}-vagrant.box"
3654
config.vm.provider :virtualbox do |vb|
3755
vb.name = "Gitian-#{name}"
3856
end

bin/gbuild

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ OptionParser.new do |opts|
197197
end
198198
end.parse!
199199

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

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

bin/make-base-vm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ elif [ $DISTRO = "debian" ]; then
112112
FLAVOUR=686-pae
113113
fi
114114

115+
115116
LOCALE_PKG=language-pack-en
116117
if [ $DISTRO = "debian" ]; then
117118
LOCALE_PKG=locales
@@ -159,7 +160,16 @@ if [ $VBOX = "1" ]; then
159160
exit 1
160161
fi
161162

163+
DISTRO_USER_CREATE=0
164+
if [ $DISTRO = "debian" ]; then
165+
# we use a vagrant provider
166+
DISTRO_USER_CREATE=1
167+
fi
168+
162169
vagrant up "$NAME"
170+
if [ $DISTRO_USER_CREATE = "1" ]; then
171+
vagrant ssh "$NAME" -c "sudo useradd -m -s /bin/bash $DISTRO"
172+
fi
163173

164174
vagrant ssh "$NAME" -c "sudo mkdir -p /root/.ssh && sudo chmod 700 /root/.ssh"
165175
vagrant ssh "$NAME" -c "sudo sh -c 'cat >> /root/.ssh/authorized_keys'" < var/id_rsa.pub

libexec/start-target

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ case $VMSW in
3131
true #sudo lxc-start -n gitian -c var/target.log -f lxc.config
3232
;;
3333
VBOX)
34-
VBoxManage startvm "Gitian-${2}" # --type headless
34+
VBoxManage startvm "Gitian-${2}" --type headless
3535
echo "Gitian-${2}" > var/target.vmname
3636
;;
3737
esac

0 commit comments

Comments
 (0)