diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 431: Stop asserting a combination of V1 parameters for Igep v2 hwpack.

Message ID 20110913075014.28903.33678.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Mattias Backman Sept. 13, 2011, 7:50 a.m. UTC
Merge authors:
  Mattias Backman (mabac)
Related merge proposals:
  https://code.launchpad.net/~mabac/linaro-image-tools/igep-fix/+merge/74968
  proposed by: Mattias Backman (mabac)
  review: Approve - Ricardo Salveti (rsalveti)
  review: Approve - Guilherme Salgado (salgado)
------------------------------------------------------------
revno: 431 [merge]
committer: Mattias Backman <mattias.backman@linaro.org>
branch nick: linaro-image-tools
timestamp: Tue 2011-09-13 09:48:23 +0200
message:
  Stop asserting a combination of V1 parameters for Igep v2 hwpack.
modified:
  linaro_image_tools/media_create/boards.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2011-08-31 13:35:02 +0000
+++ linaro_image_tools/media_create/boards.py	2011-09-12 10:58:04 +0000
@@ -375,6 +375,7 @@ 
 
     @classmethod
     def get_file(cls, file_alias, default=None):
+        # XXX remove the 'default' parameter when V1 support is removed!
         file_in_hwpack = cls.hardwarepack_handler.get_file(file_alias)
         if file_in_hwpack is not None:
             return file_in_hwpack
@@ -594,17 +595,23 @@ 
         cmd_runner.run(['mkdir', '-p', boot_disk]).wait()
         with partition_mounted(boot_partition, boot_disk):
             if cls.uboot_in_boot_part:
-                assert cls.uboot_flavor is not None, (
-                    "uboot_in_boot_part is set but not uboot_flavor")
                 with cls.hardwarepack_handler:
-                    default = os.path.join(
-                        chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor,
-                        'u-boot.img')
-                    if not os.path.exists(default):
+                    # <legacy v1 support>
+                    if cls.uboot_flavor is not None:
                         default = os.path.join(
                             chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor,
-                            'u-boot.bin')
+                            'u-boot.img')
+                        if not os.path.exists(default):
+                            default = os.path.join(
+                                chroot_dir, 'usr', 'lib', 'u-boot', cls.uboot_flavor,
+                                'u-boot.bin')
+                    else:
+                        default = None
+                    # </legacy v1 support>
                     uboot_bin = cls.get_file('u_boot', default=default)
+                    assert uboot_bin is not None, (
+                        "uboot binary could not be found")
+
                     proc = cmd_runner.run(
                         ['cp', '-v', uboot_bin, boot_disk], as_root=True)
                     proc.wait()