customize start sequence

We hope to boot up the jeston tx1 board as root user by default and instead of entering the ubuntu desktop, starting our openGL applications that communicate with each other through the xserver.

How could we do so?

I have not done the rest, but if you want to login directly as root without using sudo, then you’d unlock the root account. Here’s a summary of that:

  1. Assign a password to root under user ubuntu: ``` sudo password root ```
  2. Unlock the account: ``` sudo passwd -u root ```

Just in case you are interested in locking this back, this would re-lock:

sudo passwd -d -l root

I can’t answer the rest, but you will want to think about whether you want the application to run without all of the windowing environment, or if you want a full login environment (the whole desktop), but with the OpenGL app running.

In the latter case each desktop manager has its own autostart mechanism (lots of information is available on the internet for Ubuntu GUI features and setup of autostart).

In the former case you would be altering the X server’s startup arguments to change what X runs. By default most X servers are called with a login manager as the argument of what to run. Common login managers are GDM (Gnome Desktop Manager) and KDM (KDE Desktop Manager)…in the case of Ubuntu it seems to be lightdm desktop manager/login manager and Unity as the window manager. The display manger (login manager, e.g., lightdm) is the X11 client named as an argument to X which allows picking which user to log in as (my R24.2.1 seems to autologin, but if you “log out” without rebooting or shutting down, then you’ll get to a GUI which gives available user names to log in as and a password field. When you enter the user and password, it restarts X with the desktop manager as an argument instead of the Display Manager/Login Manager. X is just a normal program which runs another program as its argument. Your job would be to set up X to call your OpenGL app as an argument instead of the login manager or desktop windowing manager.

Most of that config for what X starts with is in “/etc/X11/”. In particular X has an “xinit” subdirectory which scripts bringing up X. I think it starts with the “/etc/X11/xinit/xinitrc”. This would be where you’d start looking on modifying X’s startup behavior. Perhaps it would be as simple as replacing the Xsession line with your OpenGL app name using arguments to specify screen resolution and such (with no window/desktop manager automatic sizing and placement no longer exists).

One thing which may be subtle and might be useful to know is that X always starts running as root. Any application you start as an argument to X would normally run as root. The login manager itself runs as root, and the restart of X after entering a user password switches to the particular user because the login manager itself calls for the restart of X as that user name. It is possible that if you only want your one application to run, then perhaps you do not even need to unlock the root account.

Perhaps not as useful, but related to this, all console sessions and X11 itself (X is a session just like a console session, but it is GUI instead of pure text mode) start with getty (“man getty” or “man agetty”). Adjusting getty would adjust which key bindings bring up a console login or bring up X. Technically you could replace the default setup with a single X login and multiple consoles with multiple X logins…more than one independent X server could run at once with key bindings alternating between them the way you might alternate between multiple text consoles. Perhaps you might be interested in figuring out this mechanism for testing purposes (you could figure out how to make “control-alt-F2” call X directly with the OpenGL application and still have normal login on “control-alt-F7”…or you could eliminate all local logins except for the key binding to the GUI).

getty/agetty spawns login sessions depending on key bindings (ctrl-alt-F1 through ctrl-alt-F7 is getty/agetty responding to key binding events) and is also completely configurable. The configuration in “/etc/X11” could even be skipped if getty on ctrl-alt-F7 were modified to tell X to start with alternate config. This may matter to you because any package updates changing “/etc/X11” may destroy your customization if you intervene in “/etc/X11”, but would instead be immune to such changes if getty starts your terminal directly without going through “/etc/X11”.

Summary: You can modify existing X through “/etc/X11”. You can add and remove text/GUI sessions available through key bindings normally used to alternate between text mode and GUI. If you add or replace a getty/agetty session then you can completely skip “/etc/X11” as a configuration tool and become immune to X11 package updates interfering in the standard configuration files.