failure to write image to emmc via Ethernet connection
KE8SOJ opened this issue · 0 comments
KE8SOJ commented
I encountered this error when attempting to write an image to a VIM3 which was built using the Manjaro buildarmimg tool and prepared with khadas-rescue-tools.
curl -v http://10.0.10.16/shell/write | sh -s - VIM3.Manjaro-ARM-sway-vim3-doombaby.img.xz
* Trying 10.0.10.16:80...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 10.0.10.16 (10.0.10.16) port 80 (#0)
> GET /shell/write HTTP/1.1
> Host: 10.0.10.16
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Keep-Alive: timeout=20
< Date: Thu, 01 Jan 1970 01:47:13 GMT
< Cache-Control: no-cache,no-store,max-age=0,must-revalidate
< Content-type: application/octet-stream
< Pragma: no-cache
< Expires: 0
< Connection: close
<
{ [1236 bytes data]
100 1649 0 1649 0 0 41437 0 --:--:-- --:--:-- --:--:-- 42282
* Closing connection 0
[i] VIM3.Manjaro-ARM-sway-vim3-doombaby.img.xz (.xz) write => 10.0.10.16 // mmc
curl: option --data-binary: out of memory
curl: try 'curl --help' for more information
head: cannot open '/tmp/kwrite_http.862834.log' for reading: No such file or directory
The suggested solution I found to the curl: option --data-binary: out of memory issue is to pass the "-T " option to curl. Once I modified the curl option in /www/tools/kwrite I was able to write the image to emmc over Ethernet.
LOG=/tmp/kwrite_http.$$.log
[ "$IN" ] && {
echo "[i] $IN ($ext) write => $krescue // $DST">&2
#curl --data-binary @"$IN" \
curl -T "$IN" \
-o $LOG \
$krescue/api/disk/write/$DST$ext
head -n20 $LOG
}
BTW thank you for developing this awesome tool!