Ejemplo n.º 1
0
def generateCramFSImage(expandedPath, imagePath):
    """
    Creates a CramFS based image
    """
    program_exists ('mkfs.cramfs')
    ret = subprocess.call(["mkfs.cramfs", expandedPath, imagePath], stdout=fdnull, stderr=fdnull)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expandedPath)
    except:
        # error handling
        pass

    return True
Ejemplo n.º 2
0
def generate_cramfs_image(expand_path, image_path):
    """
    Creates a CramFS based image
    """
    program_exists('mkfs.cramfs')
    cmd = ["mkfs.cramfs", expand_path, image_path]
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        # error handling
        pass

    return True
Ejemplo n.º 3
0
def generate_cramfs_image(expand_path, image_path):
    """
    Creates a CramFS based image
    """
    program_exists('mkfs.cramfs')
    cmd = ["mkfs.cramfs", expand_path, image_path]
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        # error handling
        pass

    return True
Ejemplo n.º 4
0
def generate_squashfs_image(expand_path, image_path):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    ret = subprocess.call(["mksquashfs", expand_path, image_path, "-all-root"])
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        pass

    return True
Ejemplo n.º 5
0
def generate_squashfs_image(expand_path, image_path):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    ret = subprocess.call(["mksquashfs", expand_path, image_path, "-all-root"])
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        pass

    return True
Ejemplo n.º 6
0
def generate_cramfs_image(expand_path, image_path, options):
    """
    Creates a CramFS based image
    """
    program_exists('mkfs.cramfs')
    cmd = ["mkfs.cramfs", expand_path, image_path]
    if options is not None:
        cmd.extend(options)
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        rmtree(expand_path)
    except:
        # error handling
        pass

    return True
Ejemplo n.º 7
0
def generate_squashfs_image(expand_path, image_path, options):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    cmd = ["mksquashfs", expand_path, image_path, "-all-root"]

    if options is not None:
        cmd.extend(options)
    else:
        cmd.append('-no-xattrs')
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        pass

    return True
Ejemplo n.º 8
0
def generate_squashfs_image(expand_path, image_path, options):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    cmd = ["mksquashfs", expand_path, image_path, "-all-root"]

    if options is not None:
        cmd.extend(options)
    else:
        cmd.append('-no-xattrs')
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        rmtree(expand_path)
    except:
        pass

    return True