=== modified file 'linaro_image_tools/media_create/boards.py'
@@ -552,9 +552,12 @@
vmlinuz = _get_file_matching(
os.path.join(chroot_dir, 'boot', 'vmlinuz*'))
basename = os.path.basename(vmlinuz)
- minor_version = re.match('.*2\.6\.([0-9]{2}).*', basename).group(1)
- if int(minor_version) < 36:
- cls.serial_tty = classproperty(lambda cls: 'ttyS2')
+ match = re.match('.*2\.6\.([0-9]{2}).*', basename)
+ # Assume if it doesn't match that it is 3.0 or later.
+ if match is not None:
+ minor_version = match.group(1)
+ if int(minor_version) < 36:
+ cls.serial_tty = classproperty(lambda cls: 'ttyS2')
@classmethod
def make_boot_files(cls, uboot_parts_dir, is_live, is_lowmem, consoles,
=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
@@ -1039,6 +1039,14 @@
boards.BeagleConfig.set_appropriate_serial_tty(tempdir)
self.assertEquals('ttyO2', boards.BeagleConfig.serial_tty)
+ def test_set_appropriate_serial_tty_three_dot_oh_kernel(self):
+ tempdir = self.useFixture(CreateTempDirFixture()).tempdir
+ boot_dir = os.path.join(tempdir, 'boot')
+ os.makedirs(boot_dir)
+ open(os.path.join(boot_dir, 'vmlinuz-3.0-13-foo'), 'w').close()
+ boards.BeagleConfig.set_appropriate_serial_tty(tempdir)
+ self.assertEquals('ttyO2', boards.BeagleConfig.serial_tty)
+
class TestGetSfdiskCmd(TestCase):