Lines Matching refs:args
134 def build_conf(args, output_conf, file_list, with_developer=False):
135 m4_args = ["-D", "build_with_debug=" + args.debug_version]
136 m4_args += ["-D", "build_with_updater=" + args.updater_version]
139 if getattr(args, "product_args", None):
140 m4_args += ["-D", args.product_args]
148 def build_cil(args, output_cil, input_conf):
149 check_policy_cmd = [os.path.join(args.tool_path, "checkpolicy"),
315 def get_policy_dir_list(args):
316 sepolicy_path = os.path.join(args.source_root_dir, "base/security/selinux_adapter/sepolicy/")
318 prepare_build_path(args.policy_dir_list, args.source_root_dir, dir_list, sepolicy_path)
342 def get_policy_file_list(args, dir_list_object):
343 build_root = os.path.abspath(os.path.join(args.tool_path, "../../.."))
380 def generate_version_file(args, output_file):
381 cmd = ["echo", args.vendor_policy_version,
386 def generate_default_policy(args, policy, cil_list, with_developer=False):
388 output_path = os.path.join(os.path.abspath(os.path.dirname(args.dst_file)), "developer/")
392 output_path = os.path.abspath(os.path.dirname(args.dst_file))
402 build_conf(args, system_output_conf, policy.system_policy_file_list, with_developer)
404 build_cil(args, system_cil_path, system_output_conf)
407 build_conf(args, vendor_output_conf, policy.vendor_policy_file_list, with_developer)
409 build_cil(args, vendor_cil_path, vendor_output_conf)
413 build_conf(args, min_output_conf, policy.min_policy_file_list)
415 build_cil(args, min_cil_path, min_output_conf)
422 def generate_special_policy(args, policy, cil_list, with_developer=False):
424 output_path = os.path.join(os.path.abspath(os.path.dirname(args.dst_file)), "developer/")
428 output_path = os.path.abspath(os.path.dirname(args.dst_file))
447 type_version_cil_path = os.path.join(output_path, "".join(["compatible/", args.vendor_policy_version, ".cil"]))
450 build_conf(args, system_output_conf, policy.system_policy_file_list, with_developer)
452 build_cil(args, system_cil_path, system_output_conf)
455 build_conf(args, min_output_conf, policy.min_policy_file_list)
456 build_cil(args, min_cil_path, min_output_conf)
459 build_conf(args, public_output_conf, policy.public_policy_file_list, with_developer)
460 build_cil(args, public_origin_cil_path, public_output_conf)
463 build_version_cil(args.vendor_policy_version, public_origin_cil_path, public_version_cil_path, type_set)
466 build_conf(args, vendor_output_conf, policy.vendor_policy_file_list, with_developer)
467 build_cil(args, vendor_origin_cil_path, vendor_output_conf)
469 build_version_cil(args.vendor_policy_version, vendor_origin_cil_path, vendor_cil_path, type_set)
472 build_type_version_cil(args.vendor_policy_version, public_origin_cil_path, type_version_cil_path)
474 if args.components == "system":
478 elif args.components == "vendor":
483 generate_version_file(args, version_file)
488 def compile_sepolicy(args):
489 dir_list_object = get_policy_dir_list(args)
490 file_list_object = get_policy_file_list(args, dir_list_object)
494 if args.updater_version == "enable":
495 generate_default_policy(args, file_list_object, cil_list, False)
496 build_binary_policy(args.tool_path, args.dst_file, True, cil_list)
500 if args.components == "default":
501 normal_thread = executor.submit(generate_default_policy, args, file_list_object, cil_list, False)
502 developer_thread = executor.submit(generate_default_policy, args, file_list_object,
505 normal_thread = executor.submit(generate_special_policy, args, file_list_object, cil_list, False)
506 developer_thread = executor.submit(generate_special_policy, args, file_list_object,
516 build_normal_thread = executor.submit(build_binary_policy, args.tool_path, args.dst_file, True, cil_list)
517 developer_policy_path = os.path.join(os.path.abspath(os.path.dirname(args.dst_file)), "developer/policy.31")
518 build_developer_thread = executor.submit(build_binary_policy, args.tool_path, developer_policy_path,
528 def copy_user_policy(args):
529 if args.updater_version == "enable":
532 output_path = os.path.abspath(os.path.dirname(args.dst_file))
533 if args.debug_version == "enable":
547 def pre_check(args):
548 output_path = os.path.join(os.path.abspath(os.path.dirname(args.dst_file)), "pre_check/")
551 args.dst_file = os.path.join(output_path, "policy.31")
553 if args.debug_version == "enable":
554 args.debug_version = "disable"
556 args.debug_version = "enable"
558 compile_sepolicy(args)
561 def main(args):
563 pre_check_args = copy.deepcopy(args)
566 compile_args = copy.deepcopy(args)
575 copy_user_policy(args)