autorun.sh for my QNAP server

I needed to do basically rc.local on my QNAP NAS server, since it setups various things at bootup time. Changes to these setups would therefore not persist a reboot. Via QNAP support, I got a link to a page showing how to setup an autorun.sh script as part of the bootup process. This was all splendid, except I couldn't find my device in the list. So, I found this command to probe the system which boot drive I'm on, and from thereon it was easy to find which partition to mount. What I ran was basically this:

[admin@Freya /]# /sbin/hal_app --get_boot_pd port_id=0
/dev/sdg
[admin@Freya /]# mount -t ext2 /dev/sdg6 /tmp/config
[admin@Freya /]# cat /tmp/config/autorun.sh
#!/bin/sh
/share/CACHEDEV1_DATA/homes/admin/bin/autorun.sh &

I made it such that it simply just run an autorun.sh from my normal drive, this way, I don't have to go through these hoops, and modify the flash image constantly when I want to modify change something. Right now my script is pretty limited, but for example, it now allows me to add a "search" domain to my /etc/resolv.conf. Yeah, for some reason, the QNAP OS does not let you add search domain for the resolvers, if you use static IPs (with DHCP, it gets it from the DHCP server, of course).

Hacking: 

Comments

Well this appears to be very

Well this appears to be very helpful! Their wiki was of no help to me for my TS-569 in locating the correct dev node to mount. I take it that what you cat out is what you put in autorun.sh? Since I'm not entirely sure of what I need to mount -- /sbin/hal_app --get_boot_pd port_id=0 returns /dev/sdf for me -- I wasn't sure if I could expect to find a nearly empty autorun.sh in /dev/sdf6 already or is it normal to have to create this file first?

Re: Well this appears to be very

I had no autorun.sh in my confg mount either, it was mostly empty (3-4 files if I recall). And yes, what I cat out is what I put into the autorun.sh, that way, I can modify it easier by having it on a normal drive that's easily accessible at all time. This is what I (now) have in my config partition:

[admin@Freya VMs]# ls -lrt /tmp/config
drwx------    2 admin    administ     12288 Jan 10  2010 lost+found/
-rw-r--r--    1 admin    administ      8016 Dec  1 19:55 uLinux.conf
-rw-r--r--    1 admin    administ        37 Dec  1 20:08 system.map.key
-rw-r--r--    1 admin    administ        11 Dec  1 20:08 smb.conf.cksum
-rw-r--r--    1 admin    administ      8907 Dec  1 20:08 smb.conf
-rwxr-xr-x    1 admin    administ        61 Dec  2 15:47 autorun.sh*