diff options
author | Neil Williams <codehelp@debian.org> | 2016-03-13 14:55:08 +0000 |
---|---|---|
committer | Neil Williams <codehelp@debian.org> | 2016-03-13 15:17:42 +0000 |
commit | 33b3f0eb04201214f7a653db329f7ec23e1c1973 (patch) | |
tree | 1c48b977963674b077d595473c851862614b3bf1 | |
parent | 615f75d32eace577bf73c8dc14813db6aae338a7 (diff) | |
download | vmdebootstrap-33b3f0eb04201214f7a653db329f7ec23e1c1973.tar.gz |
Fix issue with fstab entry for boot partition
- When bootsize and boottype are passed, the fstab entry for boot
partition is getting written with fstype as 'None' leading to boot
failures. Fix this.
- Also don't fail boot flag check if partition flag information comes
out from parted as 'boot, lba' instead of 'boot'
Sunil Mohan Adapa <sunil@medhas.org>
Bug: #815255
-rw-r--r-- | vmdebootstrap/filesystem.py | 1 | ||||
-rw-r--r-- | yarns/300-slow-build-tests.yarn | 12 | ||||
-rw-r--r-- | yarns/900-implements.yarn | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/vmdebootstrap/filesystem.py b/vmdebootstrap/filesystem.py index 0898de9..77f02df 100644 --- a/vmdebootstrap/filesystem.py +++ b/vmdebootstrap/filesystem.py @@ -53,6 +53,7 @@ class Filesystem(Base): def define_settings(self, settings): self.settings = settings self.devices['roottype'] = self.settings['roottype'] + self.devices['boottype'] = self.settings['boottype'] def chown(self): if not self.settings['owner']: diff --git a/yarns/300-slow-build-tests.yarn b/yarns/300-slow-build-tests.yarn index a76a27c..1934217 100644 --- a/yarns/300-slow-build-tests.yarn +++ b/yarns/300-slow-build-tests.yarn @@ -48,3 +48,15 @@ These tests are slow, since building images is slow. AND partition 1 has the boot flag set AND partition 1 has an btrfs filesystem AND partition 1 has file /etc/fstab matching ^\S+\s+\/\s+btrfs\s+defaults\s+\d\s+\d$ + + SCENARIO build a Debian 8 image with separate boot partition + ASSUMING build tests are requested + GIVEN user wants to build an image FOO.img that is 2GiB in size + WHEN the user runs vmdebootstrap --bootsize=128M --boottype=ext3 --grub + THEN the image has the correct size + AND the partition count of the image is 2 + AND partition 1 has the boot flag set + AND partition 1 has an ext3 filesystem + AND partition 2 has an ext4 filesystem + AND partition 2 has file /etc/fstab matching ^\S+\s+\/\s+ext4\s+errors=remount-ro\s+\d\s+\d$ + AND partition 2 has file /etc/fstab matching ^\S+\s+\/boot\s+ext3\s+errors=remount-ro\s+\d\s+\d$ diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index 657101e..57889ab 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -109,7 +109,7 @@ Check partition boot flag. IMPLEMENTS THEN partition (\d+) has the boot flag set parted --script "$IMAGE" print | - awk -v "PART=$MATCH_1" '/^ [0-9]+ / && $1 == PART && $7 == "boot"' | + awk -v "PART=$MATCH_1" '/^ [0-9]+ / && $1 == PART && $7 ~ "^boot,?$"' | grep . Check filesystem on a partition. This checks the actual filesystem, |