Add a description, TODO-list and improve initramfs-hook

This commit is contained in:
Alexander Grothe 2018-06-08 19:54:17 +02:00
parent 3138c16a60
commit 05ca162830

View File

@ -2030,6 +2030,15 @@ preferred_refreshrates:
#+END_SRC
**** 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
- name: "create initramfs hook to copy EDID files"
copy:
@ -2038,14 +2047,28 @@ preferred_refreshrates:
mode: 0755
force: yes
- name: "create /lib/firmware/edid"
file:
state: directory
dest: /lib/firmware/edid
# TODO:
# EDID-Dateien nach /lib/firmware/edid/ schreiben
# GRUB_CMDLINE_LINUX anpassen
# initramfs updaten
# grub updaten
# - write EDID files to /lib/firmware/edid/
# - complete template for grub.d
name: "add kernel boot parameters for static display configuration"
template:
src: templates/grub.d/intel.j2
dest: /etc/grub.d/99_intel
mode: 0755
notify: ['Update Initramfs', 'Update GRUB']
#+END_SRC
*** 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
***** x-verbose@.service
#+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
**** initramfs EDID hook
#+BEGIN_SRC shell :tangle roles/yavdr-xorg/files/cp-edid-data.sh
#!/bin/sh
case $1 in
prereqs)
echo "udev"
exit 0
;;
esac
#!/bin/bash
# Created by yavdr-ansible.
# This hook copies EDID files with the naming scheme "edid.${OUTPUT}.bin" to the initramfs.
[ "$1" = "prereqs" ] && { echo "udev"; exit 0; }
# load hook helper 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"
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
exit 0
#+END_SRC