Add two custom targets in the rootfs configuration.
Rationale behind this is that I often find myself maintaining
a copy of a package ruleset just to be able to copy a file or add
a directory.
These changes are often things that are project specific and
are useless upstream.
Now this type of project specific maintenance can go away.

Signed-off-by: Christian Melki <[email protected]>
---
 rules/rootfs.in   | 20 ++++++++++++++++++++
 rules/rootfs.make |  5 +++++
 2 files changed, 25 insertions(+)

diff --git a/rules/rootfs.in b/rules/rootfs.in
index 34e9bdcff..3183abc6b 100644
--- a/rules/rootfs.in
+++ b/rules/rootfs.in
@@ -257,6 +257,15 @@ config ROOTFS_VAR_TMP
          available at run-time.
 
 endmenu
+
+config ROOTFS_CUSTOM_DIRS
+       string "custom directories"
+       default ""
+       help
+         Create custom directories in the root filesystem.
+         Directories will be created with a standard 0755 permission.
+         Multiple directories can be specified, separated by spaces.
+
 endif # ROOTFS
 
 # ----------------------------------------------------------------------------
@@ -488,4 +497,15 @@ choice
                  If enabled, no /init will be install.
 endchoice
 
+config ROOTFS_CUSTOM_FILES
+       string "custom files"
+       default ""
+       help
+         Copy custom files from projectroot to the root filesystem.
+         Files will be created with a standard 0644 permission.
+         Multiple files can be specified, separated by spaces.
+         Use this if you want to add various scripts, data files,
+         etc but to not wish to maintain a copy of a package file
+         solely for that purpose.
+
 endmenu
diff --git a/rules/rootfs.make b/rules/rootfs.make
index 1c1e5501c..55fb06486 100644
--- a/rules/rootfs.make
+++ b/rules/rootfs.make
@@ -145,6 +145,8 @@ ifdef PTXCONF_ROOTFS_VAR_OVERLAYFS
        @$(call install_link, rootfs, ../var.mount, \
                /usr/lib/systemd/system/local-fs.target.requires/var.mount)
 endif
+       @$(foreach customdir, $(call 
remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_DIRS)), \
+               $(call install_copy, rootfs, 0, 0, 0755, $(customdir))$(ptx/nl))
 
 #      #
 #      # install files in rootfs
@@ -277,6 +279,9 @@ ifdef PTXCONF_ROOTFS_INIT_BIN
        @$(call install_alternative, rootfs, 0, 0, 0755, /init)
 endif
 
+       @$(foreach customfiles, $(call 
remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_FILES)), \
+               $(call install_alternative, rootfs, 0, 0, 0644, 
$(customfiles))$(ptx/nl))
+
        @$(call install_finish, rootfs)
 
        @$(call touch)
-- 
2.30.2


_______________________________________________
ptxdist mailing list
[email protected]
To unsubscribe, send a mail with subject "unsubscribe" to 
[email protected]

Reply via email to