~aleteoryx/muditaos

ref: d4d0e7ec3487e64649f764c2bbcf5c25cf3c204d muditaos/host-tools/genlittlefs/parse_partitions.h -rw-r--r-- 658 bytes
d4d0e7ec — Tomasz Rybarski [BH-1222] Alarm Bottom Message Translations 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>

typedef int part_type_t;

enum part_type_options
{
    scan_all_partitions = -1
};

struct partition
{
    off_t start;
    off_t end;
    part_type_t type;
};

struct partition *find_partitions(const char *filename, part_type_t ptype, size_t *nelems)
    __attribute__((nonnull(1, 3)));

void print_partitions(const struct partition *part, size_t nparts);

int write_partition_bootunit(const char *filename, int part_num, uint32_t block_size);