diff --git a/brltty.spec b/brltty.spec index a217350..21a5b1c 100644 --- a/brltty.spec +++ b/brltty.spec @@ -33,11 +33,16 @@ Name: brltty Version: %{pkg_version} -Release: 15%{?dist} +Release: 16%{?dist} License: LGPLv2+ URL: http://mielke.cc/brltty/ Source0: http://mielke.cc/brltty/archive/%{name}-%{version}.tar.xz Source1: brltty.service +Source2: dracut-module-setup.sh +Source3: dracut-brltty-start.sh +Source4: dracut-brltty-cleanup.sh +Source5: dracut-parse-brltty-opts.sh +Source6: dracut-README Patch1: brltty-loadLibrary.patch # libspeechd.h moved in latest speech-dispatch (NOT sent upstream) Patch2: brltty-5.0-libspeechd.patch @@ -219,6 +224,12 @@ Summary: OCaml binding for BrlAPI This package provides the OCaml binding for BrlAPI. %endif +%package dracut +Summary: brltty module for Dracut +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: dracut +%description dracut-module +This package provides brltty module for Dracut. %define version %{pkg_version} @@ -397,6 +408,15 @@ cp -p %{name}.lang ../ sed -i 's|/usr/bin/python|/usr/bin/python3|g' ${RPM_BUILD_ROOT}/etc/brltty/Contraction/latex-access.ctb popd +#install dracut module + +mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/dracut/modules.d/99brltty +install -p -m 755 %{SOURCE2} ${RPM_BUILD_ROOT}%{_prefix}/lib/dracut/modules.d/99brltty/module-setup.sh +install -p -m 755 %{SOURCE3} ${RPM_BUILD_ROOT}%{_prefix}/lib/dracut/modules.d/99brltty/brltty-start.sh +install -p -m 755 %{SOURCE4} ${RPM_BUILD_ROOT}%{_prefix}/lib/dracut/modules.d/99brltty/brltty-cleanup.sh +install -p -m 755 %{SOURCE5} ${RPM_BUILD_ROOT}%{_prefix}/lib/dracut/modules.d/99brltty/parse-brltty-opts.sh +install -p -m 644 %{SOURCE6} ${RPM_BUILD_ROOT}%{_prefix}/lib/dracut/modules.d/99brltty/README.sh + %post %systemd_post brltty.service @@ -513,7 +533,13 @@ fi %{_libdir}/ocaml/stublibs/ %endif +%files dracut-module +%{_prefix}/lib/dracut/modules.d/99brltty/ + %changelog +* Thu May 31 2018 Tomas Korbar - 5.6-16 +- Added Dracut module + * Tue May 29 2018 Jaroslav Škarvada - 5.6-15 - Added support for ALSA diff --git a/dracut-README b/dracut-README new file mode 100644 index 0000000..12bd4be --- /dev/null +++ b/dracut-README @@ -0,0 +1,38 @@ +Brltty support for dracut + +This module provides brltty functionality in the initrd. +Module pickups user settings from system and install +necessary files like drivers and used text tables to initramfs. + +For now the module is reliably functional from phase pre-mount +in earlier phases the module is not functional + +TBD fix functionality from earlier phases than pre-mount + +Module in instalation takes some options from environment variables. + +BRLTTY_DRACUT_INCLUDE_DRIVERS forces include of screen or braille +driver +example: +BRLTTY_DRACUT_INCLUDE_DRIVERS=bpm beu + +BRLTTY_DRACUT_INCLUDE_TEXT_FILES forces include of text tables +example: +BRLTTY_DRACUT_INCLUDE_TEXT_FILES=kok.ttb lv.tti + +BRLTTY_LOCALE needs to be used when building initram image +to install used text table +see https://bugzilla.redhat.com/show_bug.cgi?id=1584036 +example +BRLTTY_LOCALE=cs_CZ.UTF-8 + +Module allows to override some settings from grub +mainly for debugging purposes + +brltty.braille_parameters +example: +brltty.braille_parameters="auth=none,host=IP:0" + +brltty.braille_driver +example: +brltty.braile_driver="ba" diff --git a/dracut-brltty-cleanup.sh b/dracut-brltty-cleanup.sh new file mode 100755 index 0000000..02ca393 --- /dev/null +++ b/dracut-brltty-cleanup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +read pid&1)" + + local checked_braille_drivers=$(echo "$brltty_report" | grep "checking for braille driver:" | awk '{print $NF}') + + for word in $checked_braille_drivers; do + inst_libdir_file "brltty/libbrlttyb$word.so*" + done + + local text_tables=$(echo "$brltty_report" | grep -E "compiling text table|including data file"| awk '{print $NF}') + + for word in $text_tables; do + inst "$word" + done + + local attributes=$(echo "$brltty_report" | grep "Attributes Table" | awk '{print $NF}') + + for word in $attributes; do + inst "/etc/brltty/Attributes/$word.atb" + done + + if [ "$BRLTTY_DRACUT_INCLUDE_DRIVERS" ]; then + for word in $BRLTTY_DRACUT_INCLUDE_DRIVERS; do + inst_libdir_file "brltty/libbrltty$BRLTTY_DRACUT_INCLUDE_DRIVERS.so*" + done + fi + + if [ "$BRLTTY_DRACUT_INCLUDE_TEXT_FILES" ]; then + for word in $BRLTTY_DRACUT_INCLUDE_TEXT_FILES; do + inst "/etc/brltty/Text/$BRLTTY_DRACUT_INCLUDE_DATA_FILES" + done + fi + + inst_hook cmdline 99 "$moddir/parse-brltty-opts.sh" + inst_hook initqueue 99 "$moddir/brltty-start.sh" + inst_hook cleanup 99 "$moddir/brltty-cleanup.sh" + + inst_simple "/etc/brltty.conf" + inst_simple "/usr/bin/brltty" + + dracut_need_initqueue +} diff --git a/dracut-parse-brltty-opts.sh b/dracut-parse-brltty-opts.sh new file mode 100755 index 0000000..9e6e202 --- /dev/null +++ b/dracut-parse-brltty-opts.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +BRLTTY_BRAILLE_PARAMETERS=$(getarg brltty.braille_parameters=) +BRLTTY_BRAILLE_DRIVER=$(getarg brltty.braille_driver=) +export BRLTTY_BRAILLE_PARAMETERS +export BRLTTY_BRAILLE_DRIVER