Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: vagrant-mount-disk.sh

Issue 29448564: Issue 5277 - Prepare Vagrant files for CI (Closed)
Patch Set: see the changes in commit message https://github.com/4ntoine/libadblockplus-android-ci/commit/d44b6f71a6efb02d46fb594e823c6e810ba79a4f Created May 25, 2017, 1:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vagrant-emulator.sh ('k') | vagrant-provision.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vagrant-mount-disk.sh
diff --git a/vagrant-mount-disk.sh b/vagrant-mount-disk.sh
new file mode 100755
index 0000000000000000000000000000000000000000..379a3cbdd901a52a954b82528fc8d9dbe4dbea25
--- /dev/null
+++ b/vagrant-mount-disk.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+set -x
+
+if [ -f /home/vagrant/disk_added_date ]
+then
+ echo "Disk already added, exiting"
+ exit 0
+fi
+
+# create partition
+sudo fdisk -u /dev/sdb <<EOF
+n
+p
+1
+
+
+w
+EOF
+
+# format and mount
+sudo mkfs.ext4 /dev/sdb1
+mkdir -p /home/vagrant/build
+sudo mount -t ext4 -o rw /dev/sdb1 /home/vagrant/build
+sudo chown vagrant:vagrant /home/vagrant/build
+sudo echo "/dev/sdb1 /home/vagrant/build ext4 defaults 0 0" >> /etc/fstab
+
+date > /home/vagrant/disk_added_date
+sudo chown vagrant:vagrant /home/vagrant/disk_added_date
« no previous file with comments | « vagrant-emulator.sh ('k') | vagrant-provision.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld