pmbootstrap: run partprobe after repartitioning (MR 2473)

On some kernels (notably, WSL2) parted fails to inform the kernel
about the new partition layout, leading to errors when trying to
create the new filesystems.

This change runs an additional `partprobe` after updating the
partition table, informing the kernel about the new layout.

Fixes: #2422
Signed-off-by: Dominik Bayerl <dominik.bayerl@carissma.eu>
[caleb: move call so it runs after partition_cgpt() as well]
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Dominik Bayerl 2024-11-02 17:55:54 +01:00 committed by Caleb Connolly
parent 39235fedfb
commit 87515529cf
No known key found for this signature in database
GPG key ID: 0583312B195F64B6

View file

@ -868,6 +868,10 @@ def install_system_image(
pmb.install.partition_cgpt(layout, size_boot, size_reserve)
else:
pmb.install.partition(layout, size_boot, size_reserve)
# Inform kernel about changed partition table in case parted couldn't
pmb.chroot.root(["partprobe", "/dev/install"], check=False)
if not split:
pmb.install.partitions_mount(device, layout, disk)