Open the Digi Embedded Linux ESP, goto help - help contents and search for touch.
There are sections which do explain which options you have to enable in the kernel to have appropriate driver and device files created.
Also section 14.3 Qt touch screen devices explains how /etc/profile.d/touchscreen.sh is working.
It might be that /dev/input/ts0 does not exist.
So try also /dev/input/event0 or /dev/input/event1 in /etc/profile.d/touchscreen.sh script.