uncultured-banner-moon
Back to "Geek Adventures"

New Commands on a Reluctant System

I was working on an embedded Linux system. In production, the filesystem is mounted from the local flash drive. Since flash is expensive, it's a very small drive, with *very* basic functionality. The developers have it set up so they can boot an NFS (network) filesystem instead. This gives them access to all the Linux tools they could want.

One day I ran across a bug, which left the embedded system in a bad state. The developers knew they could just run lsof to find the problem, but it was booted in flash mode, so they didn't have lsof available. Now, we're a crafty bunch, but the very limited tools didn't even allow us to pull down and run a new program.

The flash filesystem had a tftp client. We could download whatever we wanted. But the files would be created without execute permissions, so we couldn't run them. There was no chmod command to enable execute permissions. We set the umask, but it had no effect on the tftp client.

After I gave up and rebooted the system, I came up with the answer. I simply downloaded the file with tftp, and cat'ed the file to an unused executable.

	tftp get lsof someserver
	cat lsof > /bin/ping
	/bin/ping

And the results of lsof pour forth from the ping command.  :-)


Back to "Geek Adventures"