Skip to contentSkip to conversation

package/dtbocfg: new package

PATCH Superseded Herve Codina 2 participants 3 messages Sep 28, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/dtbocfg: new package

dtbocfg, which stands for Device Tree Blob Overlay Configuration File System, was developed to serve as a userspace API of Device Tree Overlay.

https://github.com/ikwzm/dtbocfg

---
 DEVELOPERS                                    |  3 ++
 package/Config.in                             |  1 +
 package/dtbocfg/Config.in                     |  9 +++++
 package/dtbocfg/dtbocfg.hash                  |  3 ++
 package/dtbocfg/dtbocfg.mk                    | 18 +++++++++
 support/testing/tests/package/test_dtbocfg.py | 37 +++++++++++++++++++
 6 files changed, 71 insertions(+)
 create mode 100644 package/dtbocfg/Config.in
 create mode 100644 package/dtbocfg/dtbocfg.hash
 create mode 100644 package/dtbocfg/dtbocfg.mk
 create mode 100644 support/testing/tests/package/test_dtbocfg.py
DEVELOPERS +3 -0
index 1f977190ab..ac14a11978 100644
@@ -1148,6 +1148,9 @@ F:	package/sysrepo/
 N:	Henrique Camargo <[email protected]>
 F:	package/json-glib/
 
+N:	Hervé Codina <[email protected]>
+F:	package/dtbocfg/
+
 N:	Hiroshi Kawashima <[email protected]>
 F:	package/gauche/
 F:	package/gmrender-resurrect/
package/Config.in +1 -0
index 2f83c87582..0ce2f64d8a 100644
@@ -460,6 +460,7 @@ endmenu
 	source "package/dmidecode/Config.in"
 	source "package/dmraid/Config.in"
 	source "package/dt-utils/Config.in"
+	source "package/dtbocfg/Config.in"
 	source "package/dtv-scan-tables/Config.in"
 	source "package/dump1090/Config.in"
 	source "package/dvb-apps/Config.in"
package/dtbocfg/Config.in new file +9 -0
new file mode 100644
index 0000000000..1e6ce3952d
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_DTBOCFG
+	bool "dtbocfg"
+	help
+	  dtbocfg, which stands for Device Tree Blob Overlay Configuration
+          File System, was developed to serve as a userspace API of Device
+          Tree Overlay.
+
+	  https://github.com/ikwzm/dtbocfg
+
package/dtbocfg/dtbocfg.hash new file +3 -0
new file mode 100644
index 0000000000..4312878c99
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  faa53aefd7f7636c65e2b56bec223d2bc7676354e3ad9b5c1691aca349b9bbb8  dtbocfg-v0.0.9.tar.gz
+sha256  e57cb9f2ed607cd95bf1b64371325c505c1ac8fe640a8c9933e7fe7637a38567  LICENSE
package/dtbocfg/dtbocfg.mk new file +18 -0
new file mode 100644
index 0000000000..bc1b8a1aba
@@ -0,0 +1,18 @@
+################################################################################
+#
+# dtbocfg
+#
+################################################################################
+
+DTBOCFG_VERSION = v0.0.9
+DTBOCFG_SITE = $(call github,ikwzm,dtbocfg,$(DTBOCFG_VERSION))
+DTBOCFG_LICENSE = BSD-2-Clause
+DTBOCFG_LICENSE_FILES = LICENSE
+
+define DTBOCFG_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_OF_OVERLAY)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_CONFIGFS_FS)
+endef
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
support/testing/tests/package/test_dtbocfg.py new file +37 -0
new file mode 100644
index 0000000000..d25b1692b4
@@ -0,0 +1,37 @@
+import os
+
+import infra.basetest
+
+
+class TestDtbocfg(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_LINUX_KERNEL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7"
+        BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+        BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
+        BR2_PACKAGE_DTBOCFG=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        img = os.path.join(self.builddir, "images", "rootfs.cpio")
+        kernel = os.path.join(self.builddir, "images", "zImage")
+        kernel_cmdline = ["console=ttyAMA0"]
+        dtb = infra.download(self.downloaddir, "vexpress-v2p-ca9.dtb")
+        options = ["-M", "vexpress-a9", "-dtb", dtb, "-initrd", img]
+
+        self.emulator.boot(arch="armv7", kernel=kernel,
+                           kernel_cmdline=kernel_cmdline,
+                           options=options)
+        self.emulator.login()
+        self.assertRunOk("modprobe dtbocfg.ko")
+        self.assertRunOk("mkdir /tmp/config && mount -t configfs none /tmp/config")
+
+        # Check that overlays directory is present.
+        # From dtbocfg site (https://github.com/ikwzm/dtbocfg):
+        #   If /config/device-tree/overlays is created, it is ready to use
+        #   dtbocfg
+        self.assertRunOk("ls /tmp/config/device-tree/overlays/")
Signature · 6 lines
2.31.1

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

Hello Hervé,

Thanks for this patch. Two small comments below.

package/dtbocfg/Config.in line 6

Quoted 12 lines · On Tue, 28 Sep 2021 10:23:28 +0200 Herve Codina <[email protected]>…
package/dtbocfg/Config.in new file +6 -0
new file mode 100644
index 0000000000..1e6ce3952d
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_DTBOCFG
+	bool "dtbocfg"
+	help
+	  dtbocfg, which stands for Device Tree Blob Overlay Configuration
+          File System, was developed to serve as a userspace API of Device
+          Tree Overlay.

There is an indentation issue here. The continuation lines should also have a one tab + 2 spaces indentation. I guess this is probably reported by "make check-package".

package/dtbocfg/Config.in line 8

Quoted 2 lines
package/dtbocfg/Config.in new file +2 -0
+DTBOCFG_VERSION = v0.0.9
+DTBOCFG_SITE = $(call github,ikwzm,dtbocfg,$(DTBOCFG_VERSION))

This should be:

DTBOCFG_VERSION = 0.0.9
DTBOCFG_SITE = $(call github,ikwzm,dtbocfg,v$(DTBOCFG_VERSION))

Indeed, we don't want the "v" prefix to appear in the version, so that the version can match with what release-monitoring.org reports.

support/testing/tests/package/test_dtbocfg.py

Quoted 5 lines
support/testing/tests/package/test_dtbocfg.py new file +0 -0
new file mode 100644
index 0000000000..d25b1692b4

Great, a test case!

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hello Thomas,

Quoted 5 lines · On Tue, 28 Sep 2021 10:51:35 +0200 Thomas Petazzoni…
Quoted 5 lines
package/dtbocfg/Config.in new file +2 -0
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_DTBOCFG
+	bool "dtbocfg"
Quoted 8 lines

package/dtbocfg/Config.in line 6

Quoted 4 lines
package/dtbocfg/Config.in new file +4 -0
+	help
+	  dtbocfg, which stands for Device Tree Blob Overlay Configuration
+          File System, was developed to serve as a userspace API of Device
+          Tree Overlay.  

There is an indentation issue here. The continuation lines should also have a one tab + 2 spaces indentation. I guess this is probably reported by "make check-package".

Indeed, will be fixed in v2.

Quoted 6 lines

package/dtbocfg/Config.in line 8

Quoted 3 lines
package/dtbocfg/Config.in new file +2 -0
+DTBOCFG_VERSION = v0.0.9
+DTBOCFG_SITE = $(call github,ikwzm,dtbocfg,$(DTBOCFG_VERSION))  

This should be:

Quoted 6 lines

DTBOCFG_VERSION = 0.0.9
DTBOCFG_SITE = $(call github,ikwzm,dtbocfg,v$(DTBOCFG_VERSION))

Indeed, we don't want the "v" prefix to appear in the version, so that the version can match with what release-monitoring.org reports.

Right, will be fixed in v2.

Thanks for the review,

Hervé

Signature · 7 lines
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot