Merge lp:~mabac/linaro-image-tools/bug-867416 into lp:linaro-image-tools/11.11

Proposed by Mattias Backman
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 439
Merged at revision: 442
Proposed branch: lp:~mabac/linaro-image-tools/bug-867416
Merge into: lp:linaro-image-tools/11.11
Diff against target: 132 lines (+40/-1)
2 files modified
linaro_image_tools/media_create/boards.py (+22/-1)
linaro_image_tools/media_create/tests/test_media_create.py (+18/-0)
To merge this branch: bzr merge lp:~mabac/linaro-image-tools/bug-867416
Reviewer Review Type Date Requested Status
James Tunnicliffe (community) Approve
Review via email: mp+78230@code.launchpad.net

Description of the change

Hi,

This branch disabled the set_appropriate_tty call for V2 hwpacks. This was needed for Omap V1 hwpacks and should not execute for V2.

Also add several asserts to catch similar problems.

Thanks,

Mattias

To post a comment you must log in.
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py 2011-09-22 20:11:46 +0000
+++ linaro_image_tools/media_create/boards.py 2011-10-05 11:01:35 +0000
@@ -834,6 +834,8 @@
834 If the kernel found in the chroot dir is << 2.6.36 we use tyyS2, else834 If the kernel found in the chroot dir is << 2.6.36 we use tyyS2, else
835 we use the default value (_serial_tty).835 we use the default value (_serial_tty).
836 """836 """
837 # XXX: delete this method when hwpacks V1 can die
838 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
837 # XXX: This is also part of our temporary hack to fix bug 697824.839 # XXX: This is also part of our temporary hack to fix bug 697824.
838 cls.serial_tty = classproperty(lambda cls: cls._serial_tty)840 cls.serial_tty = classproperty(lambda cls: cls._serial_tty)
839 vmlinuz = _get_file_matching(841 vmlinuz = _get_file_matching(
@@ -852,7 +854,8 @@
852 # XXX: This is also part of our temporary hack to fix bug 697824; we854 # XXX: This is also part of our temporary hack to fix bug 697824; we
853 # need to call set_appropriate_serial_tty() before doing anything that855 # need to call set_appropriate_serial_tty() before doing anything that
854 # may use cls.serial_tty.856 # may use cls.serial_tty.
855 cls.set_appropriate_serial_tty(chroot_dir)857 if cls.hwpack_format == HardwarepackHandler.FORMAT_1:
858 cls.set_appropriate_serial_tty(chroot_dir)
856 super(OmapConfig, cls).make_boot_files(859 super(OmapConfig, cls).make_boot_files(
857 uboot_parts_dir, is_live, is_lowmem, consoles, chroot_dir,860 uboot_parts_dir, is_live, is_lowmem, consoles, chroot_dir,
858 rootfs_uuid, boot_dir, boot_device_or_file)861 rootfs_uuid, boot_dir, boot_device_or_file)
@@ -861,6 +864,8 @@
861 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,864 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,
862 boot_device_or_file, k_img_data, i_img_data,865 boot_device_or_file, k_img_data, i_img_data,
863 d_img_data):866 d_img_data):
867 # XXX: delete this method when hwpacks V1 can die
868 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
864 install_omap_boot_loader(chroot_dir, boot_dir, cls)869 install_omap_boot_loader(chroot_dir, boot_dir, cls)
865 make_uImage(cls.load_addr, k_img_data, boot_dir)870 make_uImage(cls.load_addr, k_img_data, boot_dir)
866 make_uInitrd(i_img_data, boot_dir)871 make_uInitrd(i_img_data, boot_dir)
@@ -926,6 +931,8 @@
926 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,931 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,
927 boot_device_or_file, k_img_data, i_img_data,932 boot_device_or_file, k_img_data, i_img_data,
928 d_img_data):933 d_img_data):
934 # XXX: delete this method when hwpacks V1 can die
935 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
929 make_uImage(cls.load_addr, k_img_data, boot_dir)936 make_uImage(cls.load_addr, k_img_data, boot_dir)
930 make_uInitrd(i_img_data, boot_dir)937 make_uInitrd(i_img_data, boot_dir)
931 make_dtb(d_img_data, boot_dir)938 make_dtb(d_img_data, boot_dir)
@@ -962,6 +969,8 @@
962 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,969 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,
963 boot_device_or_file, k_img_data, i_img_data,970 boot_device_or_file, k_img_data, i_img_data,
964 d_img_data):971 d_img_data):
972 # XXX: delete this method when hwpacks V1 can die
973 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
965 make_uImage(cls.load_addr, k_img_data, boot_dir)974 make_uImage(cls.load_addr, k_img_data, boot_dir)
966 make_uInitrd(i_img_data, boot_dir)975 make_uInitrd(i_img_data, boot_dir)
967 boot_script_path = os.path.join(boot_dir, cls.boot_script)976 boot_script_path = os.path.join(boot_dir, cls.boot_script)
@@ -979,6 +988,8 @@
979 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,988 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,
980 boot_device_or_file, k_img_data, i_img_data,989 boot_device_or_file, k_img_data, i_img_data,
981 d_img_data):990 d_img_data):
991 # XXX: delete this method when hwpacks V1 can die
992 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
982 make_uImage(cls.load_addr, k_img_data, boot_dir)993 make_uImage(cls.load_addr, k_img_data, boot_dir)
983 boot_script_path = os.path.join(boot_dir, cls.boot_script)994 boot_script_path = os.path.join(boot_dir, cls.boot_script)
984 make_boot_script(boot_env, boot_script_path)995 make_boot_script(boot_env, boot_script_path)
@@ -1032,6 +1043,8 @@
1032 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,1043 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,
1033 boot_device_or_file, k_img_data, i_img_data,1044 boot_device_or_file, k_img_data, i_img_data,
1034 d_img_data):1045 d_img_data):
1046 # XXX: delete this method when hwpacks V1 can die
1047 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
1035 make_uImage(cls.load_addr, k_img_data, boot_dir)1048 make_uImage(cls.load_addr, k_img_data, boot_dir)
1036 boot_script_path = os.path.join(boot_dir, cls.boot_script)1049 boot_script_path = os.path.join(boot_dir, cls.boot_script)
1037 make_boot_script(boot_env, boot_script_path)1050 make_boot_script(boot_env, boot_script_path)
@@ -1185,6 +1198,8 @@
1185 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,1198 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,
1186 boot_device_or_file, k_img_data, i_img_data,1199 boot_device_or_file, k_img_data, i_img_data,
1187 d_img_data):1200 d_img_data):
1201 # XXX: delete this method when hwpacks V1 can die
1202 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
1188 with cls.hardwarepack_handler:1203 with cls.hardwarepack_handler:
1189 uboot_file = cls.get_file('u_boot', default=os.path.join(1204 uboot_file = cls.get_file('u_boot', default=os.path.join(
1190 chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor,1205 chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor,
@@ -1299,6 +1314,8 @@
1299 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,1314 def _make_boot_files(cls, boot_env, chroot_dir, boot_dir,
1300 boot_device_or_file, k_img_data, i_img_data,1315 boot_device_or_file, k_img_data, i_img_data,
1301 d_img_data):1316 d_img_data):
1317 # XXX: delete this method when hwpacks V1 can die
1318 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
1302 cls.install_samsung_boot_loader(cls._get_samsung_spl(chroot_dir),1319 cls.install_samsung_boot_loader(cls._get_samsung_spl(chroot_dir),
1303 cls._get_samsung_uboot(chroot_dir),1320 cls._get_samsung_uboot(chroot_dir),
1304 boot_device_or_file)1321 boot_device_or_file)
@@ -1316,6 +1333,8 @@
13161333
1317 @classmethod1334 @classmethod
1318 def _get_samsung_spl(cls, chroot_dir):1335 def _get_samsung_spl(cls, chroot_dir):
1336 # XXX: delete this method when hwpacks V1 can die
1337 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
1319 spl_dir = os.path.join(1338 spl_dir = os.path.join(
1320 chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor)1339 chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor)
1321 old_spl_path = os.path.join(spl_dir, 'v310_mmc_spl.bin')1340 old_spl_path = os.path.join(spl_dir, 'v310_mmc_spl.bin')
@@ -1339,6 +1358,8 @@
13391358
1340 @classmethod1359 @classmethod
1341 def _get_samsung_uboot(cls, chroot_dir):1360 def _get_samsung_uboot(cls, chroot_dir):
1361 # XXX: delete this method when hwpacks V1 can die
1362 assert cls.hwpack_format == HardwarepackHandler.FORMAT_1
1342 uboot_file = os.path.join(1363 uboot_file = os.path.join(
1343 chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor,1364 chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor,
1344 'u-boot.bin')1365 'u-boot.bin')
13451366
=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py 2011-09-20 14:51:30 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py 2011-10-05 11:01:35 +0000
@@ -1066,6 +1066,24 @@
1066 self.set_appropriate_serial_tty_called,1066 self.set_appropriate_serial_tty_called,
1067 "make_boot_files didn't call set_appropriate_serial_tty")1067 "make_boot_files didn't call set_appropriate_serial_tty")
10681068
1069 def test_omap_make_boot_files_v2(self):
1070 self.set_appropriate_serial_tty_called = False
1071 class config(boards.BeagleConfig):
1072 hwpack_format = HardwarepackHandler.FORMAT_2
1073 self.mock_set_appropriate_serial_tty(config)
1074 self.useFixture(MockSomethingFixture(
1075 boards.BoardConfig, 'make_boot_files',
1076 classmethod(lambda *args: None)))
1077 # We don't need to worry about what's passed to make_boot_files()
1078 # because we mock the method which does the real work above and here
1079 # we're only interested in ensuring that OmapConfig.make_boot_files()
1080 # does not call set_appropriate_serial_tty().
1081 config.make_boot_files(
1082 None, None, None, None, None, None, None, None)
1083 self.assertFalse(
1084 self.set_appropriate_serial_tty_called,
1085 "make_boot_files called set_appropriate_serial_tty")
1086
1069 def test_set_appropriate_serial_tty_old_kernel(self):1087 def test_set_appropriate_serial_tty_old_kernel(self):
1070 tempdir = self.useFixture(CreateTempDirFixture()).tempdir1088 tempdir = self.useFixture(CreateTempDirFixture()).tempdir
1071 boot_dir = os.path.join(tempdir, 'boot')1089 boot_dir = os.path.join(tempdir, 'boot')

Subscribers

People subscribed via source and target branches