jffs2: make the cleanmarkers setting configurable in the board file
authorAdrian Bunk <adrian.bunk@movial.com>
Fri, 5 Feb 2010 15:08:27 +0000 (17:08 +0200)
committerAdrian Bunk <adrian.bunk@movial.com>
Fri, 5 Feb 2010 15:13:08 +0000 (17:13 +0200)
matrix/config.py
matrix/rootfs.py

index 18c9e92..3d54168 100644 (file)
@@ -73,6 +73,7 @@ class Board(object):
                     ubifs_max_leb_count=0,
                     ubifs_min_io_size=0,
                     ubinize_config_vol_size=0,
+                    cleanmarkers="unknown",
                     flags=[]):
 
                self.name = name
@@ -89,6 +90,7 @@ class Board(object):
                self.ubifs_max_leb_count = ubifs_max_leb_count
                self.ubifs_min_io_size = ubifs_min_io_size
                self.ubinize_config_vol_size = ubinize_config_vol_size
+               self.cleanmarkers = cleanmarkers
                self.flags = flags
 
                config.boards[name] = self
index a2090d8..5fd0bda 100644 (file)
@@ -96,6 +96,7 @@ def main():
        build.set_flash_pad_size(config.boards[config.board].flash_pad_size)
 
        build.set_flash_compression(config.boards[config.board].flash_compression)
+       build.set_cleanmarkers(config.boards[config.board].cleanmarkers)
        build.set_ubifs_leb_size(config.boards[config.board].ubifs_leb_size)
        build.set_ubifs_max_leb_count(config.boards[config.board].ubifs_max_leb_count)
        build.set_ubifs_min_io_size(config.boards[config.board].ubifs_min_io_size)
@@ -140,6 +141,9 @@ class Builder(object):
        # Size of the physical eraseblock of the flash
        ubinize_peb_size = flash_erase_size
 
+       # cleanmarkers: yes/no/unknown
+       cleanmarkers = "unknown"
+
        # Configation values for ubinize
        ubinize_config_mode = "ubi"
        ubinize_config_image = None
@@ -259,6 +263,18 @@ class Builder(object):
                if size is not None:
                        self.ubinize_config_vol_size = size
 
+       def set_cleanmarkers(self, setting):
+               if setting is "no":
+                       self.cleanmarkers = "-n"
+               elif setting is "yes":
+                       self.cleanmarkers = ""
+               elif setting is "unknown":
+                       self.cleanmarkers = "-n"
+                       print "no cleanmarkers setting in the board file, assuming no cleanmarkers"
+               else:
+                       raise Error("invalid cleanmarkers setting")
+                       
+
        def set_no_strip(self, no_strip):
                self.no_strip = no_strip
 
@@ -430,7 +446,7 @@ class Builder(object):
                # Build jffs2
                if build_target == "all" or build_target == "jffs2":
                        print "Creating a root image as JFFS2..."
-                       os.system("%s -p%d -n -e%d -r '%s' -o '%s.jffs2'" % (self.mkfs_jffs2, self.flash_pad_size, self.flash_erase_size, basepath, basepath))
+                       os.system("%s -p%d %s -e%d -r '%s' -o '%s.jffs2'" % (self.mkfs_jffs2, self.flash_pad_size, self.cleanmarkers, self.flash_erase_size, basepath, basepath))
 
                # Build ubifs
                if build_target == "ubi":