Running on a BeagleBone Black, using their provided distribution, 3.8.13. Using the CircuitCo 3.5" TFT LCD display. My intentions were to autostart a GUI application at power on, not presently caring whether or not it's under the root user.
I've managed to get the X server running with no display manager. Have a UI based application which runs fine, full screen and all. The X server also will start automatically at boot.
What I'm having difficulty doing is getting the app to be automatically run just after the X server is running.
Here's what I have that accomplishes this.
- Had to install xf86-video-fbdev to get the X server so that it would allow me to rotate the screen.
- Went into /etc/rc#.d and removed the gdm scripts to stop gnome
- xorg.conf looks like this:
Code:
Section "Device"
Identifier "Frame Buffer"
Driver "fbdev"
Option "Rotate" "CCW"
EndSection
That's the whole file, no additional stuff.
- In order to run the X server after boot, I added this script to /etc/init.d:
Code:
#!/bin/sh
/usr/bin/setterm -blank 0
/usr/bin/setterm -powersave off
/usr/bin/startx -- -nocursor
And run that from levels 2345, after any other scripts were run.
Thus far this gets my display manager run and gets me to a prompt.
Interestingly, if I
don't auto-run the x server, and run the startx command from the command prompt; the path available at the prompt once in the server matches root's home directory, and all of root's environment are there.
Auto-running the x server, the directory is "/", and root's environment information is not there, however the user is root.
Therefore trying to create a .xinitrc in root's home does not appear to work. I've placed an echo line to place info into a file to see if the script gets run and the UI happened to fail for some reason. It seems pretty clear that the .xinitrc script is not being run. So I looked into playing with the default xinitrc, no dice there; it ran the script but did not load the server. I'm not sure if that's all backwards either, for instance if the xinitrc runs before the server or any window manager runs. But I'm not running any window manager, just the server.
The reason I need the server is that Qt was near impossible to build for this, and FLTK worked extremely well. However FLTK does not yet work directly out of the frame buffer, hence it requires the X server.
Any suggestions on this? Should I try to figure a way to auto-login as root and from within there have a script which runs startx and then next get my UI running?
My Solution
In the end I had to edit the /usb/lib/X11/xinit/xinitrc file to place the starting of my application at the end of that file. I knew of that file, however this particular copy had xterms as well as xclock being run out of it and also knew that no xterms were running on my screen. In looking at the total processes running I did see that the xterm sessions were running; therefore this xinitrc was being used. So I removed all of the file and now it loads automatically to my custom GUI.
Here's the xinitrc:
Code:
#!/bin/sh
exec /home/root/myui