summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-09-15 17:57:24 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-09-20 16:48:50 +0200
commit974fcc916c9b391d987fa723cd90c7320011e492 (patch)
treea70084e24eeafea87aa0f39e1341f0ad0a704730 /tools
parent92e720281250aab9cd2728964c9d38d93b5b2013 (diff)
downloadsystemd-974fcc916c9b391d987fa723cd90c7320011e492.tar.gz
tools/list-discoverable-partitions: make the script work again
Diffstat (limited to 'tools')
-rw-r--r--tools/list-discoverable-partitions.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/list-discoverable-partitions.py b/tools/list-discoverable-partitions.py
index 37ccd27302..43d7ee9984 100644
--- a/tools/list-discoverable-partitions.py
+++ b/tools/list-discoverable-partitions.py
@@ -19,6 +19,7 @@ ARCHITECTURES = {
'LOONGARCH64': 'LoongArch 64-bit',
'MIPS_LE': '32-bit MIPS LittleEndian (mipsel)',
'MIPS64_LE': '64-bit MIPS LittleEndian (mips64el)',
+ 'PARISC': 'HPPA/PARISC',
'PPC': '32-bit PowerPC',
'PPC64': '64-bit PowerPC BigEndian',
'PPC64_LE': '64-bit PowerPC LittleEndian',
@@ -54,7 +55,7 @@ DESCRIPTIONS = {
'ROOT': (
'Any native, optionally in LUKS',
'On systems with matching architecture, the first partition with this type UUID on the disk '
- 'containing the active EFI ESP is automatically mounted to the root directory <tt>/</tt>. '
+ 'containing the active EFI ESP is automatically mounted to the root directory `/`. '
'If the partition is encrypted with LUKS or has dm-verity integrity data (see below), the '
'device mapper file will be named `/dev/mapper/root`.'),
'USR': (
@@ -87,8 +88,8 @@ DESCRIPTIONS = {
'XBOOTLDR': (
'Typically VFAT',
'The Extended Boot Loader Partition (XBOOTLDR) used for the current boot is automatically '
- 'mounted to <tt>/boot/</tt>, unless a different partition is mounted there (possibly via '
- '<tt>/etc/fstab</tt>) or the directory is non-empty on the root disk. This partition type '
+ 'mounted to `/boot/`, unless a different partition is mounted there (possibly via '
+ '`/etc/fstab`) or the directory is non-empty on the root disk. This partition type '
'is defined by the [Boot Loader Specification](https://systemd.io/BOOT_LOADER_SPECIFICATION).'),
'SWAP': (
'Swap, optionally in LUKS',
@@ -123,7 +124,7 @@ DESCRIPTIONS = {
'automatically mounted to `/var/tmp/`. If the partition is encrypted with LUKS, the '
'device mapper file will be named `/dev/mapper/tmp`. Note that the intended mount point '
'is indeed `/var/tmp/`, not `/tmp/`. The latter is typically maintained in memory via '
- '<tt>tmpfs</tt> and does not require a partition on disk. In some cases it might be '
+ '`tmpfs` and does not require a partition on disk. In some cases it might be '
'desirable to make `/tmp/` persistent too, in which case it is recommended to make it '
'a symlink or bind mount to `/var/tmp/`, thus not requiring its own partition type UUID.'),
'USER_HOME': (
@@ -134,22 +135,21 @@ DESCRIPTIONS = {
'Any native, optionally in LUKS',
'No automatic mounting takes place for other Linux data partitions. This partition type '
'should be used for all partitions that carry Linux file systems. The installer needs '
- 'to mount them explicitly via entries in <tt>/etc/fstab</tt>. Optionally, these '
- 'partitions may be encrypted with LUKS. This partition type predates the Discoverable '
- 'Partitions Specification.'),
+ 'to mount them explicitly via entries in `/etc/fstab`. Optionally, these partitions may '
+ 'be encrypted with LUKS. This partition type predates the Discoverable Partitions Specification.'),
}
def extract(file):
for line in file:
# print(line)
- m = re.match(r'^#define\s+GPT_(.*SD_ID128_MAKE\(.*\))', line)
+ m = re.match(r'^#define\s+SD_GPT_(.*SD_ID128_MAKE\(.*\))', line)
if not m:
continue
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(',', ''))
- assert arch in ARCHITECTURES
+ assert arch in ARCHITECTURES, f'{arch} not in f{ARCHITECTURES}'
type = f'{type}{suffix}'
assert type in TYPES