2020-11-09 07:23:58 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2017-11-18 20:32:01 +03:00
2020-06-14 13:43:42 +03:00
# Those files right now are not supported by the grammar. Also,
# they are very long but quite repetitive and the parser is not very fast.
# So we don't "test" them.
hwdb_files_notest = files ( '' '
2021-03-26 11:27:11 +03:00
README
2020-12-02 16:55:21 +03:00
20 - dmi - id . hwdb
2017-04-18 02:25:00 +03:00
20 - pci - vendor - model . hwdb
20 - pci - classes . hwdb
20 - usb - vendor - model . hwdb
20 - usb - classes . hwdb
20 - sdio - vendor - model . hwdb
20 - sdio - classes . hwdb
20 - bluetooth - vendor - product . hwdb
20 - acpi - vendor . hwdb
20 - OUI . hwdb
20 - net - ifname . hwdb
2018-04-09 23:25:08 +03:00
20 - vmbus - class . hwdb
2020-06-14 13:43:42 +03:00
'' ' . split ( ) )
hwdb_files_test = files ( '' '
2020-06-18 19:38:58 +03:00
60 - autosuspend . hwdb
2021-01-19 16:59:42 +03:00
60 - autosuspend - fingerprint - reader . hwdb
2017-04-18 02:25:00 +03:00
60 - evdev . hwdb
2020-02-20 02:12:03 +03:00
60 - input - id . hwdb
2017-04-18 02:25:00 +03:00
60 - keyboard . hwdb
2021-07-01 13:30:29 +03:00
60 - seat . hwdb
2017-04-18 02:25:00 +03:00
60 - sensor . hwdb
2021-08-24 14:54:02 +03:00
70 - analyzers . hwdb
2021-10-26 13:17:27 +03:00
70 - cameras . hwdb
2017-07-14 19:28:28 +03:00
70 - joystick . hwdb
2017-04-18 02:25:00 +03:00
70 - mouse . hwdb
70 - pointingstick . hwdb
70 - touchpad . hwdb
hwdb: add hardware database for unit of IEEE 1394
Current udev rules configures group owner of firewire character device
to video group, corresponding to nodes in IEEE 1394 in below cases:
1.the node with any unit for any minor version of IIDC version 1
specification defined by 1394 Trading Association
2.the node with any unit for specification defined by Point Grey Research
3.the node with any unit for AV/C device v1.0 defined by 1394 Trading
Association
4.the node with any unit for vendor-unique protocol defined by 1394
Trading Association
Nevertheless, case 3 and 4 can cover the node with any unit for audio
function as well. In the cases, it's convenient to assign audio group.
Additionally, some nodes are known to have layout different from
the specification defined by 1394 Trading Association. In the case,
it's required to add rules specific to them.
Furthermore, some nodes have no fields for vendor name and model name in
configuration ROM. In the case, it's required to add entries to hardware
database for users convenience.
For the above reasons, this commit adds rules to use information in
hardware database for known units in IEEE 1394. One database entry
corresponds to one unit. Two types of key are used to match the unit;
customized key from node context, kernel modalias of unit context.
The entry has the type of function, at least. Supplementally, it has
vendor and model names.
For your information, below statements with Python pyparsing module are
expected to parse all of the custom key and module alias in the list:
```
subsystem_prefix = pp.Literal('ieee1394:').suppress()
hex_to_int = lambda a: int(a[0], 16)
node_prefix = pp.Literal('node:').suppress()
prefixed_lower_hex = pp.Combine(pp.Literal('0x') + pp.Word(pp.srange('[a-z0-9]'), exact=6)).setParseAction(hex_to_int)
ven_in_node = pp.dictOf(pp.Literal('ven'), prefixed_lower_hex)
mo_in_node = pp.dictOf(pp.Literal('mo'), prefixed_lower_hex)
unit_in_node = pp.Group(prefixed_lower_hex + pp.Literal(':').suppress() + prefixed_lower_hex)
units_in_node = pp.Group(pp.Literal('units') + pp.ZeroOrMore(pp.Literal('*')).suppress() + unit_in_node + pp.ZeroOrMore(pp.Literal('*')).suppress())
node_parser = subsystem_prefix + node_prefix + ven_in_node + pp.Optional(mo_in_node) + units_in_node
higher_hex = pp.Word(pp.srange('[A-Z0-9]'), exact=8).setParseAction(hex_to_int)
ven_in_unit = pp.dictOf(pp.Literal('ven'), higher_hex)
mo_literal_in_unit = pp.dictOf(pp.Literal('mo'), higher_hex)
mo_in_unit = pp.dictOf(pp.Literal('mo'), higher_hex ^ pp.Literal('*'))
sp_in_unit = pp.dictOf(pp.Literal('sp'), higher_hex)
ver_in_unit = pp.dictOf(pp.Literal('ver'), higher_hex)
unit_parser = subsystem_prefix + ven_in_unit + mo_in_unit + sp_in_unit + ver_in_unit
key_parser = node_parser ^ unit_parser
```
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 05:49:22 +03:00
80 - ieee1394 - unit - function . hwdb
meson: build systemd using meson
It's crucial that we can build systemd using VS2010!
... er, wait, no, that's not the official reason. We need to shed old systems
by requring python 3! Oh, no, it's something else. Maybe we need to throw out
345 years of knowlege accumulated in autotools? Whatever, this new thing is
cool and shiny, let's use it.
This is not complete, I'm throwing it out here for your amusement and critique.
- rules for sd-boot are missing. Those might be quite complicated.
- rules for tests are missing too. Those are probably quite simple and
repetitive, but there's lots of them.
- it's likely that I didn't get all the conditions right, I only tested "full"
compilation where most deps are provided and nothing is disabled.
- busname.target and all .busname units are skipped on purpose.
Otherwise, installation into $DESTDIR has the same list of files and the
autoconf install, except for .la files.
It'd be great if people had a careful look at all the library linking options.
I added stuff until things compiled, and in the end there's much less linking
then in the old system. But it seems that there's still a lot of unnecessary
deps.
meson has a `shared_module` statement, which sounds like something appropriate
for our nss and pam modules. Unfortunately, I couldn't get it to work. For the
nss modules, we need an .so version of '2', but `shared_module` disallows the
version argument. For the pam module, it also didn't work, I forgot the reason.
The handling of .m4 and .in and .m4.in files is rather awkward. It's likely
that this could be simplified. If make support is ever dropped, I think it'd
make sense to switch to a different templating system so that two different
languages and not required, which would make everything simpler yet.
v2:
- use get_pkgconfig_variable
- use sh not bash
- use add_project_arguments
v3:
- drop required:true and fix progs/prog typo
v4:
- use find_library('bz2')
- add TTY_GID definition
- define __SANE_USERSPACE_TYPES__
- use join_paths(prefix, ...) is used on all paths to make them all absolute
v5:
- replace all declare_dependency's with []
- add more conf.get guards around optional components
v6:
- drop -pipe, -Wall which are the default in meson
- use compiler.has_function() and compiler.has_header_symbol instead of the
hand-rolled checks.
- fix duplication in 'liblibsystemd' library name
- use the right .sym file for pam_systemd
- rename 'compiler' to 'cc': shorter, and more idiomatic.
v7:
- use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D
- rename prefix to prefixdir, rootprefix to rootprefixdir
("prefix" is too common of a name and too easy to overwrite by mistake)
- wrap more stuff with conf.get('ENABLE...') == 1
- use rootprefix=='/' and rootbindir as install_dir, to fix paths under
split-usr==true.
v8:
- use .split() also for src/coredump. Now everything is consistent ;)
- add rootlibdir option and use it on the libraries that require it
v9:
- indentation
v10:
- fix check for qrencode and libaudit
v11:
- unify handling of executable paths, provide options for all progs
This makes the meson build behave slightly differently than the
autoconf-based one, because we always first try to find the executable in the
filesystem, and fall back to the default. I think different handling of
loadkeys, setfont, and telinit was just a historical accident.
In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs.
In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin),
but in Debian, those directories are not included in the path.
C.f. https://github.com/mesonbuild/meson/issues/1576.
- call all the options 'xxx-path' for clarity.
- sort man/rules/meson.build properly so it's stable
2017-04-05 06:03:47 +03:00
'' ' . split ( ) )
2017-10-03 11:41:51 +03:00
if conf . get ( 'ENABLE_HWDB' ) == 1
2020-06-14 13:43:42 +03:00
auto_suspend_rules = custom_target (
'60-autosuspend-chromiumos.hwdb' ,
output : '60-autosuspend-chromiumos.hwdb' ,
command : make_autosuspend_rules_py ,
capture : true ,
install : true ,
install_dir : udevhwdbdir )
install_data ( hwdb_files_notest ,
hwdb_files_test ,
2017-04-18 02:25:00 +03:00
install_dir : udevhwdbdir )
2017-04-10 06:55:05 +03:00
2020-11-12 10:01:39 +03:00
if install_sysconfdir
2021-05-14 17:12:51 +03:00
meson . add_install_script ( 'sh' , '-c' ,
2021-07-27 20:32:35 +03:00
mkdir_p . format ( sysconfdir / 'udev/hwdb.d' ) )
2017-04-15 07:56:05 +03:00
2021-05-14 17:12:51 +03:00
meson . add_install_script ( 'sh' , '-c' ,
2021-05-14 15:16:17 +03:00
'test -n "$DESTDIR" || @0@/systemd-hwdb update' . format ( rootbindir ) )
2020-11-12 10:01:39 +03:00
endif
2017-04-15 07:40:59 +03:00
2020-06-14 13:43:42 +03:00
if want_tests != 'false'
parse_hwdb_py = find_program ( 'parse_hwdb.py' )
test ( 'parse-hwdb' ,
parse_hwdb_py ,
args : [ hwdb_files_test ,
auto_suspend_rules ] ,
timeout : 90 )
endif
2018-09-12 12:08:49 +03:00
endif
2017-04-24 04:36:29 +03:00
############################################################
2017-04-18 02:48:20 +03:00
run_target (
2021-01-27 11:17:26 +03:00
'update-hwdb' ,
command : [ update_hwdb_sh , meson . current_source_dir ( ) ] )
2019-11-15 13:32:24 +03:00
run_target (
2021-01-27 11:23:02 +03:00
'update-hwdb-autosuspend' ,
command : [ update_hwdb_autosuspend_sh , project_source_root ] )