summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-08-21 14:46:23 -0500
committerSteve Sakoman <steve@sakoman.com>2020-09-30 05:54:58 -1000
commitb9296bdeaacc1dce97aac9c9bf0d70555bb36646 (patch)
tree8c0f48d0ebec085279786e5d94e423c6e80070d3 /meta/lib/oeqa
parent0ff25797126772f40e357a2f3cf81eccf659adaf (diff)
downloadopenembedded-core-contrib-b9296bdeaacc1dce97aac9c9bf0d70555bb36646.tar.gz
wic: Add 512 Byte alignment to --offset
Allows the --offset argument to use the "s" or "S" suffix to specify that it is reporting the number of 512 byte sectors. This is required for some SoCs where the mask ROM looks for an item at a sector that isn't aligned to a 1KB boundary. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 938595d1dc4abaf5f7f3a7900add3f0492b805d0) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index a166d3f614..13b6a0cc72 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -739,6 +739,30 @@ class Wic2(WicTestCase):
])
with NamedTemporaryFile("w", suffix=".wks") as tempf:
+ # Test that partitions can be placed on a 512 byte sector boundary
+ tempf.write("bootloader --ptable gpt\n" \
+ "part / --source rootfs --ondisk hda --offset 65s --fixed-size 99M --fstype=ext4\n" \
+ "part /bar --ondisk hda --offset 102432 --fixed-size 100M --fstype=ext4\n")
+ tempf.flush()
+
+ _, partlns = self._get_wic_partitions(tempf.name, native_sysroot)
+ self.assertEqual(partlns, [
+ "1:32.5kiB:101408kiB:101376kiB:ext4:primary:;",
+ "2:102432kiB:204832kiB:102400kiB:ext4:primary:;",
+ ])
+
+ with NamedTemporaryFile("w", suffix=".wks") as tempf:
+ # Test that a partition can be placed immediately after a MSDOS partition table
+ tempf.write("bootloader --ptable msdos\n" \
+ "part / --source rootfs --ondisk hda --offset 1s --fixed-size 100M --fstype=ext4\n")
+ tempf.flush()
+
+ _, partlns = self._get_wic_partitions(tempf.name, native_sysroot)
+ self.assertEqual(partlns, [
+ "1:0.50kiB:102400kiB:102400kiB:ext4::;",
+ ])
+
+ with NamedTemporaryFile("w", suffix=".wks") as tempf:
# Test that image creation fails if the partitions would overlap
tempf.write("bootloader --ptable gpt\n" \
"part / --source rootfs --ondisk hda --offset 32 --fixed-size 100M --fstype=ext4\n" \