Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt App as init process
janhieber last edited by
currently i have a QT GUI app running on a Buildroot Linux on RPI.
The app runs without X11/wayland with the following environment variables:
QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0 QT_QPA_EGLFS_WIDTH=800 QT_QPA_EGLFS_HEIGHT=600
And the following parameters:
-plugin EvdevMouse -plugin EvdevKeyboard
Now I want to use the app as init process, started directly from kernel.
For this to work I do the init stuff (mounting /tmp /dev ...) in main() at the beginning.
My only problem is: When i launch the app with the kernel "init=" parameter,
i can not set the environment variables or the parameters.
So is there a way to do both, QPA and Plugins in C code in the app?
Hi and welcome to devnet,
Why not use a script to start your application ?
By the way, shouldn't it rather be launched by your init manager (systemd, init, etc.) ?
In any case, qputenv could be used to set the environment variables and you would have to modify by hand argc and argv before passing them to your QApplication instance.