685
686
('UBOOT_ENV', 'u-boot-env.bin', 0, 0x00C1F000, '10')]
686
687
# Create a config file
687
688
cfg_file = os.path.join(self.temp_bootdir_path,
688
boards.SnowballEmmcConfig.SNOWBALL_STARTUP_FILES_CONFIG)
689
boards.SnowballEmmcConfig.snowball_startup_files_config)
689
690
with open(cfg_file, 'w') as f:
690
691
for line in src_data:
691
692
# Write comments, so we test that the parser can read them
719
720
def test_get_file_info_relative_path(self):
720
721
# Create a config file
721
722
cfg_file = os.path.join(self.temp_bootdir_path,
722
boards.SnowballEmmcConfig.SNOWBALL_STARTUP_FILES_CONFIG)
723
boards.SnowballEmmcConfig.snowball_startup_files_config)
723
724
uboot_file = 'u-boot.bin'
724
725
with open(cfg_file, 'w') as f:
725
726
f.write('%s %s %i %#x %s\n' % ('NORMAL', uboot_file, 0,
733
734
def test_get_file_info_abs_path(self):
734
735
# Create a config file
735
736
cfg_file = os.path.join(self.temp_bootdir_path,
736
boards.SnowballEmmcConfig.SNOWBALL_STARTUP_FILES_CONFIG)
737
boards.SnowballEmmcConfig.snowball_startup_files_config)
737
738
uboot_dir = tempfile.mkdtemp(dir=self.tempdir)
738
739
uboot_file = os.path.join(uboot_dir, 'u-boot.bin')
739
740
uboot_relative_file = uboot_file.replace(self.tempdir, '')
748
749
def test_get_file_info_raises(self):
749
750
# Create a config file
750
751
cfg_file = os.path.join(self.temp_bootdir_path,
751
boards.SnowballEmmcConfig.SNOWBALL_STARTUP_FILES_CONFIG)
752
boards.SnowballEmmcConfig.snowball_startup_files_config)
752
753
with open(cfg_file, 'w') as f:
753
754
f.write('%s %s %i %#x %s\n' % ('NORMAL', 'u-boot.bin', 0,
1142
1143
'794624,-,E\n794624,524288,L\n1318912,1048576,L\n2367488,,,-',
1143
1144
android_boards.AndroidSnowballEmmcConfig.get_sfdisk_cmd())
1146
class TestGetSfdiskCmdV2(TestCase):
1149
class config(boards.Mx5Config):
1150
partition_layout = 'reserved_bootfs_rootfs'
1152
'1,8191,0xDA\n8192,106496,0x0C,*\n114688,,,-',
1153
config.get_sfdisk_cmd())
1155
def test_snowball_sd(self):
1156
class config(boards.SnowballSdConfig):
1157
partition_layout = 'bootfs_rootfs'
1159
'63,106432,0x0C,*\n106496,,,-',
1160
config.get_sfdisk_cmd())
1162
def test_snowball_emmc(self):
1163
class config(boards.SnowballEmmcConfig):
1164
partition_layout = 'reserved_bootfs_rootfs'
1165
LOADER_START_S = (128 * 1024) / SECTOR_SIZE
1167
'256,7936,0xDA\n8192,106496,0x0C,*\n114688,,,-',
1168
config.get_sfdisk_cmd())
1170
def test_smdkv310(self):
1171
class config(board_configs['smdkv310']):
1172
partition_layout = 'reserved_bootfs_rootfs'
1173
LOADER_MIN_SIZE_S = (SAMSUNG_V310_BL2_START +
1174
SAMSUNG_V310_BL2_LEN -
1175
SAMSUNG_V310_BL1_START)
1177
'1,8191,0xDA\n8192,106496,0x0C,*\n114688,,,-',
1178
config.get_sfdisk_cmd())
1180
def test_origen(self):
1181
class config(board_configs['origen']):
1182
partition_layout = 'reserved_bootfs_rootfs'
1183
LOADER_MIN_SIZE_S = (SAMSUNG_V310_BL2_START +
1184
SAMSUNG_V310_BL2_LEN -
1185
SAMSUNG_V310_BL1_START)
1187
'1,8191,0xDA\n8192,106496,0x0C,*\n114688,,,-',
1188
config.get_sfdisk_cmd())
1146
1191
class TestGetBootCmd(TestCase):