All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "wic/utils/partitionedfs.py: assemble .wic images as sparse files"
@ 2016-04-12 12:06 Ross Burton
  2016-04-12 12:06 ` [PATCH 2/2] Revert "oeqa/selftest/wic: add test case for sparse images" Ross Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Ross Burton @ 2016-04-12 12:06 UTC (permalink / raw)
  To: openembedded-core

It turns out that dd's conv=sparse doesn't look at the file extents, but simply
checks if a "block" is all zero.  If the block of zero was meaningful it gets
lost and if the image is subsequently written to media using a sparse-aware
writer then the block of zeros won't be written at all.

This reverts commit 5fd592fbae2e046bcb8c3a6c3ef4993fe0400676.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 scripts/lib/wic/utils/partitionedfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index 3e2b420..5a103bb 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -340,7 +340,7 @@ class Image(object):
             source = part['source_file']
             if source:
                 # install source_file contents into a partition
-                cmd = "dd if=%s of=%s bs=%d seek=%d count=%d conv=notrunc,sparse" % \
+                cmd = "dd if=%s of=%s bs=%d seek=%d count=%d conv=notrunc" % \
                       (source, image_file, self.sector_size,
                        part['start'], part['size'])
                 exec_cmd(cmd)
-- 
2.8.0.rc3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] Revert "oeqa/selftest/wic: add test case for sparse images"
  2016-04-12 12:06 [PATCH 1/2] Revert "wic/utils/partitionedfs.py: assemble .wic images as sparse files" Ross Burton
@ 2016-04-12 12:06 ` Ross Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Ross Burton @ 2016-04-12 12:06 UTC (permalink / raw)
  To: openembedded-core

This reverts commit 43150ab7ec63d804e8a998ecee9d00295b8b2bc7.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/lib/oeqa/selftest/wic.py | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index dd32075..a569fbf 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -276,16 +276,3 @@ class Wic(oeSelfTest):
             status, output = qemu.run_serial(command)
             self.assertEqual(1, status, 'Failed to run command "%s": %s' % (command, output))
             self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt')
-
-    def test_sparseness(self):
-        """Test that assembled images are sparse; apparent size > disk usage"""
-        self.assertEqual(0, runCmd("wic create directdisk "
-                                   "--image-name core-image-minimal").status)
-        images = glob(self.resultdir + "directdisk-*.direct")
-        self.assertEqual(1, len(images))
-
-        imagestat = os.stat(images.pop())
-        # st_blocks is the "number of 512-byte blocks allocated for file"
-        used = imagestat.st_blocks*512
-        apparent = imagestat.st_size
-        self.assertLess(used, apparent)
-- 
2.8.0.rc3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-12 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-12 12:06 [PATCH 1/2] Revert "wic/utils/partitionedfs.py: assemble .wic images as sparse files" Ross Burton
2016-04-12 12:06 ` [PATCH 2/2] Revert "oeqa/selftest/wic: add test case for sparse images" Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.