Fixes to weston startup#156
Conversation
|
FYI @AdamWill @nirik: This pull request should also resolve RH#2358688. |
|
So I've tried the fix by installing a Rawhide VM & installing First I tried to run the Initial Setup GUI without the changes - set Then I edited the But unfortunately the fix does not appear to be complete - although the GUI does show up, when you press the It is possible to switch to a different TTY, but the one in which Initial Setup was running is stuck. Journal dump from this happening: |
Was there supposed to be a login prompt? initial-setup uses tty7, but I think normally getty is started only on tty1-tty6. |
|
after initial-setup runs, either a login prompt or a logged-in session must be presented next. this is in the release criteria, and it's how it has always worked previously. |
|
Lightdm (and probably others too) will switch to appropriate VT on its own. That isn't the case for the text console. I guess I can add chvt back to tty1 (or saved |
|
It should indeed switch back to what it started with before. So basically capture the existing vt, switch, then switch back. |
|
This version should (hopefully) do that now. |
|
|
|
Needs to be added for this subpackage block: https://github.com/rhinstaller/initial-setup/blob/master/initial-setup.spec#L93-L111 |
|
CI is unhappy, not sure why: |
... and restore original VT before exiting. libseat >= 0.9.0 doesn't do that anymore, and it's necessary to get access to devices. More details at https://lists.sr.ht/~kennylevinsen/seatd-devel/%3CZy_-FRQnBTeNPXVj@mail-itl%3E QubesOS/qubes-issues#9568
Normally weston uses card0 only. In dual-GPU setup, it may not be the one with monitor connected, and when it doesn't find any connector monitor, it fails to startup. Look also at outputs connected to other cards too. There doesn't seems to be any option to check all connected devices, so enumerate them via sysfs manually.
|
Any updates ? I assume its still broken without the fix. :P |
|
Let me know if I can help, I think I addressed all earlier comments. CI looks to be broken, but I don't think I can do anything about it... |
OK, will check on ~Monday. :) |
|
Can someone please look at this? We should get this fixed and released to F42 and Rawhide. |
|
I've been tinkering with some Fedora variants that could make use of this. |
|
Ping @M4rtinK ? We still have complaints about this downstream. |
|
Can we just apply these downstream in Fedora and see if it fixes things? Because this has been held up due to lack of review for almost two years... |
|
Sorry for the delays, looking into this during this week. :) |
|
So after testing this PR it seems to fix the issue with Initial Setup GUI not starting due to Weston issues on x86 (at least) on current Rawhide. I've tried if it helps also on ARM where I have seen a similar issues, but it is not sufficient there (and the issue here - Weston outright crashing - might be different from what happens on x86). So lets go with this for x86 & fix the ARM situation separately. :) |
M4rtinK
left a comment
There was a problem hiding this comment.
Looks good to me, thanks! :)
There was a problem hiding this comment.
Pull request overview
This PR updates the Weston-based GUI backend startup flow to better support modern seat handling (libseat >= 0.9.0) and multi-GPU systems by switching to the correct VT before launching Weston and by attempting to explicitly enumerate DRM devices.
Changes:
- Switch to the session VT prior to launching Weston (and switch back afterward).
- Enumerate
/sys/class/drm/card*to select a primary DRM device and pass additional devices to Weston. - Add an RPM runtime dependency on
kbd(forchvt/fgconsole) in the Wayland/Weston subpackage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/run-gui-backend.guiweston | Adds VT switching and DRM device enumeration to improve Weston startup with libseat and multi-GPU setups. |
| initial-setup.spec | Adds kbd runtime dependency for the Wayland/Weston backend to support VT utilities used by the script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| original_vt= | ||
| if [ -n "$XDG_VTNR" ]; then | ||
| original_vt=$(fgconsole) | ||
| # change to VT on which we run to get access to devices | ||
| chvt "${XDG_VTNR}" | ||
| fi |
| cards=$(ls -d /sys/class/drm/card*| grep -v -- -| cut -d / -f 5) | ||
| primary_card=$(echo "$cards" | head -1 ) | ||
| secondary_cards=$(echo "$cards"| | ||
| tail -n +2| | ||
| xargs printf "%s,") | ||
|
|
||
| weston --config=${CONFIG_FILE} --socket=wl-firstboot-0 --drm-device="$primary_card" --additional-devices="$secondary_cards" |
There was a problem hiding this comment.
I think this i wrong. I have only one card and I don't get this:
kkoukiou@fedora:~/repos/anaconda-webui$ cards=$(ls -d /sys/class/drm/card*| grep -v -- -| cut -d / -f 5)
kkoukiou@fedora:~/repos/anaconda-webui$ primary_card=$(echo "$cards" | head -1 )
kkoukiou@fedora:~/repos/anaconda-webui$ echo $primary_card
card1
kkoukiou@fedora:~/repos/anaconda-webui$ secondary_cards=$(echo "$cards"|
tail -n +2|
xargs printf "%s,")
kkoukiou@fedora:~/repos/anaconda-webui$ echo $secondary_cardThere was a problem hiding this comment.
@KKoukiou I think the difference is you are echoing $secondary_card instead of $secondary_cards
My check:
[prnot5 ~/work/scratch]$ cards=$(ls -d /sys/class/drm/card*| grep -v -- -| cut -d / -f 5)
[prnot5 ~/work/scratch]$ primary_card=$(echo "$cards" | head -1 )
[prnot5 ~/work/scratch]$ echo $primary_card
card1
[prnot5 ~/work/scratch]$ secondary_cards=$(echo "$cards"|
tail -n +2|
xargs printf "%s,")
[prnot5 ~/work/scratch]$ echo $secondary_cards
,
There was a problem hiding this comment.
But as I said below I am not sure if comma is harmful for the command option.
There was a problem hiding this comment.
--additional-devices=, seems to work just fine. weston uses strtok() to parse that option, it it skips empty names.
rvykydal
left a comment
There was a problem hiding this comment.
Oh right, I hit the issue with comma in #156 (comment) when playing with the script locally as well. Didn't run the weston command with the option though.


This PR fixes two aspect of weston startup:
See individual commit messages for details