[Fedora-livecd-list] Development of biarch live CD script.

Jasper Hartline jasper.hartline at gmail.com
Mon Aug 30 08:28:43 UTC 2010


On Sun, Aug 29, 2010 at 7:01 PM, Richard Shaw <hobbes1069 at gmail.com> wrote:
> Yup, same result. Pegs the CPU and does nothing.

Ok. I tracked it down to the second constraint assignment in the
partition() function.
I remember removing it playing with pyparted, but it is in fact neccessary.
Here is the script, try it once again:
http://autopsy.liveprojects.info/scripts/mkbiarch.py

If you look here the two contraint assignments are neccessary.
One sets the contraint for the device end sector, but the next one
sets the filesystem constraint.
Adding the secondary contraint fixes the issue in my testing.
I'll resumbit the patches to put this into git.
Please test though.

    def partition(device):
        dev = parted.Device(path=device)
        disk = parted.freshDisk(dev, 'msdos')
        constraint = parted.Constraint(device=dev)

        new_geom = parted.Geometry(device=dev,
                                   start=1,
                                   end=(constraint.maxSize - 1))
        filesystem = parted.FileSystem(type="ext2",
                                       geometry=new_geom)
        partition = parted.Partition(disk=disk,
                                     fs=filesystem,
                                     type=parted.PARTITION_NORMAL,
                                     geometry=new_geom)
        constraint = parted.Constraint(exactGeom=new_geom)
        partition.setFlag(parted.PARTITION_BOOT)
        disk.addPartition(partition=partition,
                          constraint=constraint)

        disk.commit()


More information about the livecd mailing list