Important: Please read the Qt Code of Conduct -

Qt App as init process

  • Hi,

    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:


    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?

  • Lifetime Qt Champion

    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.