All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut)
@ 2022-09-20 18:37 Yann E. MORIN
  2022-09-20 18:37 ` [Buildroot] [PATCH 1/2] fs/cpio: allow users to provide their own dracut modules Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yann E. MORIN @ 2022-09-20 18:37 UTC (permalink / raw)
  To: buildroot; +Cc: Thierry Bultel, Adam Duskett, Yann E . MORIN

Hello All!

Follow-up to the dracut addition, this two-patch series adds support for
providing extra dracut modules, and extends the cpio+dracut runtime test
accordingly.

Regards,
Yann E. MORIN.

Regards,
Yann E. MORIN.


----------------------------------------------------------------
Yann E. MORIN (2):
      fs/cpio: allow users to provide their own dracut modules
      support/tests/cpio: extend runtime tests for extra dract modules

 fs/cpio/Config.in                                            |  5 +++++
 fs/cpio/cpio.mk                                              | 12 +++++++++++-
 support/testing/tests/fs/test_cpio.py                        |  5 ++++-
 .../tests/fs/test_cpio/modules/99cramfs/module-setup.sh      | 11 +++++++++++
 4 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100755 support/testing/tests/fs/test_cpio/modules/99cramfs/module-setup.sh

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] fs/cpio: allow users to provide their own dracut modules
  2022-09-20 18:37 [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut) Yann E. MORIN
@ 2022-09-20 18:37 ` Yann E. MORIN
  2022-09-20 18:37 ` [Buildroot] [PATCH 2/2] support/tests/cpio: extend runtime tests for extra dract modules Yann E. MORIN
  2023-02-06 21:39 ` [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut) Thomas Petazzoni via buildroot
  2 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2022-09-20 18:37 UTC (permalink / raw)
  To: buildroot; +Cc: Adam Duskett, Yann E. MORIN, Thierry Bultel

Dracut modules can only be looked for in HOST_DIR/lib/dracut/modules.d/
as dracut does not offer the possibility to look elsewhere.

Installing files in HOST_DIR/ can do done either from a host-package, or
via a post-built script; there is no overlay like there is for target/.
This is a bit cumbersome.

Additional modules are most probably developped in a relatively tight
loop with the configuration files, so it makes sense to expose both
close together.

Add an option to the fs/cpio filesystem, so users can point to a list
of modules to install.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Thierry Bultel <thierry.bultel@linatsea.fr>
Cc: Adam Duskett <aduskett@gmail.com>
---
 fs/cpio/Config.in |  5 +++++
 fs/cpio/cpio.mk   | 12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in
index bec2d9dca2..4d38276c88 100644
--- a/fs/cpio/Config.in
+++ b/fs/cpio/Config.in
@@ -29,6 +29,11 @@ endchoice
 
 if BR2_TARGET_ROOTFS_CPIO_DRACUT
 
+config BR2_TARGET_ROOTFS_CPIO_DRACUT_MODULES
+	string "extra dracut modules"
+	help
+	  Space-separated list of directories containing dracut modules.
+
 config BR2_TARGET_ROOTFS_CPIO_DRACUT_CONF_FILES
 	string "dracut configuration files"
 	default "fs/cpio/dracut.conf"
diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
index d671c337df..04c8f49013 100644
--- a/fs/cpio/cpio.mk
+++ b/fs/cpio/cpio.mk
@@ -50,6 +50,13 @@ else ifeq ($(BR2_TARGET_ROOTFS_CPIO_DRACUT),y)
 
 ROOTFS_CPIO_DEPENDENCIES += host-dracut
 
+ROOTFS_CPIO_DRACUT_MODULES = $(call qstrip,$(BR2_TARGET_ROOTFS_CPIO_DRACUT_MODULES))
+ifeq ($(BR_BUILDING),y)
+ifneq ($(words $(ROOTFS_CPIO_DRACUT_MODULES)),$(words $(sort $(notdir $(ROOTFS_CPIO_DRACUT_MODULES)))))
+$(error No two dracut modules can have the same basename, check your BR2_TARGET_ROOTFS_CPIO_DRACUT_MODULES setting)
+endif
+endif
+
 ROOTFS_CPIO_DRACUT_CONF_FILES = $(call qstrip,$(BR2_TARGET_ROOTFS_CPIO_DRACUT_CONF_FILES))
 ifeq ($(BR_BUILDING),y)
 ifeq ($(ROOTFS_CPIO_DRACUT_CONF_FILES),)
@@ -68,10 +75,13 @@ ROOTFS_CPIO_OPTS += --no-kernel
 endif
 
 define ROOTFS_CPIO_CMD
-	mkdir -p $(ROOTFS_CPIO_DIR)/tmp $(ROOTFS_CPIO_DIR)/confdir
+	mkdir -p $(ROOTFS_CPIO_DIR)/tmp $(ROOTFS_CPIO_DIR)/confdir $(HOST_DIR)/lib/dracut/modules.d
 	$(foreach cfg,$(ROOTFS_CPIO_DRACUT_CONF_FILES), \
 		cp $(cfg) $(ROOTFS_CPIO_DIR)/confdir/$(notdir $(cfg))
 	)
+	$(foreach m,$(ROOTFS_CPIO_DRACUT_MODULES), \
+		cp -a $(m)/* $(HOST_DIR)/lib/dracut/modules.d/
+	)
 	$(HOST_DIR)/bin/dracut \
 		$(ROOTFS_CPIO_OPTS) \
 		-c /dev/null \
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] support/tests/cpio: extend runtime tests for extra dract modules
  2022-09-20 18:37 [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut) Yann E. MORIN
  2022-09-20 18:37 ` [Buildroot] [PATCH 1/2] fs/cpio: allow users to provide their own dracut modules Yann E. MORIN
@ 2022-09-20 18:37 ` Yann E. MORIN
  2023-02-06 21:39 ` [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut) Thomas Petazzoni via buildroot
  2 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2022-09-20 18:37 UTC (permalink / raw)
  To: buildroot; +Cc: Adam Duskett, Yann E. MORIN, Thierry Bultel

Add a basic module that installs a single file, to check that it is
properly accounted for.

Reported-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thierry Bultel <thierry.bultel@linatsea.fr>
Cc: Adam Duskett <aduskett@gmail.com>
---
 support/testing/tests/fs/test_cpio.py                 |  5 ++++-
 .../fs/test_cpio/modules/99cramfs/module-setup.sh     | 11 +++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100755 support/testing/tests/fs/test_cpio/modules/99cramfs/module-setup.sh

diff --git a/support/testing/tests/fs/test_cpio.py b/support/testing/tests/fs/test_cpio.py
index 8c0d357994..172af579bb 100644
--- a/support/testing/tests/fs/test_cpio.py
+++ b/support/testing/tests/fs/test_cpio.py
@@ -41,9 +41,11 @@ class TestCpioDracutBase(infra.basetest.BRTest):
         BR2_PACKAGE_PV=y
         BR2_TARGET_ROOTFS_CPIO=y
         BR2_TARGET_ROOTFS_CPIO_DRACUT=y
+        BR2_TARGET_ROOTFS_CPIO_DRACUT_MODULES="{}"
         BR2_TARGET_ROOTFS_CPIO_DRACUT_CONF_FILES="{}"
         # BR2_TARGET_ROOTFS_TAR is not set
-        """.format(" ".join(["fs/cpio/dracut.conf",
+        """.format("support/testing/tests/fs/test_cpio/modules",
+                   " ".join(["fs/cpio/dracut.conf",
                              "support/testing/tests/fs/test_cpio/dracut-cramfs.conf"]))
 
     def check_dracut(self):
@@ -57,6 +59,7 @@ class TestCpioDracutBase(infra.basetest.BRTest):
         self.assertEqual(out.find("bin/pv"), -1)
         # libz should be, because of cramfs
         self.assertNotEqual(out.find("usr/bin/mkcramfs"), -1)
+        self.assertNotEqual(out.find("usr/bin/cramfsck"), -1)
         self.assertNotEqual(out.find("usr/lib/libz.so"), -1)
 
         exit_code = boot_img(self.emulator,
diff --git a/support/testing/tests/fs/test_cpio/modules/99cramfs/module-setup.sh b/support/testing/tests/fs/test_cpio/modules/99cramfs/module-setup.sh
new file mode 100755
index 0000000000..60706c8bd9
--- /dev/null
+++ b/support/testing/tests/fs/test_cpio/modules/99cramfs/module-setup.sh
@@ -0,0 +1,11 @@
+check() {
+    return 0
+}
+
+depends() {
+    return 0
+}
+
+install() {
+    inst_multiple /usr/bin/cramfsck
+}
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut)
  2022-09-20 18:37 [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut) Yann E. MORIN
  2022-09-20 18:37 ` [Buildroot] [PATCH 1/2] fs/cpio: allow users to provide their own dracut modules Yann E. MORIN
  2022-09-20 18:37 ` [Buildroot] [PATCH 2/2] support/tests/cpio: extend runtime tests for extra dract modules Yann E. MORIN
@ 2023-02-06 21:39 ` Thomas Petazzoni via buildroot
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-02-06 21:39 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Adam Duskett, Thierry Bultel, buildroot

On Tue, 20 Sep 2022 20:37:09 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Yann E. MORIN (2):
>       fs/cpio: allow users to provide their own dracut modules
>       support/tests/cpio: extend runtime tests for extra dract modules

Both finally applied. Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-06 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-20 18:37 [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut) Yann E. MORIN
2022-09-20 18:37 ` [Buildroot] [PATCH 1/2] fs/cpio: allow users to provide their own dracut modules Yann E. MORIN
2022-09-20 18:37 ` [Buildroot] [PATCH 2/2] support/tests/cpio: extend runtime tests for extra dract modules Yann E. MORIN
2023-02-06 21:39 ` [Buildroot] [PATCH 0/2] dracut: extend support and tests (branch yem/dracut) Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.