Exemplo n.º 1
0
def get_volumes(blocks, layout_info):
    volumes = {}
    vol_blocks_lists = sort.by_vol_id(blocks, layout_info[2])
    for vol_rec in blocks[layout_info[0]].vtbl_recs:
        vol_name = vol_rec.name.strip('\x00')
        if vol_rec.rec_index not in vol_blocks_lists:
            vol_blocks_lists[vol_rec.rec_index] = []
        volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index])

    return volumes
Exemplo n.º 2
0
def get_volumes(blocks, layout_info):
    volumes = {}
    vol_blocks_lists = sort.by_vol_id(blocks, layout_info[2])
    for vol_rec in blocks[layout_info[0]].vtbl_recs:
        vol_name = vol_rec.name.strip('\x00')
        if vol_rec.rec_index not in vol_blocks_lists:
            vol_blocks_lists[vol_rec.rec_index] = []
        volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index])

    return volumes
Exemplo n.º 3
0
def get_volumes(blocks, layout_info):
    """Get a list of UBI volume objects from list of blocks

    Arguments:
    List:blocks            -- List of layout block objects
    List:layout_info    -- Layout info (indexes of layout blocks and
                                        associated data blocks.)

    Returns:
    Dict -- Of Volume objects by volume name, including any
            relevant blocks.
    """
    volumes = {}

    #data_blocks_list = sort.by_range(blocks, layout_info[2])
    vol_blocks_lists = sort.by_vol_id(blocks, layout_info[2])

    for vol_rec in blocks[layout_info[0]].vtbl_recs:
        vol_name = vol_rec.name.strip('\x00')
        volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index])
            
    return volumes
def get_volumes(blocks, layout_info):
    """Get a list of UBI volume objects from list of blocks

    Arguments:
    List:blocks            -- List of layout block objects
    List:layout_info    -- Layout info (indexes of layout blocks and
                                        associated data blocks.)

    Returns:
    Dict -- Of Volume objects by volume name, including any
            relevant blocks.
    """
    volumes = {}

    vol_blocks_lists = sort.by_vol_id(blocks, layout_info[2])

    for vol_rec in blocks[layout_info[0]].vtbl_recs:
        vol_name = vol_rec.name.strip('\x00')
        if vol_rec.rec_index not in vol_blocks_lists:
            vol_blocks_lists[vol_rec.rec_index] = []
        volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index])
            
    return volumes