xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "Keyboard maps"
2DESCRIPTION = "Keymaps and initscript to set the keymap on bootup."
3SECTION = "base"
4
5RDEPENDS:${PN} = "kbd"
6
7LICENSE = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://keymap.sh;beginline=5;endline=5;md5=829e563511c9a1d6d41f17a7a4989d6a"
9PACKAGE_ARCH = "${MACHINE_ARCH}"
10PR = "r31"
11
12INHIBIT_DEFAULT_DEPS = "1"
13
14# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
15# manually to avoid unnecessary postinst/preinst generated.
16python __anonymous() {
17    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
18        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
19}
20
21inherit update-rc.d
22
23SRC_URI = "file://keymap.sh"
24
25INITSCRIPT_NAME = "keymap.sh"
26INITSCRIPT_PARAMS = "start 01 S ."
27
28S = "${WORKDIR}"
29
30do_install () {
31    # Only install the script if 'sysvinit' is in DISTRO_FEATURES
32    # THe ulitity this script provides could be achieved by systemd-vconsole-setup.service
33    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
34	install -d ${D}${sysconfdir}/init.d/
35	install -m 0755 ${WORKDIR}/keymap.sh ${D}${sysconfdir}/init.d/
36    fi
37}
38
39PACKAGE_WRITE_DEPS:append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
40pkg_postinst:${PN} () {
41	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
42		if [ -n "$D" ]; then
43			OPTS="--root=$D"
44		fi
45		systemctl $OPTS mask keymap.service
46	fi
47}
48
49ALLOW_EMPTY:${PN} = "1"
50