Add RootFS configuration
authorKalle Vahlman <zuh@iki.fi>
Tue, 24 Jun 2008 19:49:24 +0000 (22:49 +0300)
committerKalle Vahlman <zuh@iki.fi>
Tue, 24 Jun 2008 19:49:24 +0000 (22:49 +0300)
matrix/config.py

index 9c8bb7a..ba6f205 100644 (file)
@@ -147,6 +147,46 @@ def sb2_init_options(args):
 def get_variables():
        return config
 
+def rootfs_root(path, target = None):
+       rootfs.path = path
+       rootfs.target = target
+
+def include_paths(paths):
+       rootfs.include_paths.extend(paths)
+
+def include_files(files):
+       rootfs.include_files.extend(files)
+
+def exclude_paths(paths):
+       rootfs.exclude_paths.extend(paths)
+
+def exclude_files(files):
+       rootfs.exclude_files.extend(files)
+
+def exclude_expressions(expressions):
+       rootfs.exclude_expressions.extend(expressions)
+
+def created_paths(paths):
+       rootfs.created_paths.extend(paths)
+
+def directory_owners(owners):
+       rootfs.directory_owners.update(owners)
+
+def device_nodes(devices):
+       rootfs.devices.update(devices)
+
+class RootFS(object):
+       def __init__(self):
+               self.path = None
+               self.include_paths = []
+               self.include_files = []
+               self.exclude_paths = []
+               self.exclude_files = []
+               self.exclude_expressions = []
+               self.created_paths = []
+               self.devices = {}
+               self.directory_owners = {}
+
 class Config(object):
        def __init__(self):
                self.initial_config_dirs = []
@@ -187,6 +227,17 @@ actions = dict(
        SB2Target = sb2_target,
        SetFlag = set_flag,
        UseBoard = use_board,
+       RootFSRootPath = rootfs_root,
+       RootFSPaths = include_paths,
+       RootFSFiles = include_files,
+       RootFSExcludePaths = exclude_paths,
+       RootFSExcludeFiles = exclude_files,
+       RootFSExcludeExpressions = exclude_expressions,
+       RootFSCreatePaths = created_paths,
+       RootFSDirectoryOwners = directory_owners,
+       RootFSDeviceNodes = device_nodes,
 )
 
 config = Config()
+rootfs = RootFS()
+