On startup TS-I300 will run /etc/rc.sh which will mount the various filesystems and initialize the drive.
... touch /tmp/boot_finished /usr/sbin/chk_fun_plug &
/usr/sbin/chk_fun_plug will check for file called fun_plug on the disks root and then executes it.
#!/bin/sh sleep 30 Dir_Len=28 Filename_Len=26 CUSTOMIZEHDPATH=/sys/custom/shared_name/HD file=$(find "$CUSTOMIZEHDPATH"/*) HD_Path=`expr substr "$file" "$Dir_Len" "$Filename_Len"` HD_Path=$HD_Path"a2" if [ -e /mnt/$HD_Path/fun_plug ]; then echo "function plug enable" /mnt/$HD_Path/fun_plug fi
There are 5 ways to setup a working fun_plug file:
fdisk /dev/hdx or fdisk /dev/sdx if you have SATA or USB hard drive. The x is your hard drive position, for example Primary Master is a, Primary Slave is b, Secondary Master is c and Secondary Slave is d. SATA and USB hard drives are most cases a.np1Enter key+512Mnp2Enter keyEnter key if you want to make only one ext3 partition. If you are not sure what to do then you should press Enter key. But if you want to make one or more extra partitions then you must figure out how you are going to spread your drive space between all those partitions you are going to make. For example if you want to store most of your files to FAT32 partition then you should enter +100M to make 100MB ext3 partition.n then p after that 3 and now Enter key and Enter key to one more time.T182T then 3 and then cp, if it looks good then press w to write changes to hard disk. If you think something went wrong then press q and start again, starting with step 3.mkswap /dev/hdx1mke2fs -j /dev/hdx2mkdosfs /dev/hdx3mkdir /mnt/TSI300disk || mount /dev/hdx2 /mnt/TSI300disktouch /mnt/TSI300disk/fun_plugchmod 777 /mnt/TSI300disk/fun_plugls -la /mnt/TSI300disk/fun_plug to make sure that we did it correctly. You should see -rwxrwxrwx 1 root root 0 some-date-and-time /mnt/TSI300disk/fun_plug
umount /mnt/TSI300disk command.mkdir /mnt/TSI300disk || mount /dev/hdx2 /mnt/TSI300disk. The x is your hard drive position, for example Primary Master is a, Primary Slave is b, Secondary Master is c and Secondary Slave is d. SATA and USB hard drives are most cases a.touch /mnt/TSI300disk/fun_plugchmod 777 /mnt/TSI300disk/fun_plugls -la /mnt/TSI300disk/fun_plug to make sure that we made it correctly. You should see -rwxrwxrwx 1 root root 0 some-date-and-time /mnt/TSI300disk/fun_plug
umount /mnt/TSI300disk command.mount -t smbfs -o username=admin //<insert TS-I300 IP here>/HDD_a /mnt/somedirtouch /mnt/somedir/fun_plug and chmod 777 /mnt/somedir/fun_plugumount /mnt/somedir and reboot your TS-I300.
and your done. You may edit the fun_plug via samba (windows share) from now on, the permissions will stick.
Windows users should note that the fun_plug file must be in unix file format (LF for newline) and not in Windows (CR LF for newline). One suggested editor for Windows is UltraEdit which let you save the file in both formats.
To test out if fun_plug works, you can simply add following lines to your fun_plug and reboot.
#!/bin/sh dmesg > /mnt/HD_a2/dmesg.out
After boot up you should see dmesg.out file at the root of your TS-I300 hard disk.
If you have not familiarly with Unix shell scripting then I suggest you to read some docs about it.