GNU Screen and Xmodem!

How many terms are incompatible with Google? screen (the gnu screen program) is one of them unfortunately.

How often have you found yourself needing to upload an IOS to a dead router or switch? And how often do you have to do this on a Linux or Mac based machine?

Well, here is how to use sx from the lrzsz package and gnu screen. Firstly, connect your console to screen with a command like so:

screen /dev/tty.usbserial 115200

Then begin your xmodem transfer and follow up with some fancy screen commanding

^a :exec !! sx -kb Downloads/newfirmware.bin

That is control-a and then type, without the quotes, “:exec !! sx -kb path/to/firmware.bin”

Genius! Unfortunately, sx doesn’t really come stock with my particular flavor of OS so some package manager digging was in order.

Advertisements