Lines Matching refs:script
63 Insert the contents of file at the end of the update script.
214 # set metadata for the files generated by this script.
317 def SetPermissions(self, script):
318 """Append set_perm/set_perm_recursive commands to 'script' to
331 script.SetPermissionsRecursive("/"+item.name, *item.best_subtree)
337 script.SetPermissions("/"+item.name, item.uid, item.gid,
346 script.SetPermissions("/"+item.name, item.uid, item.gid,
401 def AppendAssertions(script, info_dict, oem_dict=None):
405 script.AssertDevice(device)
414 script.AssertOemProperty(prop, oem_dict.get(prop))
492 script = edify_generator.EdifyGenerator(3, OPTIONS.info_dict)
500 script.Mount("/oem", recovery_mount_options)
516 script=script,
527 script.AssertOlderBuild(ts, ts_text)
529 AppendAssertions(script, OPTIONS.info_dict, oem_dict)
533 # the order in which the generated script has things):
549 # complete script normally
562 script.AppendExtra("""
565 script.WriteRawImage("/recovery", "recovery.img")
566 script.AppendExtra("""
573 script.Print("Target: %s" % CalculateFingerprint(
591 script.ShowProgress(system_progress, 0)
601 system_diff.WriteScript(script, output_zip)
603 script.FormatPartition("/system")
604 script.Mount("/system", recovery_mount_options)
606 script.UnpackPackageDir("recovery", "/system")
607 script.UnpackPackageDir("system", "/system")
610 script.MakeSymlinks(symlinks)
624 system_items.Get("system").SetPermissions(script)
628 script.ShowProgress(0.1, 0)
634 vendor_diff.WriteScript(script, output_zip)
636 script.FormatPartition("/vendor")
637 script.Mount("/vendor", recovery_mount_options)
638 script.UnpackPackageDir("vendor", "/vendor")
641 script.MakeSymlinks(symlinks)
644 vendor_items.Get("vendor").SetPermissions(script)
649 script.ShowProgress(0.05, 5)
650 script.WriteRawImage("/boot", "boot.img")
652 script.ShowProgress(0.2, 10)
656 script.AppendExtra(OPTIONS.extra_script)
658 script.UnmountAll()
661 script.ShowProgress(0.1, 10)
662 script.FormatPartition("/data")
665 script.AppendExtra("""
668 script.AppendExtra("else\n")
669 script.WriteRawImage("/boot", "recovery.img")
670 script.AppendExtra("""
676 script.AddToZip(input_zip, output_zip, input_path=OPTIONS.updater_binary)
729 print ("WARNING: generating edify script for a source that "
731 script = edify_generator.EdifyGenerator(
748 script=script,
805 script.Mount("/oem", recovery_mount_options)
809 AppendAssertions(script, OPTIONS.target_info_dict, oem_dict)
813 # which is *not* the order in which the generated script has
831 # complete script normally
842 script.AppendExtra("""
845 script.AppendExtra("sleep(20);\n")
846 script.WriteRawImage("/recovery", "recovery.img")
847 script.AppendExtra("""
854 script.Print("Source: %s" % CalculateFingerprint(
856 script.Print("Target: %s" % CalculateFingerprint(
859 script.Print("Verifying current system...")
869 script.AssertSomeFingerprint(source_fp)
871 script.AssertSomeFingerprint(source_fp, target_fp)
874 script.AssertSomeThumbprint(
877 script.AssertSomeThumbprint(
897 script.PatchCheck("%s:%s:%d:%s:%d:%s" %
905 script.WriteRawImage("/boot", "recovery.img")
906 script.AppendExtra("""
913 system_diff.WriteVerifyScript(script)
915 vendor_diff.WriteVerifyScript(script)
917 script.Comment("---- start making changes here ----")
921 system_diff.WriteScript(script, output_zip,
924 vendor_diff.WriteScript(script, output_zip, progress=0.1)
928 script.WriteRawImage("/boot", "boot.img")
935 script.Print("Installing boot image...")
936 script.WriteRawImage("/boot", "boot.img")
942 script.Print("Patching boot image...")
943 script.ShowProgress(0.1, 10)
944 script.ApplyPatch("%s:%s:%d:%s:%d:%s"
958 script.AppendExtra(OPTIONS.extra_script)
961 script.Print("Erasing user data...")
962 script.FormatPartition("/data")
965 script.AppendExtra("""
971 script.SetProgress(1)
972 script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
1049 def EmitVerification(self, script):
1053 script.SkipNextActionIfTargetExists(tf.name, tf.sha1)
1054 script.PatchCheck("/"+sf.name, tf.sha1, sf.sha1)
1058 def EmitExplicitTargetVerification(self, script):
1061 script.FileCheck("/"+fn, sha1)
1063 script.FileCheck(tf.name, tf.sha1)
1065 def RemoveUnneededFiles(self, script, extras=()):
1066 script.DeleteFiles(
1075 def EmitPatches(self, script, total_patch_size, so_far):
1083 script.SkipNextActionIfTargetExists(tf.name, tf.sha1)
1084 script.ApplyPatch("/" + sf.name, "-", tf.size, tf.sha1, sf.sha1,
1087 script.SetProgress(so_far / total_patch_size)
1090 def EmitDeferredPatches(self, script):
1093 script.ApplyPatch("/"+sf.name, "-", tf.size, tf.sha1, sf.sha1,
1095 script.SetPermissions("/system/build.prop", 0, 0, 0o644, None, None)
1097 def EmitRenames(self, script):
1099 script.Print("Renaming files...")
1102 script.RenameFile(src, tgt.name)
1118 print ("WARNING: generating edify script for a source that "
1120 script = edify_generator.EdifyGenerator(
1131 script.Mount("/oem", recovery_mount_options)
1148 script=script,
1153 script.Mount("/system", recovery_mount_options)
1156 script.Mount("/vendor", recovery_mount_options)
1166 script.AssertSomeFingerprint(source_fp, target_fp)
1168 script.AssertSomeThumbprint(
1196 AppendAssertions(script, OPTIONS.target_info_dict, oem_dict)
1200 # which is *not* the order in which the generated script has
1218 # complete script normally
1229 script.AppendExtra("""
1232 script.AppendExtra("sleep(20);\n")
1233 script.WriteRawImage("/recovery", "recovery.img")
1234 script.AppendExtra("""
1241 script.Print("Source: %s" % (source_fp,))
1242 script.Print("Target: %s" % (target_fp,))
1244 script.Print("Verifying current system...")
1248 script.ShowProgress(0.1, 0)
1249 so_far = system_diff.EmitVerification(script)
1251 so_far += vendor_diff.EmitVerification(script)
1264 script.PatchCheck("%s:%s:%d:%s:%d:%s" %
1277 script.CacheFreeSpaceCheck(max(size))
1282 script.WriteRawImage("/boot", "recovery.img")
1283 script.AppendExtra("""
1289 script.Comment("---- start making changes here ----")
1295 script.WriteRawImage("/boot", "boot.img")
1298 script.Print("Removing unneeded files...")
1299 system_diff.RemoveUnneededFiles(script, ("/system/recovery.img",))
1301 vendor_diff.RemoveUnneededFiles(script)
1303 script.ShowProgress(0.8, 0)
1310 script.Print("Patching system files...")
1311 so_far = system_diff.EmitPatches(script, total_patch_size, 0)
1313 script.Print("Patching vendor files...")
1314 so_far = vendor_diff.EmitPatches(script, total_patch_size, so_far)
1321 script.Print("Patching boot image...")
1322 script.ApplyPatch("%s:%s:%d:%s:%d:%s"
1330 script.SetProgress(so_far / total_patch_size)
1356 script.DeleteFiles(["/system/recovery-from-boot.p",
1362 script.ShowProgress(0.1, 10)
1368 temp_script = script.MakeTemporary()
1415 script.DeleteFiles(always_delete)
1416 script.DeleteFilesIfNotMatching(may_delete)
1419 script.Print("Unpacking new system files...")
1420 script.UnpackPackageDir("system", "/system")
1422 script.Print("Unpacking new vendor files...")
1423 script.UnpackPackageDir("vendor", "/vendor")
1426 script.Print("Unpacking new recovery...")
1427 script.UnpackPackageDir("recovery", "/system")
1429 system_diff.EmitRenames(script)
1431 vendor_diff.EmitRenames(script)
1433 script.Print("Symlinks and permissions...")
1445 script.DeleteFiles([i[1] for i in to_create])
1446 script.MakeSymlinks(to_create)
1450 script.AppendScript(temp_script)
1456 script.AppendExtra(OPTIONS.extra_script)
1461 script.Print("Patching remaining system files...")
1462 system_diff.EmitDeferredPatches(script)
1465 script.Print("Erasing user data...")
1466 script.FormatPartition("/data")
1469 script.AppendExtra("""
1476 script.Print("Remounting and verifying system partition files...")
1477 script.Unmount("/system")
1478 script.Mount("/system")
1479 system_diff.EmitExplicitTargetVerification(script)
1482 script.Print("Remounting and verifying vendor partition files...")
1483 script.Unmount("/vendor")
1484 script.Mount("/vendor")
1485 vendor_diff.EmitExplicitTargetVerification(script)
1486 script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)