A question about systemd service with yocto

Hi,

I would like to implement a procedure to update the UI software on our new devices with imx8qm,systemd and weston, using a USB pen drive. I already realized a service that execute the update script (mount usb, check update file presence, update the UI software) however i still have some problems. The update procedure may takes about 4/5 mins and the idea was to keep the kernel splash screen during update procedure, and then start the UI application. Here is the service:

[Unit]
Description=Update the UI application
After=weston.service
Requires=weston.service

[Service]
Restart=no
Type=oneshot
ExecStart=/usr/bin/mec-update
StandardOutput=journal+console
TimeoutSec=600

[Install]
WantedBy=multi-user.target

In this way, when the update starts, the screen was completely black. I tried to change the service, removing the [Install] section, changing After=systemd-journald.service, Requires=systemd-journald.service and adding Before=weston.service, but it didn’t work. The screen in this case wasn’t balck, but a kind of login screen was shown (apalis-imx8 login:_).

How should i implement the service to avoid the black screen? My idea was to make this service “synchronous”, so all the other services will starts only when this service finished, but i can’t realize that.

Thanks

Enrico

HI @Enrico

Could you provide the exact version of the Software of your module?

How should i implement the service to avoid the black screen? My idea was to make this service “synchronous”, so all the other services will starts only when this service finished, but i can’t realize that.

Did you activate the Linux Splash screen?

Best regards,
Jaski

Hi @jaski.tx,

Could you provide the exact version of the Software of your module?

here is the version: Linux apalis-imx8 4.14.170-3.0.4+gbaa6c24240a4 #1 SMP PREEMPT Wed Jul 15 12:57:10 UTC 2020 aarch64 GNU/Linux

Did you activate the Linux Splash screen?

Yes i’ve created a custom linux splash screen following your guide. The splash screen is shown correctly, but after a few while the display becomes black with a kind of “login screen”:

TDX Wayland with XWayland 2.6-snapshot apalis-imx8 tty1
apalis-imx8-chelt-filesystem-primary 3.04b 20200717
apalis-imx8 login: _

This is shown during update procedure, then when it’s finished, the UI software starts correctly.
Since on the first line is shown “tty1”, i tried to add the following to my service:

Before=serial-getty@1.service

but it doesn’t work, because on the console i can see “[ OK ] Started Getty on tty1.” before my update service finished.

Thanks

Enrico

Hi

It seems your custom built image is based on console image. To you should enable the desktop feature. Please have a look at our qt5-x11-image for Bsp 3.0.

Do you see the desktop when the service you made is not present?

Best regards,
Jaski

Hi @jaski.tx ,

It seems your custom built image is based on console image

Yes, our image was based on console image.

Do you see the desktop when the service you made is not present?

Yes, but we changed weston.ini file to have a black background and to hide the “upper panel”. So, what the user perceives is, kernel splash screen, then black empty screen for about 1 second, then UI application.

Please have a look at our qt5-x11-image for Bsp 3.0.

I tried to compile a new image based on this, but nothing changed… when the service starts after weston.service the screen becomes black during update, when the service starts after systemd-journald.service the “login” screen is shown on the display during update.

I’m pretty sure that the black screen shown when my service starts after weston.service should be the black desktop that i set in weston.ini, so i think that my service should starts before weston.service, but how could i keep the kernel splash screen on the display instead of the login screen?

Thanks

Enrico

Hi @jaski.tx,

It seems that i’ve found a working solution. Instead of specifing the services in “Before” section, i specified the entire targets. Basically my service becomes the following:

[Unit]
Description=Update the UI application
Before=getty.target graphical.target multi-user.target network.target

[Service]
Restart=no
Type=oneshot
ExecStart=/usr/bin/mec-update
StandardOutput=journal+console
TimeoutSec=900

[Install]
WantedBy=basic.target

In this way when i update the UI, i can see the kernel splash screen, after that i have a black screen (weston desktop) for about 1 second and then starts the UI application.

Thanks

Enrico

Perfect that you found a solution. Thanks for the feedback.