Add a description, TODO-list and improve initramfs-hook
This commit is contained in:
		
							
								
								
									
										49
									
								
								Manual.org
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								Manual.org
									
									
									
									
									
								
							@@ -2030,6 +2030,15 @@ preferred_refreshrates:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#+END_SRC
 | 
					#+END_SRC
 | 
				
			||||||
**** intel.yml
 | 
					**** intel.yml
 | 
				
			||||||
 | 
					KMS drivers (like for intel (i915) and amd (radeon)) require additional configuration beneath a customized ~xorg.conf~ - for a "static" output configuration (which works if the TV or AV receiver is not turned on) we need to force loading the display(s) EDID early during the boot process.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This task therefore performs the following actions after the xrandr detection has been executed:
 | 
				
			||||||
 | 
					 - create an initramfs-hook to copy the EDID(s) into the initramfs
 | 
				
			||||||
 | 
					 - get the connector names and match them to the ones determined by xrandr
 | 
				
			||||||
 | 
					 - add kernel boot arguments to set EDID and mode (refreshrate and resolution) for all outputs
 | 
				
			||||||
 | 
					 - recreate and update initramfs and grub config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Please note that rescanning the connected displays works only after removing the forced loading of EDID(s) during boot (call ~clean-edids~) and a reboot.
 | 
				
			||||||
#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/intel.yml :mkdirp yes :padline no
 | 
					#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/intel.yml :mkdirp yes :padline no
 | 
				
			||||||
- name: "create initramfs hook to copy EDID files"
 | 
					- name: "create initramfs hook to copy EDID files"
 | 
				
			||||||
  copy:
 | 
					  copy:
 | 
				
			||||||
@@ -2038,14 +2047,28 @@ preferred_refreshrates:
 | 
				
			|||||||
    mode: 0755
 | 
					    mode: 0755
 | 
				
			||||||
    force: yes
 | 
					    force: yes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: "create /lib/firmware/edid"
 | 
				
			||||||
 | 
					  file:
 | 
				
			||||||
 | 
					    state: directory
 | 
				
			||||||
 | 
					    dest: /lib/firmware/edid
 | 
				
			||||||
# TODO:
 | 
					# TODO:
 | 
				
			||||||
# EDID-Dateien nach /lib/firmware/edid/ schreiben
 | 
					# - write EDID files to /lib/firmware/edid/
 | 
				
			||||||
# GRUB_CMDLINE_LINUX anpassen
 | 
					# - complete template for grub.d
 | 
				
			||||||
# initramfs updaten
 | 
					name: "add kernel boot parameters for static display configuration"
 | 
				
			||||||
# grub updaten
 | 
					template:
 | 
				
			||||||
 | 
					  src: templates/grub.d/intel.j2
 | 
				
			||||||
 | 
					  dest: /etc/grub.d/99_intel
 | 
				
			||||||
 | 
					  mode: 0755
 | 
				
			||||||
  notify: ['Update Initramfs', 'Update GRUB']
 | 
					  notify: ['Update Initramfs', 'Update GRUB']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#+END_SRC
 | 
					#+END_SRC
 | 
				
			||||||
*** templates
 | 
					*** templates
 | 
				
			||||||
 | 
					**** grub
 | 
				
			||||||
 | 
					#+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/grub.d/intel.j2 :mkdirp yes :padline no
 | 
				
			||||||
 | 
					{% set output_flag = 'D' if ("HDMI" in xorg.primary.connector or "DVI" in xorg.primary.connector or "DP" in xorg.primary.connector) else 'e' %} 
 | 
				
			||||||
 | 
					GRUB_CMDLINE_LINUX+=" video={{ xorg.primary.drm_connector }}:{{ xorg.primary.mode|replace('_', '@') }}{{ output_flag }} drm.edid_firmware={{ xorg.primary.drm_connector }}:edid/edid.bin"
 | 
				
			||||||
 | 
					# TODO: configure additional monitors (second monitor on, all others off)
 | 
				
			||||||
 | 
					#+END_SRC
 | 
				
			||||||
**** xorg
 | 
					**** xorg
 | 
				
			||||||
***** x-verbose@.service
 | 
					***** x-verbose@.service
 | 
				
			||||||
#+BEGIN_SRC conf :tangle "roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2" :padline no
 | 
					#+BEGIN_SRC conf :tangle "roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2" :padline no
 | 
				
			||||||
@@ -2426,17 +2449,19 @@ EnvironmentFile=-/var/lib/vdr/.session-env
 | 
				
			|||||||
*** files
 | 
					*** files
 | 
				
			||||||
**** initramfs EDID hook
 | 
					**** initramfs EDID hook
 | 
				
			||||||
#+BEGIN_SRC shell :tangle roles/yavdr-xorg/files/cp-edid-data.sh
 | 
					#+BEGIN_SRC shell :tangle roles/yavdr-xorg/files/cp-edid-data.sh
 | 
				
			||||||
#!/bin/sh
 | 
					#!/bin/bash
 | 
				
			||||||
case $1 in
 | 
					# Created by yavdr-ansible.
 | 
				
			||||||
prereqs)
 | 
					# This hook copies EDID files with the naming scheme "edid.${OUTPUT}.bin" to the initramfs.
 | 
				
			||||||
   echo "udev"
 | 
					
 | 
				
			||||||
   exit 0
 | 
					[ "$1" = "prereqs" ] && { echo "udev"; exit 0; }
 | 
				
			||||||
   ;;
 | 
					
 | 
				
			||||||
esac
 | 
					# load hook helper functions
 | 
				
			||||||
. /usr/share/initramfs-tools/hook-functions
 | 
					. /usr/share/initramfs-tools/hook-functions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rm /lib/firmware/edid/edid.*.bin
 | 
				
			||||||
 | 
					find "/etc/X11/" -name "edid.*.bin" -type f -exec cp -t "/lib/firmware/edid/" {} +
 | 
				
			||||||
mkdir -p "${DESTDIR}/lib/firmware/edid"
 | 
					mkdir -p "${DESTDIR}/lib/firmware/edid"
 | 
				
			||||||
find "/lib/firmware/edid/" -name "edid*.bin" -type f -exec cp {} "${DESTDIR}/lib/firmware/edid/" +
 | 
					find "/etc/X11/" -name "edid.*.bin" -type f -exec cp -t "${DESTDIR}/lib/firmware/edid/" {} +
 | 
				
			||||||
manual_add_modules i915 radeon
 | 
					manual_add_modules i915 radeon
 | 
				
			||||||
exit 0
 | 
					exit 0
 | 
				
			||||||
#+END_SRC
 | 
					#+END_SRC
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user