From patchwork Wed Aug 29 07:38:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Deepti B. Kalakeri" X-Patchwork-Id: 11013 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 200CB23E02 for ; Wed, 29 Aug 2012 07:38:14 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id E22C3A191C4 for ; Wed, 29 Aug 2012 07:37:41 +0000 (UTC) Received: by ieak11 with SMTP id k11so80383iea.11 for ; Wed, 29 Aug 2012 00:38:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=WNqD+Yea+r2WQax01sbZwJmtMAXStkTGcb4kIG5WGHE=; b=ZwPhbCSzLWHA670wKppu+RWVNUH78dq/AeMX1LumV7pcNXiPgge7Pc2ZCfzf6rQFCH Au1jweVFzZmakCVS9S2Dr/49oBeRyaFdBz84To//CnTpvE+6JuW2kR8Q62l301Kt0EeZ IM4wrXPw6lmCH1MofJnlFf/FMj1HSls6yRNsQpE4FFyr5PSH/sjTOlZDGu1d9hh86pJB 3PZaoum2T0YtHFFRomkN/lMn1Ho6Tk3ubfWQwEAPdmrOxT7qWK1mA4VzT0K03qLsJ6rg GIl8p3YNO8D8tVOFhC0NkOyJ+3XBLTcqmE9GQwviZXEkhDSGAbEXX/Xskv5Cb9L0qWtl vixw== Received: by 10.50.45.162 with SMTP id o2mr701635igm.0.1346225892814; Wed, 29 Aug 2012 00:38:12 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp70860igc; Wed, 29 Aug 2012 00:38:11 -0700 (PDT) Received: by 10.216.131.22 with SMTP id l22mr392638wei.96.1346225891152; Wed, 29 Aug 2012 00:38:11 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id o3si11998847wiz.4.2012.08.29.00.38.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Aug 2012 00:38:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1T6cqo-0004Kv-Ar for ; Wed, 29 Aug 2012 07:38:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 42883E02D0 for ; Wed, 29 Aug 2012 07:38:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 553 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 553: Fixes problem where lmc fails to create images when the hwpack doesn't provide a valid dtbfile Message-Id: <20120829073810.9443.33736.launchpad@ackee.canonical.com> Date: Wed, 29 Aug 2012 07:38:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15864"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 9c9fb5e08ef8d7e7d719233afd576003df19e461 X-Gm-Message-State: ALoCoQnJEycXQ35SqnLa3nbx3mQTO7/zREHT9my3kOaMkeIZ1maMrxnJg0I3k/qR/0T2LChhc0gx Merge authors: Ricardo Salveti (rsalveti) Related merge proposals: https://code.launchpad.net/~rsalveti/linaro-image-tools/check-argument-before-use-boot-files/+merge/121356 proposed by: Ricardo Salveti (rsalveti) review: Approve - Deepti B. Kalakeri (deeptik) ------------------------------------------------------------ revno: 553 [merge] fixes bug: https://launchpad.net/bugs/1042011 committer: Deepti B. Kalakeri branch nick: linaro-image-tools timestamp: Wed 2012-08-29 13:06:37 +0530 message: Fixes problem where lmc fails to create images when the hwpack doesn't provide a valid dtbfile 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 === modified file 'linaro_image_tools/media_create/boards.py' --- linaro_image_tools/media_create/boards.py 2012-08-05 09:22:09 +0000 +++ linaro_image_tools/media_create/boards.py 2012-08-27 00:51:26 +0000 @@ -835,22 +835,27 @@ @classmethod def _get_kflavor_files_v2(cls, path): - kernel = _get_file_matching(os.path.join(path, cls.vmlinuz)) - if kernel is not None: - logger = logging.getLogger("linaro_image_tools") + kernel = initrd = dtb = None + logger = logging.getLogger("linaro_image_tools") + + if cls.vmlinuz: + kernel = _get_file_matching(os.path.join(path, cls.vmlinuz)) + if not cls.vmlinuz or not kernel: + raise ValueError("Unable to find a valid kernel image.") + + if cls.initrd: initrd = _get_file_matching(os.path.join(path, cls.initrd)) - if initrd is None: - logger.warn( - "Could not find a valid initrd, skipping uInitd.") + if not cls.initrd or not initrd: + logger.warn("Could not find a valid initrd, skipping uInitd.") + + if cls.dtb_file: dtb = _get_file_matching(os.path.join(path, cls.dtb_file)) - if dtb is None and cls.dtb_file is not None: - logger.warn( - "Could not find a valid dtb file, skipping it.") - logger.info("Will use kernel=%s, initrd=%s, dtb=%s." % \ + if not cls.dtb_file or not dtb: + logger.warn("Could not find a valid dtb file, skipping it.") + + logger.info("Will use kernel=%s, initrd=%s, dtb=%s." % \ (kernel, initrd, dtb)) - return (kernel, initrd, dtb) - raise ValueError( - "No kernel found matching %s." % (cls.vmlinuz)) + return (kernel, initrd, dtb) @classmethod def populate_raw_partition(cls, media, boot_dir):