Merge lp:~lool/linaro-image-tools/drop-qemu-img into lp:linaro-image-tools/11.11

Proposed by Loïc Minier
Status: Merged
Merged at revision: 333
Proposed branch: lp:~lool/linaro-image-tools/drop-qemu-img
Merge into: lp:linaro-image-tools/11.11
Diff against target: 101 lines (+10/-16)
5 files modified
README (+1/-5)
linaro-android-media-create (+0/-1)
linaro-media-create (+0/-1)
linaro_image_tools/media_create/partitions.py (+3/-3)
linaro_image_tools/media_create/tests/test_media_create.py (+6/-6)
To merge this branch: bzr merge lp:~lool/linaro-image-tools/drop-qemu-img
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) Approve
Review via email: mp+59491@code.launchpad.net

Description of the change

Removes the need for qemu-img (uses dd instead); this was only tested on an ext4 filesystem on my host, testing on other fses welcome.

To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

Looks good to me. It'd be good to have testing on other fses, but I can't help with that.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README'
--- README 2011-01-31 11:54:44 +0000
+++ README 2011-04-29 11:16:35 +0000
@@ -13,11 +13,7 @@
13 - python-dbus13 - python-dbus
14 - python-debian >= 0.1.16ubuntu114 - python-debian >= 0.1.16ubuntu1
15 - python-parted15 - python-parted
16 - qemu-kvm-extras-static >= 0.13.0 (only if you're running on x86).16 - qemu-user-static >= 0.13.0 (only if you're running on x86)
17 If you're not running Natty, you can get them from
18 - http://tinyurl.com/6yqzkre for 64-bit
19 - http://tinyurl.com/68rvuoz for 32-bit
20 - qemu-kvm
21 - btrfs-tools17 - btrfs-tools
22 - command-not-found18 - command-not-found
2319
2420
=== modified file 'linaro-android-media-create'
--- linaro-android-media-create 2011-04-26 16:37:19 +0000
+++ linaro-android-media-create 2011-04-29 11:16:35 +0000
@@ -82,7 +82,6 @@
82 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted']82 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted']
83 if not is_arm_host():83 if not is_arm_host():
84 required_commands.append('qemu-arm-static')84 required_commands.append('qemu-arm-static')
85 required_commands.append('qemu-img')
86 for command in required_commands:85 for command in required_commands:
87 ensure_command(command)86 ensure_command(command)
8887
8988
=== modified file 'linaro-media-create'
--- linaro-media-create 2011-04-27 11:49:00 +0000
+++ linaro-media-create 2011-04-29 11:16:35 +0000
@@ -80,7 +80,6 @@
80 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted', 'gpg', 'sha1sum']80 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted', 'gpg', 'sha1sum']
81 if not is_arm_host():81 if not is_arm_host():
82 required_commands.append('qemu-arm-static')82 required_commands.append('qemu-arm-static')
83 required_commands.append('qemu-img')
84 if args.rootfs in ['btrfs', 'ext2', 'ext3', 'ext4']:83 if args.rootfs in ['btrfs', 'ext2', 'ext3', 'ext4']:
85 required_commands.append('mkfs.%s' % args.rootfs)84 required_commands.append('mkfs.%s' % args.rootfs)
86 else:85 else:
8786
=== 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:16:35 +0000
@@ -111,9 +111,9 @@
111 image_size_in_bytes = convert_size_to_bytes(image_size)111 image_size_in_bytes = convert_size_to_bytes(image_size)
112 cylinders = image_size_in_bytes / CYLINDER_SIZE112 cylinders = image_size_in_bytes / CYLINDER_SIZE
113 proc = cmd_runner.run(113 proc = cmd_runner.run(
114 ['qemu-img', 'create', '-f', 'raw', media.path,114 ['dd', 'of=%s' % media.path,
115 str(image_size_in_bytes)],115 'bs=1', 'seek=%s' % image_size_in_bytes, 'count=0'],
116 stdout=open('/dev/null', 'w'))116 stderr=open('/dev/null', 'w'))
117 proc.wait()117 proc.wait()
118118
119 if should_create_partitions:119 if should_create_partitions:
120120
=== 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:16:35 +0000
@@ -812,8 +812,8 @@
812 def test_run_sfdisk_commands(self):812 def test_run_sfdisk_commands(self):
813 tmpfile = self.createTempFileAsFixture()813 tmpfile = self.createTempFileAsFixture()
814 proc = cmd_runner.run(814 proc = cmd_runner.run(
815 ['qemu-img', 'create', '-f', 'raw', tmpfile, '10M'],815 ['dd', 'of=%s' % tmpfile, 'bs=1', 'seek=10M', 'count=0'],
816 stdout=subprocess.PIPE)816 stderr=open('/dev/null', 'w'))
817 proc.communicate()817 proc.communicate()
818 stdout, stderr = run_sfdisk_commands(818 stdout, stderr = run_sfdisk_commands(
819 '2,16063,0xDA', HEADS, SECTORS, '', tmpfile, as_root=False,819 '2,16063,0xDA', HEADS, SECTORS, '', tmpfile, as_root=False,
@@ -899,8 +899,8 @@
899 def _create_qemu_img_with_partitions(self, sfdisk_commands):899 def _create_qemu_img_with_partitions(self, sfdisk_commands):
900 tmpfile = self.createTempFileAsFixture()900 tmpfile = self.createTempFileAsFixture()
901 proc = cmd_runner.run(901 proc = cmd_runner.run(
902 ['qemu-img', 'create', '-f', 'raw', tmpfile, '30M'],902 ['dd', 'of=%s' % tmpfile, 'bs=1', 'seek=30M', 'count=0'],
903 stdout=subprocess.PIPE)903 stderr=open('/dev/null', 'w'))
904 proc.communicate()904 proc.communicate()
905 stdout, stderr = run_sfdisk_commands(905 stdout, stderr = run_sfdisk_commands(
906 sfdisk_commands, HEADS, SECTORS, '', tmpfile, as_root=False,906 sfdisk_commands, HEADS, SECTORS, '', tmpfile, as_root=False,
@@ -958,7 +958,7 @@
958 def test_setup_partitions_for_image_file(self):958 def test_setup_partitions_for_image_file(self):
959 # In practice we could pass an empty image file to setup_partitions,959 # In practice we could pass an empty image file to setup_partitions,
960 # but here we mock Popen() and thanks to that the image is not setup960 # but here we mock Popen() and thanks to that the image is not setup
961 # (via qemu-img) inside setup_partitions. That's why we pass an961 # (via dd) inside setup_partitions. That's why we pass an
962 # already setup image file.962 # already setup image file.
963 tmpfile = self._create_tmpfile()963 tmpfile = self._create_tmpfile()
964 popen_fixture = self.useFixture(MockCmdRunnerPopenFixture())964 popen_fixture = self.useFixture(MockCmdRunnerPopenFixture())
@@ -981,7 +981,7 @@
981 'root', 'ext3', True, True, True)981 'root', 'ext3', True, True, True)
982 self.assertEqual(982 self.assertEqual(
983 # This is the call that would create a 2 GiB image file.983 # This is the call that would create a 2 GiB image file.
984 ['qemu-img create -f raw %s 2147483648' % tmpfile,984 ['dd of=%s bs=1 seek=2147483648 count=0' % tmpfile,
985 # This call would partition the image file.985 # This call would partition the image file.
986 '%s sfdisk --force -D -uS -H %s -S %s -C 1024 %s' % (986 '%s sfdisk --force -D -uS -H %s -S %s -C 1024 %s' % (
987 sudo_args, HEADS, SECTORS, tmpfile),987 sudo_args, HEADS, SECTORS, tmpfile),

Subscribers

People subscribed via source and target branches