Upgrading software on Linux / Android boards or devices often involves copying images to an SD card or microSD. In Linux, you’d usually do that with dd, a utility that provides binary copy of data to files or block devices. A typical command would be:
1 |
sudo dd if=new_firmware.bin of=/dev/sdc |
However, during the copy, dd does not show a progress bar by default. But dd actually supports progress report, as indicated in the manpage: you can run dd, and send USR1 signal to display the current progress once, and resume copying. Linux commando explains how to continuously return the progress. First run the dd command:
1 |
sudo dd if=/dev/random of=/dev/null bs=1K count=100 |
Open another terminal window to find out the process id:
1 2 |
pgrep -l '^dd$' 10152 dd |
And use the watch command to send USR1 at regular interval.
1 |
watch -n 10 sudo kill -USR1 10152 |
You should see dd progress in the first window every 10 seconds. It works, but the output is not very nice because dd will just […]