I am using qemu-arm to run a statically linked binary on an Ubuntu system. There is little to no chance of emulating the entire system.

The binary reads /proc/cmdline as it starts up, to check for a specific parameter concerning MTD partitions. Obviously, my /proc/cmdline does not match.

Is there any easy way to alter the contents of /proc/cmdline for this emulated binary?

1 Answer 1


The typical way to do something like this is to write a small library that intercepts open/read and fakes out the data your program is looking for, and then arrange for that library to be loaded by passing in an LD_PRELOAD environment variable (QEMU's -E option).

It's pretty straightforward; you could adapt the instructions here on emulating NVRAM in QEMU.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.