Tim Lee | 57294f9 | 2024-05-16 14:15:45 +0800 | [diff] [blame] | 1 | require u-boot-common-nuvoton_${PV}.inc |
Brian Ma | 24adf7e | 2024-06-28 11:00:43 +0800 | [diff] [blame] | 2 | require recipes-bsp/u-boot/u-boot-configure.inc |
Tim Lee | 57294f9 | 2024-05-16 14:15:45 +0800 | [diff] [blame] | 3 | |
| 4 | SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities" |
Brian Ma | 24adf7e | 2024-06-28 11:00:43 +0800 | [diff] [blame] | 5 | DEPENDS += "mtd-utils bison-native" |
Tim Lee | 57294f9 | 2024-05-16 14:15:45 +0800 | [diff] [blame] | 6 | RDEPENDS:${PN} = "udev-nuvoton-mtd-partitions" |
| 7 | |
| 8 | PROVIDES += "u-boot-fw-utils" |
| 9 | SRC_URI += "file://fw_env.config" |
| 10 | |
| 11 | INSANE_SKIP:${PN} = "already-stripped" |
| 12 | |
| 13 | EXTRA_OEMAKE:class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" HOSTCC="${BUILD_CC} ${BUILD_FLAGS} ${BUILD_LDFLAGS}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1' |
| 14 | EXTRA_OEMAKE:class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1' |
| 15 | |
| 16 | inherit uboot-config |
| 17 | |
| 18 | do_compile () { |
Tim Lee | 57294f9 | 2024-05-16 14:15:45 +0800 | [diff] [blame] | 19 | oe_runmake envtools |
| 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 |
| 27 | install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config |
| 28 | } |
| 29 | |
| 30 | do_install:class-cross () { |
| 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 | |
| 36 | SYSROOT_PREPROCESS_FUNCS:class-cross = "uboot_fw_utils_cross" |
| 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" |