diff mbox

[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
State Accepted
Headers show

Commit Message

Loïc Minier April 29, 2011, 1:50 p.m. UTC
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 <lool@dooz.org>
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
diff mbox

Patch

=== 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),