diff --git a/initial-setup.spec b/initial-setup.spec index 5281872..318d0f0 100644 --- a/initial-setup.spec +++ b/initial-setup.spec @@ -97,6 +97,7 @@ Summary: Run the initial-setup GUI in Wayland Requires: %{name}-gui = %{version}-%{release} Requires: weston Requires: xorg-x11-server-Xwayland +Requires: kbd Provides: firstboot(gui-backend) Conflicts: firstboot(gui-backend) diff --git a/scripts/run-gui-backend.guiweston b/scripts/run-gui-backend.guiweston index 76c91c3..aca589a 100755 --- a/scripts/run-gui-backend.guiweston +++ b/scripts/run-gui-backend.guiweston @@ -24,8 +24,24 @@ EOF chmod +x ${RUN_SCRIPT} -weston --config=${CONFIG_FILE} --socket=wl-firstboot-0 +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" exit_code=$(< ${EXIT_CODE_SAVE}) rm ${CONFIG_FILE} ${RUN_SCRIPT} ${EXIT_CODE_SAVE} +if [ -n "$original_vt" ]; then + chvt "$original_vt" +fi exit $exit_code