Bug 442341

Summary: Support Debian-style configuration
Product: [Fedora] Fedora Reporter: Bastien Nocera <bnocera>
Component: lircAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: jarod
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-23 18:06:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 442329    
Attachments:
Description Flags
lirc-more-args.patch
none
lirc-more-args-2.patch none

Description Bastien Nocera 2008-04-14 14:26:44 UTC
The Debian/Ubuntu startup scripts for lirc support the REMOTE_DEVICE and
REMOTE_DRIVER to pass the --device=... and --driver=... parameters to lirc.

It would be useful if the Fedora startup script could do something similar to
avoid having to edit the file by hand on startup.

The attached patch does this, minus lirc.sysconfig changes necessary to document
this.

Being able to load the kernel modules in REMOTE_MODULES would be useful as well,
for devices that don't support auto-loading (eg. loading a driver for a
non-detectable/non-hotplug device, such as a serial device).

Comment 1 Bastien Nocera 2008-04-14 14:26:44 UTC
Created attachment 302343 [details]
lirc-more-args.patch

Comment 2 Ville Skyttä 2008-04-14 17:46:44 UTC
Hm, I'm afraid I don't quite understand what you mean by "having to edit the
file by hand on startup"; apart from automatically adding --device=... to the
command line if /dev/lirc0 is present, how is the end result of this patch
different from editing /etc/sysconfig/lirc and adding the desired options
directly to LIRCD_OPTIONS?  In all cases, you'd need to edit the sysconfig
snippet and add at least REMOTE_DRIVER there too, no?  Adding more variables of
our own comes with a documentation maintenance burden and possible upgrade
problems whereas by just using the simple LIRCD_OPTIONS we can (and already do)
just point to upstream docs, and people can add whatever in it.

The current commentary in /etc/sysconfig/lirc could be improved somewhat; it
just mentions -H (== --driver) and not -d/--device at all, because it's from the
times there were no lirc kernel modules in Fedora.

Regarding REMOTE_MODULES, I'd prefer pointing to the /etc/sysconfig/modules
functionality of /etc/rc.sysinit rather than reimplementing module loading in
lirc scripts.

Regarding the actual current implementation in the patch, build_remote_args
should probably be invoked when needed, ie. inside start() only.  And it
mentions TRANSMITTER_DEVICE which doesn't seem to be used anywhere.

It's possible that I missed something, providing the patch+docs to the sysconfig
snippet would help me understand better.

Comment 3 Bastien Nocera 2008-04-14 22:25:43 UTC
The point is making /etc/sysconfig/lirc computer-editable. Having separate
variables for the driver and device would mean that a computer program (such as
gnome-lirc-properties) would be able to read from the file, and write back to it
without hard parsing, or hand-editing.

For the REMOTE_MODULES part, I agree with you, and I'll try to make the
necessary changes to gnome-lirc-properties for that purpose.

> Regarding the actual current implementation in the patch, build_remote_args
> should probably be invoked when needed, ie. inside start() only.  And it
> mentions TRANSMITTER_DEVICE which doesn't seem to be used anywhere.

That's my mistake. I'll try to clean this up tomorrow.

Comment 4 Bastien Nocera 2008-05-12 13:58:39 UTC
Created attachment 305130 [details]
lirc-more-args-2.patch

Remove unused variables in the init script
Add documentation to the sysconfig file

Comment 5 Bastien Nocera 2008-06-03 01:01:36 UTC
Jarod, Ville, any comments on this patch?

Comment 6 Jarod Wilson 2008-06-03 14:49:40 UTC
Ah, I knew there was another patch I was forgetting... :)

Another fairly innocuous patch, the only real issue I have with it is the naming
of the vars. REMOTE_DEVICE really seems more like it should be IR_DEVICE,
IR_DEVICE_NODE or some such thing. REMOTE_DEVICE leads me to believe it should
be specifying the type of remote control I'm using, rather than the lirc device
node lircd should be talking to. Similarly, REMOTE_DRIVER might better be
IR_DRIVER, since this driver is actually independent of the actual remote, so
long as the remote talks the right IR protocol, its dependent on the IR receiver. 

Comment 7 Bastien Nocera 2008-06-03 15:25:25 UTC
I'd rather stick to something close to what Debian uses as far as variable names
are concerned. If you don't feel that way, feel free to change them to something
closer to what you believe is right, and I'll modify gnome-lirc-properties to
handle those new names.

Comment 8 Ville Skyttä 2008-06-03 18:06:33 UTC
I think I'd personally prefer LIRC_DRIVER and LIRC_DEVICE, those should be
pretty self explanatory.  Despite its name, LIRC is not limited to infrared
devices so IR_* doesn't feel quite right.

Comment 9 Jarod Wilson 2008-06-04 21:09:50 UTC
I think I'm sold on LIRC_DRIVER and LIRC_DEVICE_NODE. Just LIRC_DEVICE is a
touch ambiguous, since you don't know for sure if we're talking about the device
type of lirc receiver or the device node.

Comment 10 Bastien Nocera 2008-06-05 13:14:43 UTC
(In reply to comment #9)
> I think I'm sold on LIRC_DRIVER and LIRC_DEVICE_NODE. Just LIRC_DEVICE is a
> touch ambiguous, since you don't know for sure if we're talking about the device
> type of lirc receiver or the device node.

It might be ambiguous, but it's pretty well documented in the script itself. At
the same time, I would discourage people from editing the file by hand, and use
gnome-lirc-properties for new setups. Existing setups won't need any changes.

Comment 11 Jarod Wilson 2008-06-23 18:06:44 UTC
I'll get this committed shortly. Going with LIRC_DRIVER and LIRC_DEVICE, with
some minor changes here and there to the initscript and documentation in the
sysconfig file to match.