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