From patchwork Fri Apr 29 13:50:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lo=C3=AFc_Minier?= X-Patchwork-Id: 1234 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:50:26 -0000 Delivered-To: patches@linaro.org Received: by 10.224.2.73 with SMTP id 9cs184190qai; Fri, 29 Apr 2011 06:50:47 -0700 (PDT) Received: by 10.216.145.135 with SMTP id p7mr697780wej.38.1304085046423; Fri, 29 Apr 2011 06:50:46 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id h47si8231012wer.180.2011.04.29.06.50.45; Fri, 29 Apr 2011 06:50:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QFo5j-0008QP-6R for ; Fri, 29 Apr 2011 13:50:43 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id E610C2E898F for ; Fri, 29 Apr 2011 13:50:39 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-maintainers/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 333 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-maintainers/linaro-image-tools/trunk] Rev 333: Merge lp:~lool/linaro-image-tools/drop-qemu-img; removes the need for qemu-img Message-Id: <20110429135039.20328.8279.launchpad@loganberry.canonical.com> Date: Fri, 29 Apr 2011 13:50:39 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="12915"; Instance="initZopeless config overlay" X-Launchpad-Hash: a9dc994f0f619d72e54b21bc03ad57cf61226945 Merge authors: Loïc Minier (lool) Related merge proposals: https://code.launchpad.net/~lool/linaro-image-tools/drop-qemu-img/+merge/59491 proposed by: Loïc Minier (lool) review: Approve - Guilherme Salgado (salgado) ------------------------------------------------------------ revno: 333 [merge] committer: Loïc Minier branch nick: linaro-image-tools timestamp: Fri 2011-04-29 15:47:34 +0200 message: Merge lp:~lool/linaro-image-tools/drop-qemu-img; removes the need for qemu-img from the qemu-kvm package (uses dd instead); LP: #772264. modified: README linaro-android-media-create linaro-media-create linaro_image_tools/media_create/partitions.py linaro_image_tools/media_create/tests/test_media_create.py --- lp:linaro-image-tools https://code.launchpad.net/~linaro-maintainers/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-maintainers/linaro-image-tools/trunk/+edit-subscription === modified file 'README' --- README 2011-01-31 11:54:44 +0000 +++ README 2011-04-29 11:04:38 +0000 @@ -13,11 +13,7 @@ - python-dbus - python-debian >= 0.1.16ubuntu1 - python-parted - - qemu-kvm-extras-static >= 0.13.0 (only if you're running on x86). - If you're not running Natty, you can get them from - - http://tinyurl.com/6yqzkre for 64-bit - - http://tinyurl.com/68rvuoz for 32-bit - - qemu-kvm + - qemu-user-static >= 0.13.0 (only if you're running on x86) - btrfs-tools - command-not-found === modified file 'linaro-android-media-create' --- linaro-android-media-create 2011-04-26 16:37:19 +0000 +++ linaro-android-media-create 2011-04-29 10:53:52 +0000 @@ -82,7 +82,6 @@ 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted'] if not is_arm_host(): required_commands.append('qemu-arm-static') - required_commands.append('qemu-img') for command in required_commands: ensure_command(command) === modified file 'linaro-media-create' --- linaro-media-create 2011-04-27 11:49:00 +0000 +++ linaro-media-create 2011-04-29 10:53:52 +0000 @@ -80,7 +80,6 @@ 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted', 'gpg', 'sha1sum'] if not is_arm_host(): required_commands.append('qemu-arm-static') - required_commands.append('qemu-img') if args.rootfs in ['btrfs', 'ext2', 'ext3', 'ext4']: required_commands.append('mkfs.%s' % args.rootfs) else: === modified file 'linaro_image_tools/media_create/partitions.py' --- linaro_image_tools/media_create/partitions.py 2011-04-11 16:41:55 +0000 +++ linaro_image_tools/media_create/partitions.py 2011-04-29 11:02:39 +0000 @@ -111,9 +111,9 @@ image_size_in_bytes = convert_size_to_bytes(image_size) cylinders = image_size_in_bytes / CYLINDER_SIZE proc = cmd_runner.run( - ['qemu-img', 'create', '-f', 'raw', media.path, - str(image_size_in_bytes)], - stdout=open('/dev/null', 'w')) + ['dd', 'of=%s' % media.path, + 'bs=1', 'seek=%s' % image_size_in_bytes, 'count=0'], + stderr=open('/dev/null', 'w')) proc.wait() if should_create_partitions: === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2011-04-21 13:13:59 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2011-04-29 11:03:10 +0000 @@ -812,8 +812,8 @@ def test_run_sfdisk_commands(self): tmpfile = self.createTempFileAsFixture() proc = cmd_runner.run( - ['qemu-img', 'create', '-f', 'raw', tmpfile, '10M'], - stdout=subprocess.PIPE) + ['dd', 'of=%s' % tmpfile, 'bs=1', 'seek=10M', 'count=0'], + stderr=open('/dev/null', 'w')) proc.communicate() stdout, stderr = run_sfdisk_commands( '2,16063,0xDA', HEADS, SECTORS, '', tmpfile, as_root=False, @@ -899,8 +899,8 @@ def _create_qemu_img_with_partitions(self, sfdisk_commands): tmpfile = self.createTempFileAsFixture() proc = cmd_runner.run( - ['qemu-img', 'create', '-f', 'raw', tmpfile, '30M'], - stdout=subprocess.PIPE) + ['dd', 'of=%s' % tmpfile, 'bs=1', 'seek=30M', 'count=0'], + stderr=open('/dev/null', 'w')) proc.communicate() stdout, stderr = run_sfdisk_commands( sfdisk_commands, HEADS, SECTORS, '', tmpfile, as_root=False, @@ -958,7 +958,7 @@ def test_setup_partitions_for_image_file(self): # In practice we could pass an empty image file to setup_partitions, # but here we mock Popen() and thanks to that the image is not setup - # (via qemu-img) inside setup_partitions. That's why we pass an + # (via dd) inside setup_partitions. That's why we pass an # already setup image file. tmpfile = self._create_tmpfile() popen_fixture = self.useFixture(MockCmdRunnerPopenFixture()) @@ -981,7 +981,7 @@ 'root', 'ext3', True, True, True) self.assertEqual( # This is the call that would create a 2 GiB image file. - ['qemu-img create -f raw %s 2147483648' % tmpfile, + ['dd of=%s bs=1 seek=2147483648 count=0' % tmpfile, # This call would partition the image file. '%s sfdisk --force -D -uS -H %s -S %s -C 1024 %s' % ( sudo_args, HEADS, SECTORS, tmpfile),