From c33db6315e13de858b6c746e341b7c6043a020ff Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 25 Aug 2017 17:39:52 +0000 Subject: [PATCH] Fix #463: Ignore exit code from parted (#465) Parted often succeeds, but then returns a non-zero exit code, because it can not inform the kernel of the changes. In most cases this is not even necessary, so it really should not fail there. When the error was fatal, pmbootstrap will crash shortly afterwards when it tried to mount or run mkfs on the partition anyway. --- pmb/install/partition.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pmb/install/partition.py b/pmb/install/partition.py index d3670b5e..0fbd5946 100644 --- a/pmb/install/partition.py +++ b/pmb/install/partition.py @@ -59,7 +59,10 @@ def partition(args, size_boot): logging.info("(native) partition /dev/install (boot: " + mb_boot + ", root: the rest)") - # Actual partitioning with 'parted' + # Actual partitioning with 'parted'. Using check=False, because parted + # sometimes "fails to inform the kernel". In case it really failed with + # partitioning, the follow-up mounting/formatting will not work, so it + # will stop there (see #463). commands = [ ["mktable", "msdos"], ["mkpart", "primary", "ext2", "2048s", mb_boot], @@ -68,7 +71,7 @@ def partition(args, size_boot): ] for command in commands: pmb.chroot.root(args, ["parted", "-s", "/dev/install"] + - command) + command, check=False) # Mount new partitions partitions_mount(args)