No login in uClinux (Petalinux)

Is there some method to avoid "login prompt"?. The reason is that I have designed an application over uClinux and I want that this app run without introducing any information. Could I edit some inittab file?

Thanks

Reply to
Pablo
Loading thread data ...

Hi Pablo,

there are several ways, depending on what your root file system and init procedure is like.

I'm guessing you are using a initrd (RAM/ROM) file system. In this case, the first thing the kernel does is executing /linuxrc

Now, /linuxrc can be a shell script or a link to an executable, typically /sbin/init

To answer your question, simply create a link from your application to /linuxrc and your application is the first thing to run after boot.

However, there are a few things to think about. If you run an application from a shell, the shell will have set up some environmental variable, command line options, and so on. If you run your application directly, this won't be the case.

If you find that your application doesn't like it, you can always change /linuxrc into a shell script and launch your application from there.

Another option is, as you said, edit /etc/inittab. /etc/inittab is read by /sbin/init. You can place your application in this file, instead of the getty which is normally used. This would have the advantage that you can respawn your application, in case it exits or crashes.

Kind regards,

Iwo

Reply to
Iwo Mergler

If you have a dedicated application and do not need the bulk of CLI tools, one small, fast, easy solution is to have the application be the "init" process, or to have /bin/sh be the init process and stick the startup scriping in the shell startup scripts. Do this either by replacing the init binary, or using the kernel boot arg overrides init.

This is also a usable "back door" for lost root passwords on most Linux systems booted with Lilo/Grub which allow editing the kernel arguments at boot time.

Reply to
fpga_toys

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.