Benjamin Fair | 44f6b4d | 2019-01-22 14:34:28 -0800 | [diff] [blame] | 1 | require u-boot-common-nuvoton.inc |
| 2 | |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 3 | SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities" |
kwliu | 89ad9f3 | 2019-06-13 13:49:19 +0800 | [diff] [blame] | 4 | DEPENDS = "mtd-utils bison-native" |
Brian Ma | 2a1e461 | 2023-05-11 17:12:43 +0800 | [diff] [blame] | 5 | RDEPENDS:${PN} = "udev-nuvoton-mtd-partitions" |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 6 | |
| 7 | PROVIDES += "u-boot-fw-utils" |
Brian Ma | 2a1e461 | 2023-05-11 17:12:43 +0800 | [diff] [blame] | 8 | SRC_URI += "file://fw_env.config" |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 9 | |
Willy Tu | ce3cb2c | 2021-08-10 15:28:25 -0700 | [diff] [blame] | 10 | INSANE_SKIP:${PN} = "already-stripped" |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 11 | |
Willy Tu | ce3cb2c | 2021-08-10 15:28:25 -0700 | [diff] [blame] | 12 | EXTRA_OEMAKE:class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" HOSTCC="${BUILD_CC} ${BUILD_FLAGS} ${BUILD_LDFLAGS}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1' |
| 13 | EXTRA_OEMAKE:class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1' |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 14 | |
| 15 | inherit uboot-config |
| 16 | |
| 17 | do_compile () { |
| 18 | oe_runmake ${UBOOT_MACHINE} |
kwliu | 89ad9f3 | 2019-06-13 13:49:19 +0800 | [diff] [blame] | 19 | oe_runmake envtools |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | do_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 Ma | 2a1e461 | 2023-05-11 17:12:43 +0800 | [diff] [blame] | 27 | install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 28 | } |
| 29 | |
Willy Tu | ce3cb2c | 2021-08-10 15:28:25 -0700 | [diff] [blame] | 30 | do_install:class-cross () { |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 31 | 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 Tu | ce3cb2c | 2021-08-10 15:28:25 -0700 | [diff] [blame] | 36 | SYSROOT_PREPROCESS_FUNCS:class-cross = "uboot_fw_utils_cross" |
Tomer Maimon | dbd6fa1 | 2018-01-29 17:36:16 +0200 | [diff] [blame] | 37 | uboot_fw_utils_cross() { |
| 38 | sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross} |
| 39 | } |
| 40 | |
| 41 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 42 | BBCLASSEXTEND = "cross" |