]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
disk: Set PARTITION_ESP if unset
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Dec 2021 10:47:53 +0000 (10:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Dec 2021 10:47:53 +0000 (10:47 +0000)
On Debian Bullseye which I have been using for developing Bricklayer,
PARTITION_ESP is suddenly non-existant.

parted still knows this parameter which is why we try to set this
manually as a fallback.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/disk.py

index aea063aa37f3ca17d4f756507c50c188f3714cbc..f56fe4089db13104fe8238f12289b6f421c471d5 100644 (file)
@@ -33,6 +33,12 @@ log = logging.getLogger("bricklayer.disk")
 
 DEFAULT_FILESYSTEM = "btrfs"
 
+# Check if parted.PARTITION_ESP is set
+try:
+       parted.PARTITION_ESP
+except AttributeError:
+       parted.PARTITION_ESP = 18
+
 class Disks(object):
        """
                Disks abstraction class