From patchwork Wed May 16 07:19:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?0JTQsNC90LjQu9C+INCo0LXQs9Cw0L0=?= X-Patchwork-Id: 8670 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 2431F23E13 for ; Wed, 16 May 2012 07:19:15 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id C8396A18321 for ; Wed, 16 May 2012 07:19:14 +0000 (UTC) Received: by yhpp61 with SMTP id p61so433454yhp.11 for ; Wed, 16 May 2012 00:19:14 -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=g5fWIN+xXDQtUJCSVPlXVGqsTaeydAgwVCkACSJNB8o=; b=LEdnRKqFWjPDsPj8vlh+idOnsJofdUDn+dXqaA6ir6OXnsp5HNH56gcA1qA7j0NU7c NuQtSqvDpLXM0tisv0lXxPBvf7W410C4DO5xCAU6FO1idnNIzK0T/EPYB3ML+u/tepqe S8m+A3bBRNxj5N2alfTHf3v3UZ5k/7lnAT6vWuBpX8Iu98c5CZkiDlXsSVX5oNNKAv4e hNj9lh661P8nNInEUkipFD5vMi66qEWEQ1Yh02aD5x0xYPkDixFWVQM1Si63ySBCT+qk P6oW/1I15JKnz7ChAO32BCOQDfJkLeGYphrMRvWzNn4rgqMlrwdXZzu2zKM7v8PUBHtN YuZg== Received: by 10.50.222.202 with SMTP id qo10mr9216155igc.0.1337152753848; Wed, 16 May 2012 00:19:13 -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.231.35.72 with SMTP id o8csp472967ibd; Wed, 16 May 2012 00:19:12 -0700 (PDT) Received: by 10.180.106.9 with SMTP id gq9mr5057800wib.17.1337152751947; Wed, 16 May 2012 00:19:11 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id bu7si2108429wib.9.2012.05.16.00.19.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 May 2012 00:19: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 1SUYVr-0007UQ-B9 for ; Wed, 16 May 2012 07:19:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 45D9EE5228 for ; Wed, 16 May 2012 07:19:11 +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: 517 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 517: Ensure produced files are not owned by root for Fast Models builds. Fixes #994360. Patch contribu... Message-Id: <20120516071911.29159.62161.launchpad@ackee.canonical.com> Date: Wed, 16 May 2012 07:19:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15247"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 9de3087480b3f68bae9fb52333985625cd794798 X-Gm-Message-State: ALoCoQmo/uRGMgyGhjotdzBqW7/lTui5JwMjky441IknvdpannYC3okuVwUhEo+cJ7kETQi7cguz Merge authors: Michael Hope (michaelh1) Related merge proposals: https://code.launchpad.net/~michaelh1/linaro-image-tools/lp994360/+merge/104862 proposed by: Michael Hope (michaelh1) review: Approve - Данило Шеган (danilo) ------------------------------------------------------------ revno: 517 [merge] committer: Danilo Šegan branch nick: trunk timestamp: Wed 2012-05-16 09:17:13 +0200 message: Ensure produced files are not owned by root for Fast Models builds. Fixes #994360. Patch contributed by Michael Hope. 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-04-24 00:14:34 +0000 +++ linaro_image_tools/media_create/boards.py 2012-05-16 07:17:13 +0000 @@ -90,6 +90,18 @@ return start, end, length +def copy_drop(src, dest_dir): + """Copy a file from src to destdir, dropping root ownership on the + way. + """ + cmd = [ "cp", "-v", src, dest_dir ] + cmd_runner.run(cmd, as_root=True).wait() + + final = os.path.join(dest_dir, os.path.basename(src)) + cmd = [ "chown", "%s:%s" % (os.getuid(), os.getgid()), final ] + cmd_runner.run(cmd, as_root=True).wait() + + class classproperty(object): """A descriptor that provides @property behavior on class methods.""" def __init__(self, getter): @@ -1354,17 +1366,12 @@ def _make_boot_files_v2(cls, boot_env, chroot_dir, boot_dir, boot_device_or_file, k_img_data, i_img_data, d_img_data): - logger = logging.getLogger("linaro_image_tools") - logger.info("WTF=%s." % boot_device_or_file ) output_dir=os.path.dirname(boot_device_or_file) - cmd = [ "cp", "-v", _get_file_matching("%s/boot/img.axf" % chroot_dir), output_dir ] - proc = cmd_runner.run(cmd, as_root=True) - proc.wait() - cmd = [ "cp", "-v", k_img_data, i_img_data, d_img_data, output_dir ] - proc = cmd_runner.run(cmd, as_root=True) - proc.wait() - return - + + copy_drop(_get_file_matching("%s/boot/img.axf" % chroot_dir), output_dir) + + for filename in (k_img_data, i_img_data, d_img_data): + copy_drop(filename, output_dir) class SamsungConfig(BoardConfig): @classproperty