From 2603e5a74e0e6b96bf51aba33051d189305c7318 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 10 Jul 2017 10:32:58 +0100 Subject: [PATCH] Vagrantfile: Add openSUSE support In preparation for adding openSUSE support, we extend the Vagrantfile to support openSUSE Leap 42.2/42.3 and extend the btrfs filesystem to the requested size. The parted version in Leap 42.2/42.3 does not allow online partition size alternations so we delete and re-create the partition using fdisk. Change-Id: Icfd7d2944fda0b419e742f153d338914fedcc20d --- Vagrantfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 1fd4aa3aec..d98a4ea6ae 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -59,4 +59,41 @@ Vagrant.configure(2) do |config| ./scripts/gate-check-commit.sh SHELL end + + config.vm.define "opensuse422" do |leap422| + leap422.disksize.size = disk_size + leap422.vm.box = "opensuse/openSUSE-42.2-x86_64" + leap422.vm.provision "shell", + # NOTE(hwoarang) The parted version in Leap 42.2 can't do an online + # partition resize so we must create a new one and attach it to the + # btrfs filesystem. + privileged: true, + inline: <<-SHELL + cd /vagrant + echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda + PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}') + resizepart /dev/sda 2 $PART_END + btrfs fi resize max / + ./scripts/gate-check-commit.sh + SHELL + end + + config.vm.define "opensuse423" do |leap423| + leap423.disksize.size = disk_size + leap423.vm.box = "opensuse/openSUSE-42.3-x86_64" + leap423.vm.provision "shell", + # NOTE(hwoarang) The parted version in Leap 42.3 can't do an online + # partition resize so we must create a new one and attach it to the + # btrfs filesystem. + privileged: true, + inline: <<-SHELL + cd /vagrant + echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda + PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}') + resizepart /dev/sda 2 $PART_END + btrfs fi resize max / + ./scripts/gate-check-commit.sh + SHELL + end + end