Hello!
I am using OpenWRT on a device with a local monitor.
May anyone point me please to a tutorial or give an advice how can I force to boot OpenWRT machine directly to shell?
In my case the welcome screen appears only if I press any key on the keyboard.
My main goal is to drop to shell and hopefully run a program automatically.
If I try to add the command to start my program ( "/root/my_program" ) in the respective LUCI web- interface section, nothing happens. When I log-in and start the program manually it runs perfect.
But
I need to have a keyboard attached to push any button so the shell appears,
I need the same keyboard to press "/root/my_program" to start it
The boot (and shutdown) sequence is controlled from the "/etc/inittab" configuration file. The login prompt that you see on the console belongs to the "askconsole" entry, and is executed from the "/usr/libexec/login.sh" script.
Thank you!
This is where I am now. I found this files and tried to play with them. Please kindly see what I have done, I have changed /etc/inittab and now it is like this:
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
::sysinit:/usr/libexec/login.sh
tty1::sysinit:/usr/libexec/login.sh
But now the shell not appearing at all
May you please point on my mistake?
(Maybe I can put my program here, by the way?)
I have also played with the /usr/libexec/login.sh Please have a look and point kindly where should I put my program:
Wow! Now my program runs after I hit Enter. Not showing the shell, which is good.
But maybe someone could please point me to a fine tuning of this askconsole and askfirst methods, so my program (script) will start right after boot without need to hit Enter? I guess, there should be some alternative to them?
If you just want a program to run once automatically upon boot, call it from /etc/rc.local. Since it won't be running in the login tty, you won't see its output on the attached monitor, but you can use calls to logger or wall to make it visible.
If you have a program that you want to start up upon boot and keep running, write a service controller for it in /etc/init.d. Use one of the existing services as an example.
Thank you,
As soon as you did not posted any human-readable sentence, I believe you understood the question and gave the best reply.
I will give it a try.