summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdin Taric <unicorn@regrow.earth>2022-11-17 12:35:40 +0100
committerEdin Taric <unicorn@regrow.earth>2022-11-17 12:35:40 +0100
commit16ddae9c5496d5f906b3c0bb14fefd2eb2cfb501 (patch)
treed58691b6fccb5b257dc79010e41622a729e7d9ea
parent1b5c6d088673ed6813f9f0e59bd1bb9101b84d51 (diff)
downloadalpine-conf-16ddae9c5496d5f906b3c0bb14fefd2eb2cfb501.zip
setup-disk: fix partitioning failure
Previously, setup-disk could fail when installing over an existing identical partition table. The additions ensure that a clean disklabel is created and existing partitions are wiped. Signed-off-by: Edin Taric <unicorn@regrow.earth>
-rw-r--r--setup-disk.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/setup-disk.in b/setup-disk.in
index 0300ab7..30d0258 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -878,6 +878,9 @@ setup_partitions() {
shift
supported_part_label "$DISKLABEL" || return 1
+ # create clean disk label
+ echo "label: $DISKLABEL" | sfdisk --quiet $diskdev
+
# initialize MBR for syslinux only
if [ "$BOOTLOADER" = "syslinux" ] && [ -f "$MBR" ]; then
cat "$MBR" > $diskdev
@@ -891,7 +894,7 @@ setup_partitions() {
*) echo "$start,$line"; start= ;;
esac
done
- ) | sfdisk --quiet --label $DISKLABEL $diskdev || return 1
+ ) | sfdisk --quiet --wipe-partitions always --label $DISKLABEL $diskdev || return 1
# create device nodes if not exist
$MOCK mdev -s