|
>>>You need to understand how devices are used in linux, you should be able to do 'cat my_file > /dev/mtd3' which will pipe the contents of my_file into /dev/mtd3, but that is only useful if my_file contains a filesystem image.
Thank you for the help, it really works! But for the full clarification here is an additional info for others.
Latest busybox has the following library tuning option:
config FEATURE_NON_POSIX_CP bool "Non-POSIX, but safer, copying to special nodes" default y help With this option, "cp file symlink" will delete symlink and create a regular file. This does not conform to POSIX, but prevents a symlink attack. Similarly, "cp file device" will not send file's data to the device.
There was no such option in the legacy system's busybox, that's why this worked there. And as I can see from the help message, "cp file /dev/device" is a POSIX-compliant way which was turned off by default in the busybox.
So either cat should be used, or cp with this option turned off.
I just verified both ways. Both work as expected.
|