Skip to content

Commit fcb9bd7

Browse files
committed
Fix partition resize on Pi
1 parent c78c8e8 commit fcb9bd7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/boot/FPPINIT.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,9 @@ static bool checkUnpartitionedSpace() {
833833
TrimWhiteSpace(rootPart);
834834
if (startsWith(rootPart, SD_CARD_DEVICE)) {
835835
std::string lastPartNum = execAndReturn("/usr/sbin/parted " + SD_CARD_DEVICE + " -ms unit s p | tail -n 1 | cut -f 1 -d:");
836+
TrimWhiteSpace(lastPartNum);
836837
std::string startPos = execAndReturn("/usr/sbin/parted " + SD_CARD_DEVICE + " -ms unit s p | grep \"^" + lastPartNum + "\" | cut -f 2 -d: | sed 's/[^0-9]//g'");
838+
TrimWhiteSpace(startPos);
837839
std::string fdiskInstructions = "p\nd\n" + lastPartNum + "\nn\np\n" + lastPartNum + "\n" + startPos + "\n\np\nw\n";
838840
PutFileContents("/tmp/fdisk.cmds", fdiskInstructions);
839841
exec("/usr/sbin/fdisk " + SD_CARD_DEVICE + " < /tmp/fdisk.cmds");

0 commit comments

Comments
 (0)