Files
ModemManager/data/fcc-unlock/meson.build
T
Aleksander Morgado e7a6bb7504 data,fcc-unlock: add example unlock scripts
Added scripts for Foxconn SDX55, Quectel EM120, and several old Sierra
Wireless manufactured devices:
 * Installed but not used by default, the user needs to setup manual
   links from ${pkgdatadir}/fcc-unlock.available.d, to
   ${pkgsysconfdir}/fcc-unlock.d in order to enable them.
 * Installed with rights only for the owner, so that the dispatcher in
   ModemManager can validate them.
 * They rely on $PATH to find the qmicli/mbimcli tools.

In addition to these scripts, per-vid:pid links are created in the
same ${pkgdatadir}/fcc-unlock.available.d directory, specifying which
are the specific devices that require the FCC unlock operation.

This patch also creates the ${pkgsysconfdir}/fcc-unlock.d and
${pkglibdir}/fcc-unlock.d directories where ModemManager looks for the
enabled tools.

Note that the meson setup doesn't support creating/deleting links
officially yet, so we use a workaround using meson.add_install_script
that is not perfect (i.e. doesn't handle the symlink removal during
uninstall). See https://github.com/mesonbuild/meson/issues/1602
2021-11-18 11:20:41 +01:00

42 lines
1.1 KiB
Meson

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021 Aleksander Morgado <aleksander@aleksander.es>
# Shipped but disabled FCC unlock tools
mm_fccunlockdiravailable = mm_pkgdatadir / 'fcc-unlock.available.d'
# Directory for user-enabled tools
mm_fccunlockdiruser = mm_pkgsysconfdir / 'fcc-unlock.d'
# Directory for package-enabled tools
mm_fccunlockdirpackage = mm_pkglibdir / 'fcc-unlock.d'
examples = files(
'105b',
'1199',
'1eac',
)
install_data(
examples,
install_mode: 'rwx------',
install_dir: mm_fccunlockdiravailable,
)
vidpids = {
'105b:e0ab': '105b',
'03f0:4e1d': '1199',
'1199:9079': '1199',
'413c:81a3': '1199',
'413c:81a8': '1199',
'1eac:1001': '1eac',
}
ln_cmd = 'ln -fs @0@ ${DESTDIR}@1@'
foreach output, input: vidpids
meson.add_install_script('sh', '-c', ln_cmd.format(input, mm_prefix / mm_fccunlockdiravailable / output))
endforeach
mkdir_cmd = 'mkdir -p ${DESTDIR}@0@'
meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_fccunlockdiruser))
meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_fccunlockdirpackage))