From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 21 Jan 2022 09:07:20 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nAox6-008ZOx-P0 for lore@lore.pengutronix.de; Fri, 21 Jan 2022 09:07:20 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nAox6-0002Dd-4q; Fri, 21 Jan 2022 09:07:20 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAowv-0002DQ-Ng; Fri, 21 Jan 2022 09:07:09 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nAowv-00BWDA-Ih; Fri, 21 Jan 2022 09:07:08 +0100 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nAowt-008HWg-TG; Fri, 21 Jan 2022 09:07:07 +0100 Date: Fri, 21 Jan 2022 09:07:07 +0100 From: Michael Olbrich To: Christian Melki Message-ID: Mail-Followup-To: Christian Melki , ptxdist@pengutronix.de, flix.ptxdist@benfm.de References: <20220112133042.872717-1-christian.melki@t2data.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220112133042.872717-1-christian.melki@t2data.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] [PATCH v2] rootfs: Add possibility to add custom directories and files. X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de, flix.ptxdist@benfm.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Wed, Jan 12, 2022 at 02:30:42PM +0100, Christian Melki wrote: > 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. Nack. It's normal and expected to have some rules in your BSP. And it quite trivial to maintain. We even have a template to create rules to make it even easier. Michael > Signed-off-by: Christian Melki > --- > rules/rootfs.in | 33 +++++++++++++++++++++++++++++++++ > rules/rootfs.make | 13 +++++++++++++ > 2 files changed, 46 insertions(+) > > diff --git a/rules/rootfs.in b/rules/rootfs.in > index 34e9bdcff..dddb5ebe1 100644 > --- a/rules/rootfs.in > +++ b/rules/rootfs.in > @@ -257,6 +257,22 @@ config ROOTFS_VAR_TMP > available at run-time. > > endmenu > + > +config ROOTFS_CUSTOM_DIRS > + bool > + prompt "custom directories" > + help > + Create custom directories in the rootfs. Directories > + will be created from a file in the project conf directory, > + directories.cfg. Format: :. > + Multiple directories are separated by a newline. > + Use this if you want to add various directories, > + but do not wish to maintain a copy of a package file > + solely for that purpose. > + For example: > + /conf:0755 > + /conf/default:0700 > + > endif # ROOTFS > > # ---------------------------------------------------------------------------- > @@ -488,4 +504,21 @@ choice > If enabled, no /init will be install. > endchoice > > +config ROOTFS_CUSTOM_FILES > + bool > + prompt "custom files" > + help > + Copy custom files to the rootfs. Files will be > + created from a file in the project conf directory, > + files.cfg. Format: :. > + Multiple files are separated by a newline. > + Files are installed with the install_alternative mechanism. > + Use this if you want to add various scripts, data files, > + etc but do not wish to maintain a copy of a package file > + solely for that purpose. > + For example: > + /usr/share/data.cfg:0644 > + /etc/daemon.cfg:0644 > + /usr/bin/script.sh:0755 > + > endmenu > diff --git a/rules/rootfs.make b/rules/rootfs.make > index 1c1e5501c..715804cec 100644 > --- a/rules/rootfs.make > +++ b/rules/rootfs.make > @@ -145,6 +145,12 @@ ifdef PTXCONF_ROOTFS_VAR_OVERLAYFS > @$(call install_link, rootfs, ../var.mount, \ > /usr/lib/systemd/system/local-fs.target.requires/var.mount) > endif > +ifdef PTXCONF_ROOTFS_CUSTOM_DIRS > + @$(foreach customdir, $(shell cat $(call ptx/in-platformconfigdir, directories)), \ > + $(call install_copy, rootfs, 0, 0, \ > + $(word 2, $(subst :, ,$(customdir))), \ > + $(word 1, $(subst :, ,$(customdir))))$(ptx/nl)) > +endif > > # # > # # install files in rootfs > @@ -277,6 +283,13 @@ ifdef PTXCONF_ROOTFS_INIT_BIN > @$(call install_alternative, rootfs, 0, 0, 0755, /init) > endif > > +ifdef PTXCONF_ROOTFS_CUSTOM_FILES > + @$(foreach customfiles, $(shell cat $(call ptx/in-platformconfigdir, files)), \ > + $(call install_alternative, rootfs, 0, 0, \ > + $(word 2, $(subst :, ,$(customfiles))), \ > + $(word 1, $(subst :, ,$(customfiles))))$(ptx/nl)) > +endif > + > @$(call install_finish, rootfs) > > @$(call touch) > -- > 2.30.2 > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de