From patchwork Fri Mar 11 00:10:53 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: 496 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:43:07 -0000 Delivered-To: patches@linaro.org Received: by 10.224.67.207 with SMTP id s15cs38932qai; Thu, 10 Mar 2011 16:10:55 -0800 (PST) Received: by 10.227.207.21 with SMTP id fw21mr3247460wbb.138.1299802254797; Thu, 10 Mar 2011 16:10:54 -0800 (PST) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id h20si6718072wes.107.2011.03.10.16.10.53; Thu, 10 Mar 2011 16:10:54 -0800 (PST) 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 1PxpwT-000414-MM for ; Fri, 11 Mar 2011 00:10:53 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id A4E9B2E88C1 for ; Fri, 11 Mar 2011 00:10:53 +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: 297 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-maintainers/linaro-image-tools/trunk] Rev 297: Merge lp:~lool/linaro-image-tools/chs-align; use 128 heads and 32 sectors; Message-Id: <20110311001053.16744.42473.launchpad@loganberry.canonical.com> Date: Fri, 11 Mar 2011 00:10:53 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="12568"; Instance="initZopeless config overlay" X-Launchpad-Hash: a7d66a1c938f64249a80dcdfba5675782fcf91e5 Merge authors: Loïc Minier (lool) Related merge proposals: https://code.launchpad.net/~lool/linaro-image-tools/chs-align/+merge/52948 proposed by: Loïc Minier (lool) review: Approve - James Westby (james-w) ------------------------------------------------------------ revno: 297 [merge] committer: Loïc Minier branch nick: linaro-image-tools timestamp: Fri 2011-03-11 01:06:13 +0100 message: Merge lp:~lool/linaro-image-tools/chs-align; use 128 heads and 32 sectors; should avoid some warnings from disk partitioning tools. modified: linaro_media_create/boards.py linaro_media_create/partitions.py linaro_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 'linaro_media_create/boards.py' --- linaro_media_create/boards.py 2011-03-09 15:55:56 +0000 +++ linaro_media_create/boards.py 2011-03-10 23:28:21 +0000 @@ -36,8 +36,10 @@ from linaro_media_create.partitions import SECTOR_SIZE # Notes: -# * geometry is currently always 255 heads and 63 sectors due to limitations of -# older OMAP3 boot ROMs +# * since we align partitions on 4 MiB by default, geometry is currently 128 +# heads and 32 sectors (2 MiB) as to have CHS-aligned partition start/end +# offsets most of the time and hence avoid some warnings with disk +# partitioning tools # * apparently some OMAP3 ROMs don't tolerate vfat length of an odd number of # sectors (only sizes rounded to 1 KiB seem to boot) # * we want partitions aligned on 4 MiB as to get the best performance and === modified file 'linaro_media_create/partitions.py' --- linaro_media_create/partitions.py 2011-02-28 19:40:43 +0000 +++ linaro_media_create/partitions.py 2011-03-10 23:28:21 +0000 @@ -33,8 +33,8 @@ from linaro_media_create import cmd_runner -HEADS = 255 -SECTORS = 63 +HEADS = 128 +SECTORS = 32 SECTOR_SIZE = 512 # bytes CYLINDER_SIZE = HEADS * SECTORS * SECTOR_SIZE DBUS_PROPERTIES = 'org.freedesktop.DBus.Properties' === modified file 'linaro_media_create/tests/test_media_create.py' --- linaro_media_create/tests/test_media_create.py 2011-03-09 17:18:18 +0000 +++ linaro_media_create/tests/test_media_create.py 2011-03-10 23:28:21 +0000 @@ -743,7 +743,7 @@ popen_fixture = self.useFixture(MockCmdRunnerPopenFixture()) sfdisk_fixture = self.useFixture(MockRunSfdiskCommandsFixture()) - create_partitions(boards.Mx5Config, self.media, 255, 63, '') + create_partitions(boards.Mx5Config, self.media, 128, 32, '') self.assertEqual( ['%s parted -s %s mklabel msdos' % (sudo_args, self.media.path), @@ -753,7 +753,7 @@ # every time we run sfdisk it actually repartitions the device, # erasing any partitions created previously. self.assertEqual( - [('1,8191,0xDA\n8192,106496,0x0C,*\n114688,,,-', 255, 63, '', + [('1,8191,0xDA\n8192,106496,0x0C,*\n114688,,,-', 128, 32, '', self.media.path)], sfdisk_fixture.mock.calls) @@ -763,7 +763,7 @@ sfdisk_fixture = self.useFixture(MockRunSfdiskCommandsFixture()) create_partitions( - board_configs['smdkv310'], self.media, 255, 63, '') + board_configs['smdkv310'], self.media, 128, 32, '') self.assertEqual( ['%s parted -s %s mklabel msdos' % (sudo_args, self.media.path), @@ -773,7 +773,7 @@ # every time we run sfdisk it actually repartitions the device, # erasing any partitions created previously. self.assertEqual( - [('1,221183,0xDA\n221184,106496,0x0C,*\n327680,,,-', 255, 63, '', + [('1,221183,0xDA\n221184,106496,0x0C,*\n327680,,,-', 128, 32, '', self.media.path)], sfdisk_fixture.mock.calls) def test_create_partitions_for_beagle(self): @@ -781,14 +781,14 @@ sfdisk_fixture = self.useFixture(MockRunSfdiskCommandsFixture()) create_partitions( - board_configs['beagle'], self.media, 255, 63, '') + board_configs['beagle'], self.media, 128, 32, '') self.assertEqual( ['%s parted -s %s mklabel msdos' % (sudo_args, self.media.path), 'sync'], popen_fixture.mock.commands_executed) self.assertEqual( - [('63,106432,0x0C,*\n106496,,,-', 255, 63, '', self.media.path)], + [('63,106432,0x0C,*\n106496,,,-', 128, 32, '', self.media.path)], sfdisk_fixture.mock.calls) def test_create_partitions_with_img_file(self): @@ -797,7 +797,7 @@ tmpfile = self.createTempFileAsFixture() create_partitions( - board_configs['beagle'], Media(tmpfile), 255, 63, '') + board_configs['beagle'], Media(tmpfile), 128, 32, '') # Unlike the test for partitioning of a regular block device, in this # case parted was not called as there's no existing partition table @@ -805,7 +805,7 @@ self.assertEqual(['sync'], popen_fixture.mock.commands_executed) self.assertEqual( - [('63,106432,0x0C,*\n106496,,,-', 255, 63, '', tmpfile)], + [('63,106432,0x0C,*\n106496,,,-', 128, 32, '', tmpfile)], sfdisk_fixture.mock.calls) def test_run_sfdisk_commands(self): @@ -815,7 +815,7 @@ stdout=subprocess.PIPE) proc.communicate() stdout, stderr = run_sfdisk_commands( - '2,16063,0xDA', 255, 63, '', tmpfile, as_root=False, + '2,16063,0xDA', 128, 32, '', tmpfile, as_root=False, stderr=subprocess.PIPE) self.assertIn('Successfully wrote the new partition table', stdout) @@ -824,7 +824,7 @@ self.assertRaises( cmd_runner.SubcommandNonZeroReturnValue, run_sfdisk_commands, - ',1,0xDA', 255, 63, '', tmpfile, as_root=False, + ',1,0xDA', 128, 32, '', tmpfile, as_root=False, stderr=subprocess.PIPE) @@ -902,7 +902,7 @@ stdout=subprocess.PIPE) proc.communicate() stdout, stderr = run_sfdisk_commands( - sfdisk_commands, 255, 63, '', tmpfile, as_root=False, + sfdisk_commands, 128, 32, '', tmpfile, as_root=False, # Throw away stderr as sfdisk complains a lot when operating on a # qemu image. stderr=subprocess.PIPE) @@ -982,7 +982,7 @@ # This is the call that would create a 2 GiB image file. ['qemu-img create -f raw %s 2147483648' % tmpfile, # This call would partition the image file. - '%s sfdisk --force -D -uS -H 255 -S 63 -C 261 %s' % ( + '%s sfdisk --force -D -uS -H 128 -S 32 -C 1024 %s' % ( sudo_args, tmpfile), # Make sure changes are written to disk. 'sync', @@ -1009,7 +1009,7 @@ True, True, True) self.assertEqual( ['%s parted -s %s mklabel msdos' % (sudo_args, tmpfile), - '%s sfdisk --force -D -uS -H 255 -S 63 %s' % ( + '%s sfdisk --force -D -uS -H 128 -S 32 %s' % ( sudo_args, tmpfile), 'sync', # Since the partitions are mounted, setup_partitions will umount