Skip to contentSkip to conversation

sdmon: new package

PATCH In review Thomas Weber 2 participants 2 messages May 6 – Jun 26

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sdmon: new package

sdmon reads out the health data of some industrial grade SD cards.

---
 package/Config.in        |  1 +
 package/sdmon/Config.in  | 10 ++++++++++
 package/sdmon/sdmon.hash |  2 ++
 package/sdmon/sdmon.mk   | 22 ++++++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/sdmon/Config.in
 create mode 100644 package/sdmon/sdmon.hash
 create mode 100644 package/sdmon/sdmon.mk
package/Config.in +1 -0
index 9cae377fb5..9f27f62680 100644
@@ -240,6 +240,7 @@ menu "Filesystem and flash utilities"
 	source "package/nfs-utils/Config.in"
 	source "package/nilfs-utils/Config.in"
 	source "package/ntfs-3g/Config.in"
+	source "package/sdmon/Config.in"
 	source "package/sp-oops-extract/Config.in"
 	source "package/squashfs/Config.in"
 	source "package/sshfs/Config.in"
package/sdmon/Config.in new file +10 -0
new file mode 100644
index 0000000000..121063a1d1
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_SDMON
+	bool "sdmon"
+	help
+	  sdmon reads out the health data of some industrial grade SD Cards.
+	  sdmon uses CMD56 of the SD card specification.
+	  The output of the program is JSON so that it can be parsed easier in
+	  applications using sdmon
+
+	  https://www.ogi-it.com/portfolio/sdmon/
+
package/sdmon/sdmon.hash new file +2 -0
new file mode 100644
index 0000000000..7f551e3449
@@ -0,0 +1,2 @@
+sha256  641c3d0cfa3efa23bb7deecaaef1271916065cd0a20d6f63594c7ad6b37fa3ca  v0.9.0.tar.gz
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  LICENSE
package/sdmon/sdmon.mk new file +22 -0
new file mode 100644
index 0000000000..2baf70f4b0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# sdmon
+#
+################################################################################
+
+SDMON_VERSION = 0.9.0
+SDMON_SOURCE = v$(SDMON_VERSION).tar.gz
+SDMON_SITE = https://github.com/Ognian/sdmon/archive/refs/tags
+SDMON_LICENSE = GPL-2.0
+SDMON_LICENSE_FILES = LICENSE
+
+define SDMON_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS='$(TARGET_CFLAGS) -DVERSION=\"$(SDMON_VERSION)\"' -C $(@D)/src
+endef
+
+define SDMON_INSTALL_TARGET_CMDS
+	$(info Installing sdmon $(SDMON_VERSION))
+	$(INSTALL) -D -m 0755 $(@D)/src/sdmon $(TARGET_DIR)/usr/bin/sdmon
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Thomas Weber, thanks for your patch.

Quoted 1 line

+SDMON_SITE = https://github.com/Ognian/sdmon/archive/refs/tags

For packages hosted on GitHub that do not have uploaded release tarballs, the github helper function must be used to download the source code. This ensures a stable download mechanism. - [Source: https://buildroot.org/downloads/manual/manual.html#github-download-url]

Quoted 1 line

+SDMON_SOURCE = v$(SDMON_VERSION).tar.gz

Smae thing here, when using the github helper, the default tarball name generated matches Buildroot's default naming convention, so you do not need to specify SDMON_SOURCE explicitly.

Quoted 1 line

+sha256 641c3d0cfa3efa23bb7deecaaef1271916065cd0a20d6f63594c7ad6b37fa3ca v0.9.0.tar.gz

You might want to consider adding a comment line at the top of the hash file indicating the origin of the hashes (e.g., locally computed or from upstream).

If you switch to using the github helper, the downloaded tarball name will change to sdmon-0.9.0.tar.gz. You will need to update the filename in the .hash file accordingly.

package/sdmon/sdmon.mk line 18

Quoted 1 line
package/sdmon/sdmon.mk new file +1 -0
+	$(info Installing sdmon $(SDMON_VERSION))

It would be better to avoid using $(info ...) in the build or install commands, as Buildroot already prints standard messages for each step and this can clutter the build output.

Also, when contributing a new package, you should add an entry for yourself in the DEVELOPERS file so that you can receive notifications about build failures or updates related to this package. - [Source: https://buildroot.org/downloads/manual/manual.html#DEVELOPERS]

Best regards,
Gullient Dowan.
Assisted by Buildroot Review Assistant (used gemini).

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot