blob: 029b436e9a39201f23533829eed9e31b0aa3eb9c [file] [log] [blame]
Benjamin Fair44f6b4d2019-01-22 14:34:28 -08001require u-boot-common-nuvoton.inc
2
Tomer Maimondbd6fa12018-01-29 17:36:16 +02003SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
kwliu89ad9f32019-06-13 13:49:19 +08004DEPENDS = "mtd-utils bison-native"
Brian Ma2a1e4612023-05-11 17:12:43 +08005RDEPENDS:${PN} = "udev-nuvoton-mtd-partitions"
Tomer Maimondbd6fa12018-01-29 17:36:16 +02006
7PROVIDES += "u-boot-fw-utils"
Brian Ma2a1e4612023-05-11 17:12:43 +08008SRC_URI += "file://fw_env.config"
Tomer Maimondbd6fa12018-01-29 17:36:16 +02009
Willy Tuce3cb2c2021-08-10 15:28:25 -070010INSANE_SKIP:${PN} = "already-stripped"
Tomer Maimondbd6fa12018-01-29 17:36:16 +020011
Willy Tuce3cb2c2021-08-10 15:28:25 -070012EXTRA_OEMAKE:class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" HOSTCC="${BUILD_CC} ${BUILD_FLAGS} ${BUILD_LDFLAGS}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
13EXTRA_OEMAKE:class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
Tomer Maimondbd6fa12018-01-29 17:36:16 +020014
15inherit uboot-config
16
17do_compile () {
18 oe_runmake ${UBOOT_MACHINE}
kwliu89ad9f32019-06-13 13:49:19 +080019 oe_runmake envtools
Tomer Maimondbd6fa12018-01-29 17:36:16 +020020}
21
22do_install () {
23 install -d ${D}${base_sbindir}
24 install -d ${D}${sysconfdir}
25 install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
26 install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
Brian Ma2a1e4612023-05-11 17:12:43 +080027 install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
Tomer Maimondbd6fa12018-01-29 17:36:16 +020028}
29
Willy Tuce3cb2c2021-08-10 15:28:25 -070030do_install:class-cross () {
Tomer Maimondbd6fa12018-01-29 17:36:16 +020031 install -d ${D}${bindir_cross}
32 install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
33 install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
34}
35
Willy Tuce3cb2c2021-08-10 15:28:25 -070036SYSROOT_PREPROCESS_FUNCS:class-cross = "uboot_fw_utils_cross"
Tomer Maimondbd6fa12018-01-29 17:36:16 +020037uboot_fw_utils_cross() {
38 sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
39}
40
41PACKAGE_ARCH = "${MACHINE_ARCH}"
42BBCLASSEXTEND = "cross"