summaryrefslogtreecommitdiffstats
path: root/common/recipes-utils/openbmc-gpio/openbmc-gpio_0.1.bb
blob: 6bf4cc117d08a48247ac4a75b48b3c4f4fd05d4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 2015-present Facebook. All Rights Reserved.
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in a file named COPYING; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA

SUMMARY = "OpenBMC GPIO utilies"
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"

SRC_URI = " \
    file://COPYING \
    file://board_gpio_table.py \
    file://openbmc_gpio.py \
    file://openbmc_gpio_table.py \
    file://openbmc_gpio_setup.py \
    file://openbmc_gpio_util.py \
    file://phymemory.py \
    file://setup.py \
    file://soc_gpio.py \
    file://soc_gpio_table.py \
    "

S = "${WORKDIR}"

OPENBMC_GPIO_UTILS = " \
    openbmc_gpio_util.py \
    "

OPENBMC_GPIO_SOC_TABLE = "soc_gpio_table.py"

# Change OPENBMC_GPIO_SETUP to "0" to exclude openbmc_gpio_setup.py from the image
OPENBMC_GPIO_SETUP = "1"

inherit distutils

DEPENDS_${PN} = "python python-distribute update-rc.d-native"

RDEPENDS_${PN} = "python-core python-argparse python-subprocess"

do_board_defined_soc_table() {
    if [ "${OPENBMC_GPIO_SOC_TABLE}" != "soc_gpio_table.py" ]; then
        mv -f "${S}/${OPENBMC_GPIO_SOC_TABLE}" "${S}/soc_gpio_table.py"
    fi
}
addtask board_defined_soc_table after do_unpack before do_build

do_install_append() {
    localbindir="${D}/usr/local/bin"
    install -d ${localbindir}
    for f in ${OPENBMC_GPIO_UTILS}; do
        install -m 755 $f ${localbindir}/${f}
    done

    install -d ${D}${sysconfdir}/init.d
    install -d ${D}${sysconfdir}/rcS.d
    if [ "${OPENBMC_GPIO_SETUP}" == "1" ]; then
        install -m 755 openbmc_gpio_setup.py ${D}${sysconfdir}/init.d/openbmc_gpio_setup.py
        update-rc.d -r ${D} openbmc_gpio_setup.py start 59 S .
    fi
}

FILES_${PN} += "/usr/local/bin ${sysconfdir}"
OpenPOWER on IntegriCloud