目前使用dd更新spi flash無法得知進度,找一下網路有說明如何得到進度,整理了解一下
更新記錄
| item | note | 
|---|---|
| 20160613 | 第一版 | 
目錄
busybox dd
- dd只有在完成之後才會顯示結果如下(dd測試)
- 使用kill傳送USR1方式,送訊息給dd,此時dd將會打印訊息
dd測試
| 1 | 61100544 bytes (58.3MB) copied, 119.983701 seconds, 497.3KB/s | 
dd指令說明
| 1 | cx004 :[/test] | 
kill 說明
- pgrep, pkill - look up or signal processes based on name and other attributes
- kill: Sends a signal to a specified process, to all members of a specified process group, or to all processes on the system.- USR1 and USR2 are the two signals that have no attached specific meaning - intended for whatever arbitrary use the developer wants.
 
- kill- ex. kill [-l] [-SIG] PID
 
- killall - ex. killall [-l] [-q] [-SIG] PROCESS_NAME
 
pkill 測試
| pkill parameter | description | 
|---|---|
| -n, –newest | Select only the newest (most recently started) of matching process | 
| -x, –exact | Only match processes whose names ( or command line if -0f is specified ) exactly match the pattern | 
| 1 | pkill -USR1 -n -x dd | 
| 1 | 60407808 bytes (57.6MB) copied, 118.623063 seconds, 497.3KB/s | 
busybox dd 說明
- 要打開(ENABLE_FEATURE_DD_SIGNAL_HANDLING),預設都是有開的- ENABLE_FEATURE_DD_SIGNAL_HANDLING: Enable DD Signal handling for status reporting
 
- dd定義SIGUSR1為dd_output_status
- busybox-1.16.1/coreutils/dd.c
| 1 | int dd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 
- signal_SA_RESTART_empty_mask
| 1 | void FAST_FUNC signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) |