1require u-boot-common-aspeed-sdk_${PV}.inc
2
3SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
4DEPENDS += "mtd-utils"
5
6PROVIDES += "u-boot-fw-utils"
7RPROVIDES:${PN} += "u-boot-fw-utils"
8
9SRC_URI += "file://fw_env_ast2600_nor.config"
10SRC_URI += "file://fw_env_ast2600_mmc.config"
11
12ENV_CONFIG_FILE = "fw_env_ast2600_nor.config"
13ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config"
14
15INSANE_SKIP:${PN} = "already-stripped"
16EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
17EXTRA_OEMAKE:class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
18
19inherit uboot-config
20
21do_compile () {
22	oe_runmake ${UBOOT_MACHINE}
23	oe_runmake envtools
24}
25
26do_install () {
27	install -d ${D}${base_sbindir}
28	install -d ${D}${sysconfdir}
29	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
30	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
31
32	install -m 644 ${WORKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config
33}
34
35do_install:class-cross () {
36	install -d ${D}${bindir_cross}
37	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
38	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
39}
40
41SYSROOT_DIRS:append:class-cross = " ${bindir_cross}"
42
43PACKAGE_ARCH = "${MACHINE_ARCH}"
44BBCLASSEXTEND = "cross"
45