Skip to contentSkip to conversation

mtd-utils: add optional systemd service for ubihealthd

PATCH Superseded Hiago De Franco 3 participants 4 messages Jul 12, 2025 – Jul 14, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd-utils: add optional systemd service for ubihealthd

From: Hiago De Franco <[email protected]>

Add support for deploying a ubihealthd.service systemd unit through a new 'ubihealthd-service' PACKAGECONFIG option.

This change allows systems using systemd to easily enable and manage the UBI health monitoring daemon as a background service.

---
 .../mtd/files/ubihealthd.service              | 10 +++++++++
 meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb  | 21 ++++++++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/mtd/files/ubihealthd.service
meta/recipes-devtools/mtd/files/ubihealthd.service new file +10 -0
new file mode 100644
index 000000000000..74b8df655b5c
@@ -0,0 +1,10 @@
+[Unit]
+Description=UBI health daemon
+After=multi-user.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/ubihealthd
+
+[Install]
+WantedBy=multi-user.target
meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +18 -3
index 47f0b01abe0f..d99a1d5c7b70 100644
@@ -6,7 +6,7 @@ LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
                     file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
 
-inherit autotools pkgconfig update-alternatives
+inherit autotools pkgconfig systemd update-alternatives
 
 DEPENDS = "zlib e2fsprogs util-linux"
 RDEPENDS:mtd-utils-tests += "bash"
@@ -17,7 +17,8 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git;branch=master \
            file://0002-ubifs-utils-journal-Include-sys-stat.h.patch \
            file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch \
            file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch \
-           file://0001-Improve-check-for-GCC-compiler-version.patch"
+           file://0001-Improve-check-for-GCC-compiler-version.patch \
+           file://ubihealthd.service"
 
 # xattr support creates an additional compile-time dependency on acl because
 # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
@@ -29,6 +30,7 @@ PACKAGECONFIG[crypto] = "--with-crypto,--without-crypto,openssl"
 PACKAGECONFIG[jffs] = "--with-jffs,--without-jffs"
 PACKAGECONFIG[ubifs] = "--with-ubifs,--without-ubifs"
 PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
+PACKAGECONFIG[ubihealthd-service] = ",,systemd"
 
 CPPFLAGS:append:riscv64  = " -pthread -D_REENTRANT"
 
@@ -54,6 +56,9 @@ ALTERNATIVE_LINK_NAME[flash_lock] = "${sbindir}/flash_lock"
 ALTERNATIVE_LINK_NAME[flash_unlock] = "${sbindir}/flash_unlock"
 ALTERNATIVE_LINK_NAME[flashcp] = "${sbindir}/flashcp"
 
+SYSTEMD_SERVICE:${PN} = "ubihealthd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
 do_install () {
 	oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
 	install -d ${D}${includedir}/mtd
@@ -64,6 +69,12 @@ do_install () {
 	install -m 0644 ${S}/include/libubigen.h ${D}${includedir}
 	oe_libinstall -a libubi ${D}${libdir}/
 	oe_libinstall -a libmtd ${D}${libdir}/
+
+	if ${@bb.utils.contains('PACKAGECONFIG', 'ubihealthd-service', 'true', 'false', d)}; then
+		install -d ${D}${systemd_system_unitdir}
+		install -m 0644 ${UNPACKDIR}/ubihealthd.service ${D}${systemd_system_unitdir}
+		sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/ubihealthd.service
+	fi
 }
 
 PACKAGES =+ "mtd-utils-misc mtd-utils-tests"
@@ -71,7 +82,11 @@ PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "jffs", "mtd-utils-jffs2", ""
 PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "ubifs", "mtd-utils-ubifs", "", d)}"
 
 FILES:mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
-FILES:mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
+FILES:mtd-utils-ubifs = "\
+    ${sbindir}/mkfs.ubifs \
+    ${sbindir}/ubi* \
+    ${@bb.utils.contains('PACKAGECONFIG', 'ubihealthd-service', '${systemd_system_unitdir}/ubihealthd.service', '', d)} \
+    "
 FILES:mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
 FILES:mtd-utils-tests = "${libexecdir}/mtd-utils/*"
 
Signature · 1 line
2.39.5
#1 lore raw
Quoted 73 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Hiago De Franco via lists.openembedded.org
Sent: Saturday, July 12, 2025 3:56
To: [email protected]
Cc: Denys Dmytriyenko <[email protected]>; Hiago De Franco <[email protected]>
Subject: [OE-core] [PATCH] mtd-utils: add optional systemd service for ubihealthd

From: Hiago De Franco <[email protected]>

Add support for deploying a ubihealthd.service systemd unit through a new 'ubihealthd-service' PACKAGECONFIG option.

This change allows systems using systemd to easily enable and manage the UBI health monitoring daemon as a background service.

---
 .../mtd/files/ubihealthd.service              | 10 +++++++++
 meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb  | 21 ++++++++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/mtd/files/ubihealthd.service
meta/recipes- renamed from meta/recipes-devtools/mtd/files/ubihealthd.service +0 -0

devtools/mtd/files/ubihealthd.service
new file mode 100644
index 000000000000..74b8df655b5c

meta/recipes-devtools/mtd/files/ubihealthd.service new file +10 -0
@@ -0,0 +1,10 @@
+[Unit]
+Description=UBI health daemon
+After=multi-user.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/ubihealthd
+
+[Install]
+WantedBy=multi-user.target
meta/recipes- renamed from meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0

devtools/mtd/mtd-utils_2.3.0.bb
index 47f0b01abe0f..d99a1d5c7b70 100644

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -6,7 +6,7 @@ LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM =
 "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
 

file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409 380049c"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +3 -2
-inherit autotools pkgconfig update-alternatives
+inherit autotools pkgconfig systemd update-alternatives
 
 DEPENDS = "zlib e2fsprogs util-linux"
 RDEPENDS:mtd-utils-tests += "bash"
@@ -17,7 +17,8 @@ SRC_URI = "git://git.infradead.org/mtd-
 utils.git;branch=master \
            file://0002-ubifs-utils-journal-Include-sys-stat.h.patch \
            file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch \
            file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch \
-           file://0001-Improve-check-for-GCC-compiler-version.patch"
+           file://0001-Improve-check-for-GCC-compiler-version.patch \
+           file://ubihealthd.service"
 
 # xattr support creates an additional compile-time dependency on acl because
 # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -29,6 +30,7 @@ PACKAGECONFIG[crypto] = "--with-crypto,--without-
Quoted 5 lines

crypto,openssl"
PACKAGECONFIG[jffs] = "--with-jffs,--without-jffs" PACKAGECONFIG[ubifs] = "--with-ubifs,--without-ubifs" PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
+PACKAGECONFIG[ubihealthd-service] = ",,systemd"

This seems to be wrong:
1. depending on systemd is allowed only with REQUIRED_DISTRO_FEATURES = "systemd"
2. the recipe build does not depend on systemd

I believe that you can just leave out the systemd from this line and it should be fine. Systemd bbclass will make sure that the service is installed/excluded based on distro.

Peter

#2 lore raw

Hi Peter, Richard,

Quoted 83 lines · Peter
Quoted 73 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Hiago De Franco via lists.openembedded.org
Sent: Saturday, July 12, 2025 3:56
To: [email protected]
Cc: Denys Dmytriyenko <[email protected]>; Hiago De Franco <[email protected]>
Subject: [OE-core] [PATCH] mtd-utils: add optional systemd service for ubihealthd

From: Hiago De Franco <[email protected]>

Add support for deploying a ubihealthd.service systemd unit through a new 'ubihealthd-service' PACKAGECONFIG option.

This change allows systems using systemd to easily enable and manage the UBI health monitoring daemon as a background service.

---
 .../mtd/files/ubihealthd.service              | 10 +++++++++
 meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb  | 21 ++++++++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/mtd/files/ubihealthd.service
meta/recipes- renamed from meta/recipes-devtools/mtd/files/ubihealthd.service +0 -0

devtools/mtd/files/ubihealthd.service
new file mode 100644
index 000000000000..74b8df655b5c

meta/recipes-devtools/mtd/files/ubihealthd.service new file +10 -0
@@ -0,0 +1,10 @@
+[Unit]
+Description=UBI health daemon
+After=multi-user.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/ubihealthd
+
+[Install]
+WantedBy=multi-user.target
meta/recipes- renamed from meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0

devtools/mtd/mtd-utils_2.3.0.bb
index 47f0b01abe0f..d99a1d5c7b70 100644

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -6,7 +6,7 @@ LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM =
 "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
 

file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409 380049c"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +3 -2
-inherit autotools pkgconfig update-alternatives
+inherit autotools pkgconfig systemd update-alternatives
 
 DEPENDS = "zlib e2fsprogs util-linux"
 RDEPENDS:mtd-utils-tests += "bash"
@@ -17,7 +17,8 @@ SRC_URI = "git://git.infradead.org/mtd-
 utils.git;branch=master \
            file://0002-ubifs-utils-journal-Include-sys-stat.h.patch \
            file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch \
            file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch \
-           file://0001-Improve-check-for-GCC-compiler-version.patch"
+           file://0001-Improve-check-for-GCC-compiler-version.patch \
+           file://ubihealthd.service"
 
 # xattr support creates an additional compile-time dependency on acl because
 # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -29,6 +30,7 @@ PACKAGECONFIG[crypto] = "--with-crypto,--without-
Quoted 5 lines

crypto,openssl"
PACKAGECONFIG[jffs] = "--with-jffs,--without-jffs" PACKAGECONFIG[ubifs] = "--with-ubifs,--without-ubifs" PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
+PACKAGECONFIG[ubihealthd-service] = ",,systemd"

This seems to be wrong:
1. depending on systemd is allowed only with REQUIRED_DISTRO_FEATURES = "systemd"
2. the recipe build does not depend on systemd

Quoted 2 lines

I believe that you can just leave out the systemd from this line and it should be fine. Systemd bbclass will make sure that the service is installed/excluded based on distro.

Thanks for the review, I will fix this on the v2 patch. I tested with only

PACKAGECONFIG[ubihealthd-service] = ",,"

and seems to be working fine.

Quoted 2 lines

Peter

Quoted 101 lines · Richard Purdie
Quoted 95 lines · Hiago De Franco via lists.openembedded.org

From: Hiago De Franco <[email protected]>

Add support for deploying a ubihealthd.service systemd unit through a new 'ubihealthd-service' PACKAGECONFIG option.

This change allows systems using systemd to easily enable and manage the UBI health monitoring daemon as a background service.

---
�.../mtd/files/ubihealthd.service������������� | 10 +++++++++ �meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb� | 21 ++++++++++++++++--- �2 files changed, 28 insertions(+), 3 deletions(-)
�create mode 100644 meta/recipes-devtools/mtd/files/ubihealthd.service

meta/recipes-devtools/mtd/files/ubihealthd.service new file +10 -0
new file mode 100644
index 000000000000..74b8df655b5c
@@ -0,0 +1,10 @@
+[Unit]
+Description=UBI health daemon
+After=multi-user.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/ubihealthd
+
+[Install]
+WantedBy=multi-user.target
meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
index 47f0b01abe0f..d99a1d5c7b70 100644
@@ -6,7 +6,7 @@ LICENSE = "GPL-2.0-or-later"
 �LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3�\

�������������������� file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c" �

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +1 -1
-inherit autotools pkgconfig update-alternatives
+inherit autotools pkgconfig systemd update-alternatives

�
�DEPENDS = "zlib e2fsprogs util-linux"
�RDEPENDS:mtd-utils-tests += "bash"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +2 -1
@@ -17,7 +17,8 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git;branch=master \
 ����������� file://0002-ubifs-utils-journal-Include-sys-stat.h.patch�\
 ����������� file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch�\
 ����������� file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch�\
-���������� file://0001-Improve-check-for-GCC-compiler-version.patch"
+���������� file://0001-Improve-check-for-GCC-compiler-version.patch�\
+���������� file://ubihealthd.service"

�
�# xattr support creates an additional compile-time dependency on acl because �# the sys/acl.h header is needed. libacl is not needed and thus enabling xattr

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -29,6 +30,7 @@ PACKAGECONFIG[crypto] = "--with-crypto,--without-crypto,openssl"

�PACKAGECONFIG[jffs] = "--with-jffs,--without-jffs" �PACKAGECONFIG[ubifs] = "--with-ubifs,--without-ubifs" �PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" +PACKAGECONFIG[ubihealthd-service] = ",,systemd" �
�CPPFLAGS:append:riscv64� = " -pthread -D_REENTRANT" �

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -54,6 +56,9 @@ ALTERNATIVE_LINK_NAME[flash_lock] = "${sbindir}/flash_lock"

�ALTERNATIVE_LINK_NAME[flash_unlock] = "${sbindir}/flash_unlock" �ALTERNATIVE_LINK_NAME[flashcp] = "${sbindir}/flashcp" �

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +3 -0
+SYSTEMD_SERVICE:${PN} = "ubihealthd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+

�do_install () {
� oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
� install -d ${D}${includedir}/mtd

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -64,6 +69,12 @@ do_install () {
 �	install -m 0644 ${S}/include/libubigen.h ${D}${includedir}

� oe_libinstall -a libubi ${D}${libdir}/
� oe_libinstall -a libmtd ${D}${libdir}/

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +6 -0
+
+	if ${@bb.utils.contains('PACKAGECONFIG', 'ubihealthd-service', 'true', 'false', d)}; then
+		install -d ${D}${systemd_system_unitdir}
+		install -m 0644 ${UNPACKDIR}/ubihealthd.service ${D}${systemd_system_unitdir}
+		sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/ubihealthd.service
+	fi

�}
�
�PACKAGES =+ "mtd-utils-misc mtd-utils-tests"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -71,7 +82,11 @@ PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "jffs", "mtd-utils-jffs2", ""

�PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "ubifs", "mtd-utils-ubifs", "", d)}"
�
�FILES:mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +5 -1
-FILES:mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
+FILES:mtd-utils-ubifs = "\
+��� ${sbindir}/mkfs.ubifs \
+��� ${sbindir}/ubi* \
+��� ${@bb.utils.contains('PACKAGECONFIG', 'ubihealthd-service', '${systemd_system_unitdir}/ubihealthd.service', '', d)} \
+��� "
Quoted 2 lines

�FILES:mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image" �FILES:mtd-utils-tests = "${libexecdir}/mtd-utils/*"

As well as the feedback from Peter, there were autobuilder testing failures:

Quoted 2 lines

https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/2029
https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/1875

Thanks Richard, I believe I missed the proper package name into SYSTEMD_SERVICE override. I will fix it on the v2 and add a check for the proper PACKAGECONFIG to add the '.service' file.

Quoted 4 lines

Cheers,

Richard

Best Regards,
Hiago.

#3 lore raw
In reply to Hiago De Franco
Quoted 95 lines · Hiago De Franco via lists.openembedded.org

From: Hiago De Franco <[email protected]>

Add support for deploying a ubihealthd.service systemd unit through a new 'ubihealthd-service' PACKAGECONFIG option.

This change allows systems using systemd to easily enable and manage the UBI health monitoring daemon as a background service.

---
 .../mtd/files/ubihealthd.service              | 10 +++++++++ meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb  | 21 ++++++++++++++++---

 2 files changed, 28 insertions(+), 3 deletions(-)

 create mode 100644 meta/recipes-devtools/mtd/files/ubihealthd.service

meta/recipes-devtools/mtd/files/ubihealthd.service new file +10 -0
new file mode 100644
index 000000000000..74b8df655b5c
@@ -0,0 +1,10 @@
+[Unit]
+Description=UBI health daemon
+After=multi-user.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/ubihealthd
+
+[Install]
+WantedBy=multi-user.target
meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
index 47f0b01abe0f..d99a1d5c7b70 100644
@@ -6,7 +6,7 @@ LICENSE = "GPL-2.0-or-later"
  LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \

                     file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +1 -1
-inherit autotools pkgconfig update-alternatives
+inherit autotools pkgconfig systemd update-alternatives


 DEPENDS = "zlib e2fsprogs util-linux"
 RDEPENDS:mtd-utils-tests += "bash"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +2 -1
@@ -17,7 +17,8 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git;branch=master \
             file://0002-ubifs-utils-journal-Include-sys-stat.h.patch \
             file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch \
             file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch \
-           file://0001-Improve-check-for-GCC-compiler-version.patch"
+           file://0001-Improve-check-for-GCC-compiler-version.patch \
+           file://ubihealthd.service"

 # xattr support creates an additional compile-time dependency on acl because
 # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -29,6 +30,7 @@ PACKAGECONFIG[crypto] = "--with-crypto,--without-crypto,openssl"

 PACKAGECONFIG[jffs] = "--with-jffs,--without-jffs" PACKAGECONFIG[ubifs] = "--with-ubifs,--without-ubifs" PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" +PACKAGECONFIG[ubihealthd-service] = ",,systemd"
 CPPFLAGS:append:riscv64  = " -pthread -D_REENTRANT"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -54,6 +56,9 @@ ALTERNATIVE_LINK_NAME[flash_lock] = "${sbindir}/flash_lock"

 ALTERNATIVE_LINK_NAME[flash_unlock] = "${sbindir}/flash_unlock" ALTERNATIVE_LINK_NAME[flashcp] = "${sbindir}/flashcp"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +3 -0
+SYSTEMD_SERVICE:${PN} = "ubihealthd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+

 do_install () {
  oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir} install -d ${D}${includedir}/mtd

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -64,6 +69,12 @@ do_install () {
  	install -m 0644 ${S}/include/libubigen.h ${D}${includedir}

  oe_libinstall -a libubi ${D}${libdir}/
  oe_libinstall -a libmtd ${D}${libdir}/

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +6 -0
+
+	if ${@bb.utils.contains('PACKAGECONFIG', 'ubihealthd-service', 'true', 'false', d)}; then
+		install -d ${D}${systemd_system_unitdir}
+		install -m 0644 ${UNPACKDIR}/ubihealthd.service ${D}${systemd_system_unitdir}
+		sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/ubihealthd.service
+	fi

 }

 PACKAGES =+ "mtd-utils-misc mtd-utils-tests"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +0 -0
@@ -71,7 +82,11 @@ PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "jffs", "mtd-utils-jffs2", ""

 PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "ubifs", "mtd-utils-ubifs", "", d)}"

 FILES:mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"

meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +5 -1
-FILES:mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
+FILES:mtd-utils-ubifs = "\
+    ${sbindir}/mkfs.ubifs \
+    ${sbindir}/ubi* \
+    ${@bb.utils.contains('PACKAGECONFIG', 'ubihealthd-service', '${systemd_system_unitdir}/ubihealthd.service', '', d)} \
+    "
Quoted 2 lines

 FILES:mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image" FILES:mtd-utils-tests = "${libexecdir}/mtd-utils/*"

As well as the feedback from Peter, there were autobuilder testing failures:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/2029
https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/1875

Cheers,

Richard