I can't login into the root in col VF50 sbc after adding a script in /etc/profile.d

I wanted a program to run at start-up so i wrote a script inside /etc/profile.d to execute that binary file.
binary file is getting executed whenever i try to login as root but the cursor stops there as it is running in foreground and if i forcefully quits it using ctrl + c then again login prompt is shown instead of stay logged in.

If i login again same scenario repeats.
I want to login as root and remove that script file which is causing the problem what shall i do?
I am using IRIS carrier board and col VF50 SBC.

Yes, starting something from /etc/profile.d like that is not a good idea even more though if started to run in foreground. Have a look at the following article on our developer website concerning how to start things.

As for how to recover your current system I guess short from completely re-flashing it you could simply force it to boot into a naked shell instead e.g. as follows:

Colibri VFxx # setenv setup 'setenv setupargs console=tty1 console=${console},${
baudrate}n8 ${memargs} consoleblank=0 init=/bin/bash'
Colibri VFxx # run ubiboot
Booting from NAND...
[    3.192230] hub 1-1:1.0: 4 ports detected
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

I tried the above commands i was able to get into the prompt called bash-4.3#
I was also able to go to that folder
But i can’t delete the file it says it is readonly and i can’t modify
if i don’t delete it same problem will occur again
is there any way to delete it i tried chmod to change permission but terminal is not allow to do any modificattion

Now i was able to delete that file from /etc/profile.d I just remounted the file system to rw option
from command

mount -o remount,rw /