diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-09-17 13:01:11 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-09-21 15:30:31 +0200 |
commit | da7dfd8ef5bc055a9e723807c38de4b3c407387d (patch) | |
tree | 61c05eb533b06a1092c53d5d577f29e536a4d694 /tools/list-discoverable-partitions.py | |
parent | man/systemd-gpt-auto-generator: reword phrasing about partition location (diff) | |
download | systemd-da7dfd8ef5bc055a9e723807c38de4b3c407387d.tar.xz systemd-da7dfd8ef5bc055a9e723807c38de4b3c407387d.zip |
docs/DPS: use the SD_GPT_* constants here too
Diffstat (limited to '')
-rw-r--r-- | tools/list-discoverable-partitions.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/list-discoverable-partitions.py b/tools/list-discoverable-partitions.py index 43d7ee9984..153c904774 100644 --- a/tools/list-discoverable-partitions.py +++ b/tools/list-discoverable-partitions.py @@ -146,6 +146,7 @@ def extract(file): if not m: continue + name = line.split()[1] if m2 := re.match(r'^(ROOT|USR)_([A-Z0-9]+|X86_64|PPC64_LE|MIPS_LE|MIPS64_LE)(|_VERITY|_VERITY_SIG)\s+SD_ID128_MAKE\((.*)\)', m.group(1)): type, arch, suffix, u = m2.groups() u = uuid.UUID(u.replace(',', '')) @@ -153,12 +154,12 @@ def extract(file): type = f'{type}{suffix}' assert type in TYPES - yield type, arch, u + yield name, type, arch, u elif m2 := re.match(r'(\w+)\s+SD_ID128_MAKE\((.*)\)', m.group(1)): type, u = m2.groups() u = uuid.UUID(u.replace(',', '')) - yield type, None, u + yield name, type, None, u else: raise Exception(f'Failed to match: {m.group(1)}') @@ -170,7 +171,7 @@ def generate(defines): uuids = set() - for type, arch, uuid in defines: + for name, type, arch, uuid in defines: tdesc = TYPES[type] adesc = '' if arch is None else f' ({ARCHITECTURES[arch]})' @@ -184,7 +185,7 @@ def generate(defines): else: morea = moreb = 'ditto' - print(f'| _{tdesc}{adesc}_ | `{uuid}` | {morea} | {moreb} |') + print(f'| _{tdesc}{adesc}_ | `{uuid}` `{name}` | {morea} | {moreb} |') if __name__ == '__main__': known = extract(sys.stdin) |