From 7d39232ac79654db7642ab906f66e9ecd35b51dd Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Wed, 1 Apr 2026 15:25:54 -0700 Subject: [PATCH] fix: partprobe after ESP repartition to prevent stale partition table When the install detects insufficient space on the target ESP and repartitions to 1024MB, the kernel's in-memory partition table wasn't being refreshed. This caused mkfs.vfat to format the old (smaller) partition, leading to "copy failed kernel copy returned -1 bytes" when writing the 258MB kernel. Co-Authored-By: Claude Opus 4.6 (1M context) --- fedac/native/src/ac-native.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fedac/native/src/ac-native.c b/fedac/native/src/ac-native.c index fa3232af0..09bbdbbb1 100644 --- a/fedac/native/src/ac-native.c +++ b/fedac/native/src/ac-native.c @@ -944,6 +944,11 @@ static int auto_install_to_hd(ACGraph *graph, ACFramebuffer *screen, int rrc = system(rcmd); ac_log("[install] sfdisk rc=%d\n", rrc); usleep(500000); + // Force kernel to re-read partition table after repartitioning + snprintf(rcmd, sizeof(rcmd), "partprobe /dev/%s 2>&1 || blockdev --rereadpt /dev/%s 2>&1", + parent_blk, parent_blk); + system(rcmd); + usleep(500000); // Reformat snprintf(rcmd, sizeof(rcmd), "mkfs.vfat -F 32 -n AC-NATIVE %s 2>&1", devpath); rrc = system(rcmd); -- 2.51.2