From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-lb0-f172.google.com ([209.85.217.172]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1TU74S-0002CK-Jq for ptxdist@pengutronix.de; Fri, 02 Nov 2012 03:33:24 +0100 Received: by mail-lb0-f172.google.com with SMTP id k13so2507065lbo.31 for ; Thu, 01 Nov 2012 19:33:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5092DD86.1080501@lespocky.de> References: <5092DD86.1080501@lespocky.de> Date: Thu, 1 Nov 2012 19:33:14 -0700 Message-ID: From: Jeff Horn Subject: Re: [ptxdist] UBIFS generation question Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1032970228==" Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de --===============1032970228== Content-Type: multipart/alternative; boundary=e0cb4efe311826b8e004cd79f503 --e0cb4efe311826b8e004cd79f503 Content-Type: text/plain; charset=ISO-8859-1 Thanks Alex, I have it all working now. Jeff On Thu, Nov 1, 2012 at 1:37 PM, Alexander Dahl wrote: > Hei Jeff, > > On 01.11.2012 19:22, Jeff Horn wrote: > > echo $(shell git rev-parse --verify HEAD) > $(ROOTDIR)/etc/revision > > I personally use `git describe --tags` for this, but that's more a > question of taste. > > > That works fine for creating the file in the platform/root directory. > When > > I started to use the UBI image I noticed that file was missing from my > root > > filesystem. I see that the ubi.make script does a targetinstall to > > platform/images/working_dir and then generates the UBI image from there. > > Which obviously does not have my revision. How can I fix/modify my line > > above so it makes it into both the root directory and the UBI image. > > What about creating the file in projectroot/etc/revision, putting a > placeholder e.g. @REVISION@ in it and using something like this in your > rule: > > @$(call install_alternative, somepackage, 0, 0, 0644, \ > /etc/revision) > @$(call install_replace, somepackage, /etc/revision, \ > @REVISION@, $(shell git rev-pares --verify HEAD) ) > > Like this the file gets in the package file and should be installed in > the UBI image. We have a similar approach working in our BSP. > > Greets > Alex > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > > --e0cb4efe311826b8e004cd79f503 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Alex,

I have it all working now.

Jeff


On Thu, Nov 1, 2012 at 1:37 PM, Alexander Dahl <= post@lespocky.de&= gt; wrote:
Hei Jeff,

On 01.11.2012 19:22, Jeff Horn wrote:
> echo $(shell git rev-parse --verify HEAD) > $(ROOTDIR)/etc/revision=

I personally use `git describe --tags` for this, but that's more = a
question of taste.

> That works fine for creating the file in the platform/root directory. = =A0When
> I started to use the UBI image I noticed that file was missing from my= root
> filesystem. =A0I see that the ubi.make script does a targetinstall to<= br> > platform/images/working_dir and then generates the UBI image from ther= e.
> =A0Which obviously does not have my revision. =A0How can I fix/modify = my line
> above so it makes it into both the root directory and the UBI image.
What about creating the file in projectroot/etc/revision, putting a placeholder e.g. @REVISION@ in it and using something like this in your
rule:

=A0 @$(call install_alternative, somepackage, 0, 0, 0644, \
=A0 =A0 /etc/revision)
=A0 @$(call install_replace, somepackage, /etc/revision, \
=A0 =A0 @REVISION@, $(shell git rev-pares --verify HEAD) )

Like this the file gets in the package file and should be installed in
the UBI image. We have a similar approach working in our BSP.

Greets
Alex


--
ptxdist mailing list
ptxdist@pengutronix.de


--e0cb4efe311826b8e004cd79f503-- --===============1032970228== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ptxdist mailing list ptxdist@pengutronix.de --===============1032970228==--