Strange boot process. rcS is *much* shorter than I expected, and the contents I expected there is in profile. I think some shell is started (maybe on the serial port?), and this shell executing the profile script brings up the firmware.
Didn't work... But atleast it booted without a bootloop
OK, I guess this proves that the return value of one of the AutoexecCmd commands is evaluated, and the box reboots on an error.
/sbin/hotplug-usb.sh looks promising. When I read it well, the script runs to the end when an usb device is inserted. If the rootfs is writable (any idea?), you could add a line:
[ -e /mnt/usb1_1/myscript.sh ] && sh /mnt/usb1_1/myscript.sh
I *think* that should be done this way:
echo "[ -e /mnt/usb1_1/myscript.sh ] && sh /mnt/usb1_1/myscript.sh" \\>\\> /sbin/hotplug-usb.sh
The > has to be escaped by a \ because it else would close the XML key, and the \ has to be escaped because the data is preprocessed.
What worries me tho is that I may brick the device using this .sh script as it says through resets...
The return value of that script is not evaluated, and the script runs in it's own command processor, so you can't crash rcS. What can go wrong is:
You somehow reboot the box in user_startup_parameters.sh. (Calling 'reboot' is the easiest way to do so)
You start a process which consumes all cpu cycles or memory, rendering the box useless.
Your script never exits, which means rcS never exits either. That means ln -s /customer /mnt/customer is never executed, but maybe also that shell invoking profile is never started.
On my P2812HNU I used this script to add a hotplug script which executes a script on an usb stick, if exists. So if I somehow bork it up, I can simply pull the stick.
Strange, doesn't seem USB is ready at when config loads.. So I can't actually use it to cat things out...
That's not strange at all. Why would the usb device be mounted before the init script is executed?
But it is strange that you can create a directory on the stick, but not a file. Maybe the stick is mounted, but you have to add some escapes in your command, to get it through the XML parser?