Skip to content

Commit a8f128d

Browse files
committed
fix(os-upgrade): stop wget's progress bar from flooding the OS upgrade dialog with a line per redraw
1 parent 33e51f7 commit a8f128d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

www/upgradeOS.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,15 @@ function downloadImage($localFile): bool
137137
UpgradeEchoLog('os-upgrade', $baseFile, "Mirror download failed, falling back to GitHub...\n");
138138
}
139139
}
140-
$command = "sudo wget -c --quiet --show-progress --progress=bar:force:noscroll " . $url . " -O /home/fpp/media/upload/$baseFile 2>&1";
140+
// --progress=dot:giga (not bar:force): the output of this command is
141+
// passthru'd straight into the browser's streamed <pre>, not a terminal.
142+
// The bar style redraws one line via \r, which has nowhere to "redraw" in
143+
// a streamed HTML response -- passthru() just forwards every \r-terminated
144+
// update as more bytes appended to the page, so the dialog fills up with a
145+
// new line per update. dot:giga instead emits real \n-terminated summary
146+
// lines at large (1GB-per-row) intervals, which suits both the streamed
147+
// dialog and an OS-image-sized download.
148+
$command = "sudo wget -c --quiet --show-progress --progress=dot:giga " . $url . " -O /home/fpp/media/upload/$baseFile 2>&1";
141149
$retryCount = 0;
142150
while ($retryCount < 20 && $rc != 0) {
143151
echo "Running command: $command\n";

0 commit comments

Comments
 (0)