All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wic: squashfs partition support
@ 2014-07-23 10:37 Maciej Borzecki
  2014-07-23 20:21 ` Tom Zanussi
  0 siblings, 1 reply; 6+ messages in thread
From: Maciej Borzecki @ 2014-07-23 10:37 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
---
 .../lib/mic/kickstart/custom_commands/partition.py | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index d0f1b78..c4d0113 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -192,6 +192,10 @@ class Wic_PartData(Mic_PartData):
             return self.prepare_rootfs_vfat(cr_workdir, oe_builddir,
                                             rootfs_dir, native_sysroot,
                                             pseudo)
+        elif self.fstype.startswith("squashfs"):
+            return self.prepare_rootfs_squashfs(cr_workdir, oe_builddir,
+                                                rootfs_dir, native_sysroot,
+                                                pseudo)
 
     def prepare_rootfs_ext(self, cr_workdir, oe_builddir, rootfs_dir,
                            native_sysroot, pseudo):
@@ -324,6 +328,28 @@ class Wic_PartData(Mic_PartData):
         self.set_size(rootfs_size)
         self.set_source_file(rootfs)
 
+    def prepare_rootfs_squashfs(self, cr_workdir, oe_builddir, rootfs_dir,
+                                native_sysroot, pseudo):
+        """
+        Prepare content for a squashfs rootfs partition.
+        """
+        image_rootfs = rootfs_dir
+        rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
+
+        squashfs_cmd = "mksquashfs %s %s -noappend" % \
+                       (image_rootfs, rootfs)
+        rc, out = exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
+
+        # get the rootfs size in the right units for kickstart (Mb)
+        du_cmd = "du -Lbms %s" % rootfs
+        rc, out = exec_cmd(du_cmd)
+        rootfs_size = out.split()[0]
+
+        self.size = rootfs_size
+        self.source_file = rootfs
+
+        return 0
+
     def prepare_empty_partition(self, cr_workdir, oe_builddir, native_sysroot):
         """
         Prepare an empty partition.
-- 
1.9.0



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

end of thread, other threads:[~2014-07-25  0:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23 10:37 [PATCH] wic: squashfs partition support Maciej Borzecki
2014-07-23 20:21 ` Tom Zanussi
2014-07-23 20:33   ` Maciek Borzecki
2014-07-23 20:39     ` Tom Zanussi
2014-07-24 12:11       ` [PATCH v2] " Maciej Borzecki
2014-07-25  0:00         ` Tom Zanussi

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.