Some special commands for linux embedded devices

Published on Friday, December 31, 2010

There are some embedded devices or products in the market which are using Linux. They need some special Linux commands, Here we list part of them, and maybe we will keep on update them if we find more:

1: copy file to Plug and Play device:

 cp /usr/local/bin/scripts/menu.rss /tmp/usbmounts/sdb1/

copy menu.rss to a USB drive

2: copy all folder content to another folder:

 cp -r /usr/local/bin/scripts /usr/local/etc/scripts

In some case you can not modify files under some Read-Only folder such as if your file system is SQUASHFS format. then you have to copy Read-Only folder to a writable folder, then later you can mount them.

3: Mount file or device:

 mount -o bind /usr/local/etc/scripts /usr/local/bin/scripts

copy the file to some place editable (/usr/local/etc) then after you are done with the edits, overmount the original file.

mount --bind /usr/local/etc/modified_file /original_file_path/original_file

Once tested and found running fine just add the overmount command to you /usr/local/etc/rcS startup script.