rocky8 won't start after accidentally deleted /usr/lib/udev/rules.d/61-gdm.rules
My laptop has a hybrid setup, intel + nvidia GPU with rocky8.6 linux. It used to work fine with x11 and nvidia proprietary driver with intel card disabled on both rocky8.6 and ubuntu20.04. I am trying to enable wayland on it, so i removed /usr/lib/udev/rules.d/61-gdm.rules. I previously disabled intel graph card in bios, so only nvidia is doing something. After reboot, I am stuck at a black screen with a static underscore(not blinking) on the top left. So I went back and enabled the intel graphic card, and boooom, I can boot up normally.
But enabling the intel card breaks my ubuntu20.04 setup on x11. Also, I don't know what was the content of the my old 61-gdm.rules. Right now, i just copied from online somewhere the following:
# disable Wayland on Hi1710 chipsets
ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"
# disable Wayland on hybrid systems with vendor nvidia driver
# default to Xorg on single gpu vendor nvidia systems
DRIVER=="nvidia", ENV{GDM_HAS_VENDOR_NVIDIA_DRIVER}="1"
#DRIVER=="nvidia", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"
#DRIVER=="nvidia", RUN+="/usr/libexec/gdm-runtime-config set daemon PreferredDisplayServer xorg"
# disable Wayland if modesetting is disabled
IMPORT{cmdline}="nomodeset", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"
I remember my old file has two extra lines something like
[system] ...RUN+="/usr/libexec/gdm-disable-wayland... [action] ....RUN+="/usr/libexec/gdm-disable-wayland...
Could someone enlighten me on what is going on...this is a huge black hole to me.. If possible, how to restore the original gdm.rules file?