~lool/linaro-image-tools/temp-tarball

« back to all changes in this revision

Viewing changes to linaro_media_create/partitions.py

  • Committer: Guilherme Salgado
  • Date: 2011-01-24 19:39:45 UTC
  • mfrom: (253.1.1 bug-705410)
  • Revision ID: salgado@canonical.com-20110124193945-nhipnebvisyfmltp
Make sure we create an extra (non-Data) partition for mx51evk boards

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
                        as_root=True, stderr=None):
253
253
    """Run the given commands under sfdisk.
254
254
 
 
255
    Every time sfdisk is invoked it will repartition the device so to create
 
256
    multiple partitions you should craft a list of newline-separated commands
 
257
    to be executed in a single sfdisk run.
 
258
 
255
259
    :param commands: A string of sfdisk commands; each on a separate line.
256
260
    :return: A 2-tuple containing the subprocess' stdout and stderr.
257
261
    """
292
296
    else:
293
297
        partition_type = '0x0E'
294
298
 
 
299
    sfdisk_cmd = ',9,%s,*\n,,,-' % partition_type
295
300
    if board == 'mx51evk':
296
301
        # Create a one cylinder partition for fixed-offset bootloader data at
297
302
        # the beginning of the image (size is one cylinder, so 8224768 bytes
298
303
        # with the first sector for MBR).
299
 
        run_sfdisk_commands(',1,0xDA', heads, sectors, cylinders, media.path)
 
304
        sfdisk_cmd = ',1,0xDA\n%s' % sfdisk_cmd
300
305
 
301
306
    # Create a VFAT or FAT16 partition of 9 cylinders (74027520 bytes, ~70
302
307
    # MiB), followed by a Linux-type partition containing the rest of the free
303
308
    # space.
304
 
    sfdisk_cmd = ',9,%s,*\n,,,-' % partition_type
305
309
    run_sfdisk_commands(sfdisk_cmd, heads, sectors, cylinders, media.path)
306
310
 
307
311
    # Sync and sleep to wait for the partition to settle.