From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 11 Jan 2022 15:17:22 +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 1n7Hxi-00GyVJ-Ff for lore@lore.pengutronix.de; Tue, 11 Jan 2022 15:17:22 +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 1n7Hxh-0002KP-Ov; Tue, 11 Jan 2022 15:17:21 +0100 Received: from mail.benfm.de ([2a01:238:435a:9a00:9878:863:66f:ea56] helo=h2956758.stratoserver.net) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7HxB-0002KE-7U for ptxdist@pengutronix.de; Tue, 11 Jan 2022 15:16:49 +0100 Message-ID: <27983a47-b8dc-b4d4-c62c-1f2eb7428781@benfm.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benfm.de; s=2020; t=1641910608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6BDySoW0xrgkE0cty2a+LUkBLlx5Z37++V4bq5qAkaQ=; b=kXBqZtuCIxq5rXryHuzI9DFcYDMd9EpC9+flaVu+KTNWFF0GG3mH0mSWhaJE37KEAK8AjC j1M6aNRcO/laT9raN0VJ2LIEBUfoHZjQ/z15bC+THeexsZoO2M+MrqGXJ7GFhg4m1qHLBn QNaGq3fVemkmnhgC15hevJnw6fuEExRUfOhW4yYzcvcoslxijogt3DMi5A8qsFtN7WP4+t gZcDoPIyaowQwbktr1VfSqZk77ONYXRHMO74/Ccbq7JRkgyz4XNhCZLVvJUkYmnq0XxR6L OWCiNB94o4GKXC/8MUb6YijRkoySoriFe2m5OVIX3dI+T0PpUguAeGpfMK3/ZA== Date: Tue, 11 Jan 2022 15:16:47 +0100 MIME-Version: 1.0 Content-Language: en-US To: ptxdist@pengutronix.de References: <20220111095848.835429-1-christian.melki@t2data.com> From: Felix Mellmann In-Reply-To: <20220111095848.835429-1-christian.melki@t2data.com> Authentication-Results: ORIGINATING; auth=pass smtp.auth=flix@benfm.de smtp.mailfrom=flix.ptxdist@benfm.de X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=4.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] [RFC: PATCH] 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 Thumbs up! I've never realized, that it would be so easy to get a universal solution for this common problem. Maybe one could extend this idea by using references to external text files (i.e. configs/files. and configs/directories.) which contain the file names/globs and directory names. Actually editing those information within menuconfig isn't really neat nowadays. Best regards, Felix On 11.01.22 10:58, 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. > > Signed-off-by: Christian Melki > --- > 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) _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de