I just uploaded a ~7 Kb firmware file to a BusyBox based Linux embedded system over the serial port.
No networking, no file transfer utilities; no Base64 utils or anything remotely useful on the device.
On the host, I trivially encoded a firmware into the following format; a kind of hex-dump consisting of shell literals combined with printf commands:
printf "\xDE\xAD\xBE\xEF\x...\xF0"
printf "\xCA\xFE\x33\xE1\x...\xD3"
basically shell printf commands with \x escape sequences that printf interprets. On the device I did:
device $ cat > firmware.sh
then used the minicom's ASCII file send (Ctrl-AS) to send this file to the host. I could just have used copy and paste, since the amount of data is small.
Then, marked executable and ran the printf script:
device $ chmod a+x firmware.sh
device $ ./firmware.sh > firmware.bin
Checked using BusyBox's md5sum that the firmware.bin checksum on the device matches the original firmware image on the host.
P.S. The shell double quote syntax passes through \x verbatim because it's not a recognized escape sequence; hence we don't have to double up the backslashes.
busybox --helpandls -l /binandls -l /usr/bin, please. – jofel Dec 04 '14 at 13:00