Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////BN ENCORE//////////////////////////////////////////////////////
- def UnpackPackageFile(self, src, dst):
- """Unpack a given file from the OTA package into the given
- destination file."""
- self.script.append('package_extract_file("%s", "%s");' % (src, dst))
- def CopyBootFiles(input_zip, output_zip):
- output_zip.writestr("MLO", input_zip.read("BOOT/bootloader"))
- output_zip.writestr("u-boot.bin", input_zip.read("BOOT/second"))
- output_zip.writestr("kernel", input_zip.read("BOOT/kernel"))
- output_zip.writestr("ramdisk.img", input_zip.read("BOOT/ramdisk.img"))
- CopyBootFiles(input_zip, output_zip)
- # This mimics how the official B&N updates work and seems pretty elegant to me
- script.Mount("/boot")
- script.UnpackPackageFile("MLO", "/boot/MLO")
- script.UnpackPackageFile("u-boot.bin", "/boot/u-boot.bin")
- script.UnpackPackageFile("kernel", "/boot/uImage")
- script.UnpackPackageFile("ramdisk.img", "/boot/uRamdisk")
- # -- encore build change done
- ////////////////////////////////////////////HP TENDERLOIN//////////////////////////////////////////
- # -- tenderloin build change starting
- #boot_img = common.File("boot.img", common.BuildBootableImage(
- # os.path.join(OPTIONS.input_tmp, "BOOT")))
- #recovery_img = common.File("recovery.img", common.BuildBootableImage(
- # os.path.join(OPTIONS.input_tmp, "RECOVERY")))
- #MakeRecoveryPatch(output_zip, recovery_img, boot_img)
- # -- tenderloin build change done
- Item.GetMetadata(input_zip)
- Item.Get("system").SetPermissions(script)
- # -- tenderloin build change starting
- #common.CheckSize(boot_img.data, "boot.img", OPTIONS.info_dict)
- #common.ZipWriteStr(output_zip, "boot.img", boot_img.data)
- # -- tenderloin build change done
- script.ShowProgress(0.2, 0)
- if OPTIONS.backuptool:
- script.ShowProgress(0.2, 10)
- script.RunBackup("restore")
- # script.RunVerifyCachePartitionSize()
- script.ShowProgress(0.2, 10)
- # -- tenderloin build change starting
- #script.WriteRawImage("/boot", "boot.img")
- boot_img = open(OPTIONS.device_out + "/boot.img", "r")
- common.ZipWriteStr(output_zip, "boot.img", boot_img.read())
- boot_img.close()
- script.Mount("/boot")
- script.UnpackPackageFile("boot.img", "/boot/uImage.CyanogenMod")
- moboot_tga = open(OPTIONS.device_out + "/moboot.splash.CyanogenMod.tga")
- common.ZipWriteStr(output_zip, "moboot.splash.CyanogenMod.tga", moboot_tga.read())
- moboot_tga.close()
- script.UnpackPackageFile("moboot.splash.CyanogenMod.tga", "/boot/moboot.splash.CyanogenMod.tga")
- # -- tenderloin build change done
- if __name__ == '__main__':
- try:
- # Ugly hacks are ugly
- OPTIONS.device_out = os.path.dirname(sys.argv[-1])
- main(sys.argv[1:])
- except common.ExternalError, e:
- print
- print " ERROR: %s" % (e,)
- print
- sys.exit(1)
Advertisement
Add Comment
Please, Sign In to add comment