1require u-boot-common-aspeed-sdk_${PV}.inc
2require conf/machine/distro/include/uboot-distrovars.inc
3
4SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
5DEPENDS += "mtd-utils"
6
7PROVIDES += "u-boot-fw-utils"
8RPROVIDES:${PN} += "u-boot-fw-utils"
9
10SRC_URI += "file://fw_env_ast2600_nor.config"
11SRC_URI += "file://fw_env_ast2600_mmc.config"
12SRC_URI += "file://fw_env_flash_64M_nor.config"
13
14ENV_CONFIG_FILE = "fw_env_ast2600_nor.config"
15ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config"
16ENV_CONFIG_FILE:uboot-flash-65536 = "fw_env_flash_64M_nor.config"
17
18INSANE_SKIP:${PN} = "already-stripped"
19EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
20EXTRA_OEMAKE:class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
21
22inherit uboot-config
23
24do_compile () {
25	oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
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