Author Topic: Using additional button on Logitec MX Air (is this solution fine with LMCE ?)  (Read 3921 times)

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
http://wiki.linuxmce.org/index.php/Edit_Device_Template and
http://wiki.linuxmce.org/index.php/Plug%26play

itsmeok - you don't actually have to write a script at all. Once you create a new device template you can enter the vendor/product IDs directly into the template in the Vendor Model ID field under the Plug n Play box. Just concatenate the 2 numbers together with no ':' into a single 32bit hex number. These 2 numbers come from running lsusb.

Then using the install package for the software, you can configure a new "package" for LMCE at the top of the template.

The Device responsible for generating these Device Detected events in the case of USB devices (and PCI, SCSI, etc) is the HAL device. It will send an event to the PNP Plugin, which registers it in the pnpQueue table, then - it uses the info supplied in these events to attempt to identify a group of applicable Device Templates. Then within those templates it uses the MAC address ranges, USB vendor/product IDs or even the specified pnp script further narrow down the list. This is then presented to the user in the wizard to confirm the device and configure it. At that point I assume it installs the package that you specified and configuration in the Device Template.

Thom - am I heading in the right direction with this?

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Yes, but you'll need to use the Packages section to define a driver package for it. Look at some of the other packages, like the CreateDevice and CreateDevice Source packages to see how things are structured.

-Thom

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
I was looking at that section, but it was far from clear exactly what it was doing, which is why I was vague on that bit in my post!

I'm assuming that you can point it at any normal .deb or, as in some of the examples, at the online apt sources, and it will just do the equivalent of apt-get install or dpkg -i against whatever you point it at. There also seems to be a fall-through so that if the binary .deb isn't available, it will grab the source code and compile it. And this seems to be the bit that the dependencies section is for. Not at all clear on how to configure it -

complete speculation - but there seems to be a section for miscellaneous files. Perhaps, if the package you're installing gets its config from a .conf file. You specify your own custom one here, and it inserts it into the right location before starting the process? But that doesn't tell me how you can get device data (either template default, or entered through the UI) into a package.... is device data perhaps only for packages specifically designed to be a DCE device and therefore not applicable to this BTNX driver (unless you write a "wrapper" around it)?

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Okay, I am reading through this bit by bit to figure out how to respond to you, but basically:

Yes, a package can have multiple sources... Which one is used, depends on whether the package is being built by MakeRelease (the source package), or being installed by the system (ConfirmDependencies), we currently use the Pluto Ubuntu Addons source for most of our stuff, but you can use an external URL source, etc, to download the package from elsewhere. Which ones are apropos still...need to be documented... :)

This whole system forms an abstraction so that later on, other linux distributions and other platforms can easily be coodinated, MakeRelease can build the appropriate packages for a given distribution, and ConfirmDependencies can automatically install for the right distribution.

Take note specifically of the individual folders, and their file components, note that you can use wildcards, but also note the use of the flip source checkbox. Binaries use it, source packages do not. It alters how the path fields are parsed. Pay attention and notice that the paths basically pick up where the paths in the sources area leave off.

As for miscellaneous files, notice that there are mkr_foo.sh scripts typically put there. This can also be used to install boot scripts into their appropriate places, etc. There are mkr_ scripts for preinst, postinst, prerm, and postrm. This is where you do any configuration required by the package that may be required like, setting it up as a system service, whatever. Look at examples of mkr_postinst.sh etc in the individual packages in src/ in the SVN.

-Thom