I am not sure if your script needs to have the extension of .sh to be picked up by the rc daemon
you would also need to put your script.sh in the /etc/init,d directory which is not existent on a factory yocto image
after you set script.sh to an executable with chmod +x /etc/init.d/script.sh then you need to update the rc daemon using
update-rc.d script.sh defaults