rename variable serial_device to serial_ir_device

and add an entry for the serial-ir role to the playbook (commented out
by default, so the user has to enable it if required)
This commit is contained in:
Alexander Grothe 2019-01-02 09:26:56 +01:00
parent 326c7d3119
commit f1709c8494
7 changed files with 536 additions and 512 deletions

File diff suppressed because it is too large Load Diff

View File

@ -262,6 +262,7 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation:
- autoinstall-yausbir # preconfigure lircd for yaUsbIR receiver
- autoinstall-dvbsky-firmware # download and install required firmware files for dvbsky cards
- autoinstall-firmware # download and install firmware files for dvb devices
#- serial-ir # configure a serial port for "homebrew" ir receivers (e.g. Atric V5)
- kodi
- dvd # set up packages and a udev rule to allow kodi and other players
# to play and eject optical media
@ -421,6 +422,12 @@ grub:
timeout: 0
boot_options: quiet splash
#+END_SRC
** Serial IR
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
# Serial device to configure for a homebrew receiver.
# Choose either ttyS0 (COM1) or ttyS1 (COM2)
serial_ir_device = ttyS0
#+END_SRC
* Roles
:PROPERTIES:
:ID: 50ac2e79-c494-4a32-8632-313d49bdb2b7
@ -5716,13 +5723,13 @@ dependencies:
when: '"1209:4444" in usb or "16c0:27d9" in usb'
#+END_SRC
** Serial IR Receivers
This role preconfigures the system for serial "homebrew" receivers. Newer kernel versions provide ~serial_ir~ which acts as a rc-core driver, so we don't need lircd (it works with eventircd OOTB).
This role preconfigures the system for serial "homebrew" receivers. Newer kernel versions provide ~serial_ir~ which acts as a rc-core driver, so we don't need lircd - eventlircd can use the device directly.
As configured in the role yavdr-remote ([[*create /etc/rc_maps.cfg][/etc/rc_maps.cfg]]) a keytable for a RC-6 MCE remote is loaded by default. You can choose a different keymap which may use another ir-protocol.
As configured in the role yavdr-remote ([[*create /etc/rc_maps.cfg][/etc/rc_maps.cfg]]) a keytable for a RC-6 MCE remote is loaded by default. You can choose a different keymap which may also use another ir-protocol.
*** defaults
#+BEGIN_SRC yaml :tangle roles/serial-ir/defaults/main.yml
---
serial_device: ttyS0
serial_ir_device: ttyS0
#+END_SRC
*** tasks
@ -5756,20 +5763,20 @@ serial_ir
**** serial_ir module options
#+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/modprobe.d/serial_ir.conf.j2
#COM1 equivalent, /dev/ttyS0
{% if serial_device == "ttyS0" %}
{% if serial_ir_device == "ttyS0" %}
options serial_ir irq=4 io=0x3f8
{% elif serial_device == "ttyS1" %}
{% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
options serial_ir irq=3 io=0x2f8
{% endif %}
install serial_ir setserial /dev/{{serial_device}} uart none; /sbin/modprobe --ignore-install serial_ir
install serial_ir setserial /dev/{{serial_ir_device}} uart none; /sbin/modprobe --ignore-install serial_ir
#+END_SRC
**** setserial options
#+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/serial.conf.j2
{% if serial_device == "ttyS0" %}
{% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0
/dev/ttyS0 uart none
{% elif serial_device == "ttyS1" %}
{% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
/dev/ttyS1 uart none
{% endif %}

View File

@ -57,3 +57,6 @@ wakeup_method: acpiwakeup
grub:
timeout: 0
boot_options: quiet splash
# Serial device to configure for a homebrew receiver.
# Choose either ttyS0 (COM1) or ttyS1 (COM2)
serial_ir_device = ttyS0

View File

@ -1,2 +1,2 @@
---
serial_device: ttyS0
serial_ir_device: ttyS0

View File

@ -1,8 +1,8 @@
#COM1 equivalent, /dev/ttyS0
{% if serial_device == "ttyS0" %}
{% if serial_ir_device == "ttyS0" %}
options serial_ir irq=4 io=0x3f8
{% elif serial_device == "ttyS1" %}
{% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
options serial_ir irq=3 io=0x2f8
{% endif %}
install serial_ir setserial /dev/{{serial_device}} uart none; /sbin/modprobe --ignore-install serial_ir
install serial_ir setserial /dev/{{serial_ir_device}} uart none; /sbin/modprobe --ignore-install serial_ir

View File

@ -1,7 +1,7 @@
{% if serial_device == "ttyS0" %}
{% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0
/dev/ttyS0 uart none
{% elif serial_device == "ttyS1" %}
{% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
/dev/ttyS1 uart none
{% endif %}

View File

@ -32,6 +32,7 @@
- autoinstall-yausbir # preconfigure lircd for yaUsbIR receiver
- autoinstall-dvbsky-firmware # download and install required firmware files for dvbsky cards
- autoinstall-firmware # download and install firmware files for dvb devices
#- serial-ir # configure a serial port for "homebrew" ir receivers (e.g. Atric V5)
- kodi
- dvd # set up packages and a udev rule to allow kodi and other players
# to play and eject optical media