Loading tools/releasetools/add_img_to_target_files.py +4 −7 Original line number Diff line number Diff line Loading @@ -308,9 +308,8 @@ def CreateImage(input_dir, info_dict, what, output_file, block_list=None): hash_seed = "hash_seed-" + uuid_seed image_props["hash_seed"] = str(uuid.uuid5(uuid.NAMESPACE_URL, hash_seed)) succ = build_image.BuildImage(os.path.join(input_dir, what.upper()), image_props, output_file.name) assert succ, "build " + what + ".img image failed" build_image.BuildImage( os.path.join(input_dir, what.upper()), image_props, output_file.name) output_file.Write() if block_list: Loading Loading @@ -361,8 +360,7 @@ def AddUserdata(output_zip): fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/data"].fs_type succ = build_image.BuildImage(user_dir, image_props, img.name) assert succ, "build userdata.img image failed" build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict) img.Write() Loading Loading @@ -514,8 +512,7 @@ def AddCache(output_zip): fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/cache"].fs_type succ = build_image.BuildImage(user_dir, image_props, img.name) assert succ, "build cache.img image failed" build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "cache.img", OPTIONS.info_dict) img.Write() Loading tools/releasetools/build_image.py +134 −148 File changed.Preview size limit exceeded, changes collapsed. Show changes tools/releasetools/test_build_image.py +7 −6 Original line number Diff line number Diff line Loading @@ -22,8 +22,8 @@ import unittest import common from build_image import ( AVBCalcMinPartitionSize, BLOCK_SIZE, CheckHeadroom, RunCommand, SetUpInDirAndFsConfig) AVBCalcMinPartitionSize, BLOCK_SIZE, BuildImageError, CheckHeadroom, RunCommand, SetUpInDirAndFsConfig) class BuildImageTest(unittest.TestCase): Loading @@ -49,7 +49,7 @@ class BuildImageTest(unittest.TestCase): 'partition_headroom' : '4096000', 'mount_point' : 'system', } self.assertTrue(CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict)) CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict) def test_CheckHeadroom_InsufficientHeadroom(self): # Required headroom: 1001 blocks. Loading @@ -58,7 +58,8 @@ class BuildImageTest(unittest.TestCase): 'partition_headroom' : '4100096', 'mount_point' : 'system', } self.assertFalse(CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict)) self.assertRaises( BuildImageError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict) def test_CheckHeadroom_WrongFsType(self): prop_dict = { Loading Loading @@ -98,14 +99,14 @@ class BuildImageTest(unittest.TestCase): 'partition_headroom' : '40960', 'mount_point' : 'system', } self.assertTrue(CheckHeadroom(ext4fs_output, prop_dict)) CheckHeadroom(ext4fs_output, prop_dict) prop_dict = { 'fs_type' : 'ext4', 'partition_headroom' : '413696', 'mount_point' : 'system', } self.assertFalse(CheckHeadroom(ext4fs_output, prop_dict)) self.assertRaises(BuildImageError, CheckHeadroom, ext4fs_output, prop_dict) def test_SetUpInDirAndFsConfig_SystemRootImageTrue_NonSystem(self): prop_dict = { Loading tools/releasetools/test_validate_target_files.py +1 −2 Original line number Diff line number Diff line Loading @@ -139,8 +139,7 @@ class ValidateTargetFilesTest(unittest.TestCase): 'verity_signer_cmd' : 'verity_signer', 'verity_size' : str(verity_size), } self.assertTrue( build_image.MakeVerityEnabledImage(output_file, verity_fec, prop_dict)) build_image.MakeVerityEnabledImage(output_file, verity_fec, prop_dict) def test_ValidateVerifiedBootImages_systemImage(self): input_tmp = common.MakeTempDir() Loading Loading
tools/releasetools/add_img_to_target_files.py +4 −7 Original line number Diff line number Diff line Loading @@ -308,9 +308,8 @@ def CreateImage(input_dir, info_dict, what, output_file, block_list=None): hash_seed = "hash_seed-" + uuid_seed image_props["hash_seed"] = str(uuid.uuid5(uuid.NAMESPACE_URL, hash_seed)) succ = build_image.BuildImage(os.path.join(input_dir, what.upper()), image_props, output_file.name) assert succ, "build " + what + ".img image failed" build_image.BuildImage( os.path.join(input_dir, what.upper()), image_props, output_file.name) output_file.Write() if block_list: Loading Loading @@ -361,8 +360,7 @@ def AddUserdata(output_zip): fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/data"].fs_type succ = build_image.BuildImage(user_dir, image_props, img.name) assert succ, "build userdata.img image failed" build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict) img.Write() Loading Loading @@ -514,8 +512,7 @@ def AddCache(output_zip): fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/cache"].fs_type succ = build_image.BuildImage(user_dir, image_props, img.name) assert succ, "build cache.img image failed" build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "cache.img", OPTIONS.info_dict) img.Write() Loading
tools/releasetools/build_image.py +134 −148 File changed.Preview size limit exceeded, changes collapsed. Show changes
tools/releasetools/test_build_image.py +7 −6 Original line number Diff line number Diff line Loading @@ -22,8 +22,8 @@ import unittest import common from build_image import ( AVBCalcMinPartitionSize, BLOCK_SIZE, CheckHeadroom, RunCommand, SetUpInDirAndFsConfig) AVBCalcMinPartitionSize, BLOCK_SIZE, BuildImageError, CheckHeadroom, RunCommand, SetUpInDirAndFsConfig) class BuildImageTest(unittest.TestCase): Loading @@ -49,7 +49,7 @@ class BuildImageTest(unittest.TestCase): 'partition_headroom' : '4096000', 'mount_point' : 'system', } self.assertTrue(CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict)) CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict) def test_CheckHeadroom_InsufficientHeadroom(self): # Required headroom: 1001 blocks. Loading @@ -58,7 +58,8 @@ class BuildImageTest(unittest.TestCase): 'partition_headroom' : '4100096', 'mount_point' : 'system', } self.assertFalse(CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict)) self.assertRaises( BuildImageError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict) def test_CheckHeadroom_WrongFsType(self): prop_dict = { Loading Loading @@ -98,14 +99,14 @@ class BuildImageTest(unittest.TestCase): 'partition_headroom' : '40960', 'mount_point' : 'system', } self.assertTrue(CheckHeadroom(ext4fs_output, prop_dict)) CheckHeadroom(ext4fs_output, prop_dict) prop_dict = { 'fs_type' : 'ext4', 'partition_headroom' : '413696', 'mount_point' : 'system', } self.assertFalse(CheckHeadroom(ext4fs_output, prop_dict)) self.assertRaises(BuildImageError, CheckHeadroom, ext4fs_output, prop_dict) def test_SetUpInDirAndFsConfig_SystemRootImageTrue_NonSystem(self): prop_dict = { Loading
tools/releasetools/test_validate_target_files.py +1 −2 Original line number Diff line number Diff line Loading @@ -139,8 +139,7 @@ class ValidateTargetFilesTest(unittest.TestCase): 'verity_signer_cmd' : 'verity_signer', 'verity_size' : str(verity_size), } self.assertTrue( build_image.MakeVerityEnabledImage(output_file, verity_fec, prop_dict)) build_image.MakeVerityEnabledImage(output_file, verity_fec, prop_dict) def test_ValidateVerifiedBootImages_systemImage(self): input_tmp = common.MakeTempDir() Loading