Пример #1
0
def generate_manifests(modules, basic_apps, usrskel='default'):
    for manifest_type in ["usr", "bootfs"]:
        manifest_name = "%s.manifest" % manifest_type
        print("Preparing %s" % manifest_name)

        manifest_skel = "%s.skel" % manifest_name
        if manifest_type == "usr" and usrskel != "default":
            manifest_skel = usrskel

        with open(os.path.join(resolve.get_build_path(), manifest_name), "w") as manifest:
            manifest.write('[manifest]\n')

            if manifest_skel != 'none':
                append_manifest(os.path.join(resolve.get_osv_base(), manifest_skel), manifest)

            for module in modules:
                module_manifest = os.path.join(module.local_path, manifest_name)

                if os.path.exists(module_manifest):
                    print("Appending %s to %s" % (module_manifest, manifest_name))
                    append_manifest(module_manifest, manifest, variables={
                        'MODULE_DIR': module.local_path,
                        'OSV_BASE': resolve.get_osv_base()
                    })

                filemap_attr = '%s_files' % manifest_type
                if hasattr(module, filemap_attr):
                    filemap.as_manifest(getattr(module, filemap_attr), manifest.write)

            for app in basic_apps:
                app.prepare_manifest(resolve.get_build_path(), manifest_type, manifest)
Пример #2
0
def generate_manifests(modules, basic_apps):
    for manifest_type in ["usr", "bootfs"]:
        manifest_name = "%s.manifest" % manifest_type
        print("Preparing %s" % manifest_name)

        with open(os.path.join(resolve.get_build_path(), manifest_name), "w") as manifest:
            manifest.write("[manifest]\n")

            append_manifest(os.path.join(resolve.get_osv_base(), "%s.skel" % manifest_name), manifest)

            for module in modules:
                module_manifest = os.path.join(module.local_path, manifest_name)

                if os.path.exists(module_manifest):
                    print("Appending %s to %s" % (module_manifest, manifest_name))
                    append_manifest(
                        module_manifest,
                        manifest,
                        variables={"MODULE_DIR": module.local_path, "OSV_BASE": resolve.get_osv_base()},
                    )

                filemap_attr = "%s_files" % manifest_type
                if hasattr(module, filemap_attr):
                    filemap.as_manifest(getattr(module, filemap_attr), manifest.write)

            for app in basic_apps:
                app.prepare_manifest(resolve.get_build_path(), manifest_type, manifest)
Пример #3
0
def generate_manifests(modules, basic_apps):
    for manifest_type in ["usr", "bootfs"]:
        manifest_name = "%s.manifest" % manifest_type
        print "Preparing %s" % manifest_name

        with open(os.path.join(resolve.get_build_path(), manifest_name), "w") as manifest:
            append_manifest(os.path.join(resolve.get_osv_base(), "%s.skel" % manifest_name), manifest)

            for module in modules:
                module_manifest = os.path.join(module.local_path, manifest_name)

                if os.path.exists(module_manifest):
                    print "Appending %s to %s" % (module_manifest, manifest_name)
                    append_manifest(module_manifest, manifest, variables={
                        'MODULE_DIR': module.local_path,
                        'OSV_BASE': resolve.get_osv_base()
                    })

                filemap_attr = '%s_files' % manifest_type
                if hasattr(module, filemap_attr):
                    filemap.as_manifest(getattr(module, filemap_attr), manifest.write)

            for app in basic_apps:
                app.prepare_manifest(resolve.get_build_path(), manifest_type, manifest)

            # Add a generated content here
            if manifest_type == 'usr':
                with open(os.path.join(resolve.get_build_path(), 'test.manifest.gen')) as src_file:
                    for line in src_file:
                        manifest.write(line)
Пример #4
0
def generate_manifests(modules, basic_apps):
    for manifest_type in ["usr", "bootfs"]:
        manifest_name = "%s.manifest" % manifest_type
        print "Preparing %s" % manifest_name

        with open(os.path.join(resolve.get_build_path(), manifest_name), "w") as manifest:
            append_manifest(os.path.join(resolve.get_osv_base(), "%s.skel" % manifest_name), manifest)

            for module in modules:
                module_dir = resolve.get_module_dir(module)
                module_manifest = os.path.join(module_dir, manifest_name)
                print "Appending %s to %s" % (module_manifest, manifest_name)
                append_manifest(module_manifest, manifest, variables={
                        'MODULE_DIR': module_dir,
                        'OSV_BASE': resolve.get_osv_base()
                    })

            for app in basic_apps:
                app.prepare_manifest(resolve.get_build_path(), manifest_type, manifest)
Пример #5
0
def generate_manifests(modules, basic_apps):
    for manifest_type in ["usr", "bootfs"]:
        manifest_name = "%s.manifest" % manifest_type
        print "Preparing %s" % manifest_name

        with open(os.path.join(resolve.get_build_path(), manifest_name), "w") as manifest:
            append_manifest(os.path.join(resolve.get_osv_base(), "%s.skel" % manifest_name), manifest)

            for module in modules:
                module_dir = resolve.get_module_dir(module)
                module_manifest = os.path.join(module_dir, manifest_name)
                print "Appending %s to %s" % (module_manifest, manifest_name)
                append_manifest(module_manifest, manifest, variables={
                        'MODULE_DIR': module_dir,
                        'OSV_BASE': resolve.get_osv_base()
                    })

            for app in basic_apps:
                app.prepare_manifest(resolve.get_build_path(), manifest_type, manifest)