Post
by tonymy01 » Fri Feb 29, 2008 00:11
That is what I am attempting to do now, but I have hit a problem:
This is my rc.local file:
#!/bin/sh
if [ -f "/tmp/mnt/idehdd/.grace" ];then
(cd /tmp/mnt/idehdd/wiz/etc; . ./rc.local2 >/dev/null &)
fi
Essentially this .grace file is created at shutdown, so that if the Wiz doesn't detect it next power up, it means probably the wiz wasn't shutdown properly so it does a disc check. As we have found out, it can't do a disc check with applications running from the mounted partition (hmm, I wonder if we can make, say, a 2G partition on the HDD to have applications etc on.... this seems the most feasible way of putting apps in without fear of filling the flash or RAM with apps that may only be called once). So this simply will not run anything from rc.local2 if there is no grace file. This still doesn't help a user initiated disc check, but helps for the crashed and or power fail situation.
Even if I comment out the if and fi lines, it doesn't seem to want to launch a shell script from rc.local at bootup, but works fine when I run rc.local from a shell.
I am no shell programming expert, so this is annoying me a bit (I of course had the much simpler /tmp/mnt/idehdd/wiz/etc/rc.local2& line in there, but this failed, so thought I would use Eric's syntax for launching Wizremote with . It is like the HDD isn't mounted at this point, but that doesn't make a whole lot of sense because I can launch Wizremote off the HDD the same way!?
I also wanted to add /wiz/bin to the PATH, but this isn't possible from a shell script because the environment variables are only valid for the process they run in, so once rc.local2 terminates (well, and rc.local in the example above) the PATH variable reverts back to default. It would be good if I could easily generate the ROMFS, but last time I tried, the Wiz was basically a brick.... then I would simply edit rc.sysinit to have my extended PATH (I can probably still do that with hex hacking like we did to add the telnet hack in, but would have to delete a few comments out of rc.sysinit to make room...)
I guess the above will fail anyway if the Wiz jumps in and deletes the .grace file before the script gets to run.
Regards
Tony