Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bars #229

Open
busterbeam opened this issue Oct 20, 2021 · 4 comments
Open

Progress bars #229

busterbeam opened this issue Oct 20, 2021 · 4 comments

Comments

@busterbeam
Copy link

busterbeam commented Oct 20, 2021

I have quite the thing for progress bars but my C isn't great. put simply I tried this

unsigned long numbytes = fwrite(buf, 1, size, image);

as this

unsigned long numbytes = 0;
	
for (unsigned long i = 0; i < size; i += 1024) {
	buf += 1024;
	numbytes += fwrite(buf, 1, 1024, image);
	printf("\x1B[2K %d %% Complete \r", (int)(((float)i / (float)size) * 100.0f));
	fflush(stdout);
}

I've also added more msg_cinfo functions prior to it to see control flow but after make clean and make It doesn't make a difference!! is there some buffered output issue inside your flashrom binary?? I would appreciate someone breaking down why it just holds on "Reading flash... " and doesn't provide anymore info after that??
EDIT: typo

@busterbeam
Copy link
Author

I can imagine you could add a cmd argument whereby if they want read/write to have a progress bar by doing status=progress and bs={block_size} like dd?

@vinibali
Copy link

vinibali commented Nov 1, 2022

@busterbeam
Copy link
Author

cool @vinibali thanks. I think I did make progress on this a while ago. I do plan to close this issue myself

@vinibali
Copy link

vinibali commented Nov 3, 2022

I'm really looking forward to see your solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants