From patchwork Thu Aug 30 10:39:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Tunnicliffe X-Patchwork-Id: 11038 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 35B5F23E00 for ; Thu, 30 Aug 2012 10:39:16 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id D5118A18ADE for ; Thu, 30 Aug 2012 10:38:40 +0000 (UTC) Received: by iafj25 with SMTP id j25so2732645iaf.11 for ; Thu, 30 Aug 2012 03:39:15 -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=KunCtVWUe6hg6KMOa621FlDiyNArx/oQImsDyXmMzkM=; b=DxOaCwZ51ZkTlxuCoodaLVv8T+HaEQgv9HvNMvrAKqiyJt6G9hAg4o6QcAG/LibMX0 baOBIPB2p50cgWddQWpBUd6r6GRXoOgJCB6r/E2Ti9X99ARthG9hOlNqKc5i8nWwfTXn 896eWxRuiPX4JoEp+bOeTduS80InhKGuQggdieZS3ajk6gBGoYKS07s8MAck2H1kUbzp Ygu18mYIWObY1pFOcmk1kQNRB5PoqLUwFvxgogzBa7l69eX3iutZmerYuoCReVSBHYAd c4PiQ1yutG+io8+Zymk0EZycxwQER/ldRkNmV1SosH/gWdcocrg4CXvW/qN9UmYaJUCg MeTw== Received: by 10.42.109.194 with SMTP id m2mr4077471icp.48.1346323155221; Thu, 30 Aug 2012 03:39:15 -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 ex8csp4282igc; Thu, 30 Aug 2012 03:39:14 -0700 (PDT) Received: by 10.180.81.38 with SMTP id w6mr428201wix.10.1346323153560; Thu, 30 Aug 2012 03:39:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id n12si274125wiw.7.2012.08.30.03.39.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Aug 2012 03:39:13 -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 1T729Y-0003q6-Ng for ; Thu, 30 Aug 2012 10:39:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id A4482E014A for ; Thu, 30 Aug 2012 10:39:12 +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: 555 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 555: Fix for multiple bootloaders in a hardware pack configuration (added missing comment) Message-Id: <20120830103912.27982.5688.launchpad@ackee.canonical.com> Date: Thu, 30 Aug 2012 10:39:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15877"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 6c60b94cde5dd7ca208922fe71e64cfbcf63038e X-Gm-Message-State: ALoCoQmZA+C/8hVAbvRk8RP7lOv7EXxk53V0kwIJb7cv0POUSKmyIhky31oMpFfdP2UST2ybD4WG ------------------------------------------------------------ revno: 555 committer: James Tunnicliffe branch nick: linaro-image-tools timestamp: Thu 2012-08-30 11:39:02 +0100 message: Fix for multiple bootloaders in a hardware pack configuration (added missing comment) modified: linaro_image_tools/hwpack/config.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/hwpack/config.py' --- linaro_image_tools/hwpack/config.py 2012-08-30 10:13:21 +0000 +++ linaro_image_tools/hwpack/config.py 2012-08-30 10:39:02 +0000 @@ -122,7 +122,33 @@ """Create a Config. :param fp: a file-like object containing the configuration. + :param allow_unset_bootloader: Bool. If you have more than 1 bootloader + in the config object and don't set which one to use, accessing + bootloader related parameters will throw an exception. By setting + this None will be returned instead. """ + # This Config class is used in two places: + # 1. Generating hardware packs + # 2. Combining a hardware pack with an OS image to create a bootable + # disk image. + # + # In both cases we are providing a file format independant interface + # to configuration data to the rest of Linaro Image Tools. + # + # In case 1 we want all information to be put in the hardware pack and + # there is no possibility of picking a booloader (all bootloaders are + # put in the hardware pack and one is picked later). In this case we + # don't want to trip up other code by throwing an exception when a + # bootloader dependant parameter is queried so we return None. In + # reality this information isn't used, but sometimes gets queried by + # tests. This flag allows us to keep things simple. + # + # In case 2 we may have multiple bootloaders specified, but only one + # can be used by the OS image so we need to pick one. If a bootloader + # isn't specified we want to throw an error when a choice would make a + # difference to what is returned when querying the object. + # + # self.allow_unset_bootloader allows for both modes of operation. self.allow_unset_bootloader = allow_unset_bootloader self.bootloader = None obfuscated_e = None