I have found that current /lib/udev/rules.d/61-gdm.rules can be fixed by swapping the order of the single and escaped double quotes from...
IMPORT{program}="/bin/sh -c \"sed -e 's/: /=/g' -e 's/\([^[:upper:]]\)\([[:upper:]]\)/\1_\2/g' -e 's/[[:lower:]]/\U&/g' -e 's/^/NVIDIA_/' /proc/driver/nvidia/params\""
which fails to parse correctly to...
IMPORT{program}="/bin/sh -c 'sed -e \"s/: /=/g\" -e \"s/\([^[:upper:]]\)\([[:upper:]]\)/\1_\2/g\" -e \"s/[[:lower:]]/\U&/g\" -e \"s/^/NVIDIA_/\" /proc/driver/nvidia/params'"
which parses properly and allows the test for
ENV{NVIDIA_PRESERVE_VIDEO_MEMORY_ALLOCATIONS}!="1", GOTO="gdm_disable_wayland"
to succeed when /etc/modprobe.d/nvidia-power-management.conf contains...
options nvidia NVreg_PreserveVideoMemoryAllocations=1
I have found that current /lib/udev/ rules.d/ 61-gdm. rules can be fixed by swapping the order of the single and escaped double quotes from...
IMPORT{ program} ="/bin/ sh -c \"sed -e 's/: /=/g' -e 's/\([^ [:upper: ]]\)\([ [:upper: ]]\)/\1_ \2/g' -e 's/[[:lower: ]]/\U&/ g' -e 's/^/NVIDIA_/' /proc/driver/ nvidia/ params\ ""
which fails to parse correctly to...
IMPORT{ program} ="/bin/ sh -c 'sed -e \"s/: /=/g\" -e \"s/\([ ^[:upper: ]]\)\([ [:upper: ]]\)/\1_ \2/g\" -e \"s/[[: lower:] ]/\U&/g\ " -e \"s/^/NVIDIA_/\" /proc/driver/ nvidia/ params' "
which parses properly and allows the test for
ENV{NVIDIA_ PRESERVE_ VIDEO_MEMORY_ ALLOCATIONS} !="1", GOTO="gdm_ disable_ wayland"
to succeed when /etc/modprobe. d/nvidia- power-managemen t.conf contains...
options nvidia NVreg_PreserveV ideoMemoryAlloc ations= 1