* [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash @ 2021-04-01 8:36 Steffen Trumtrar 2021-04-01 8:36 ` [ptxdist] [PATCH v3 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Steffen Trumtrar @ 2021-04-01 8:36 UTC (permalink / raw) To: ptxdist Add a script to determine a uniquely abbreviated commit object of the current bsp state. The information is exported to the variable PTXDIST_VCS_VERSION so it can be used from other scripts and rules. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> --- changes in v3: - redirect stderr on second git call, too - fix PTXDIST_BUILD_VERSION_VCS -> PTXDIST_VCS_VERSION - fix whitespace on indent changes in v2: - use "--tags" in git describe scripts/lib/ptxd_make_vcs_version.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/lib/ptxd_make_vcs_version.sh diff --git a/scripts/lib/ptxd_make_vcs_version.sh b/scripts/lib/ptxd_make_vcs_version.sh new file mode 100644 index 000000000000..338658aa789f --- /dev/null +++ b/scripts/lib/ptxd_make_vcs_version.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# +# Copyright (C) 2020 by Steffen Trumtrar <s.trumtrar@pengutronix.de> +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +ptxd_make_vcs_version() { + PTXDIST_VCS_VERSION="$(echo \ + $(git describe 2>/dev/null || \ + git describe --always --tags 2>/dev/null))" + + if [ -z "${PTXDIST_VCS_VERSION}" ]; then + PTXDIST_VCS_VERSION="unknown" + fi + + export PTXDIST_VCS_VERSION +} +export -f ptxd_make_vcs_version + +ptxd_make_vcs_version -- 2.29.2 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 7+ messages in thread
* [ptxdist] [PATCH v3 2/2] rules: barebox: support barebox buildsystem_version 2021-04-01 8:36 [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar @ 2021-04-01 8:36 ` Steffen Trumtrar 2021-04-09 13:33 ` [ptxdist] [APPLIED] " Michael Olbrich 2021-04-04 17:16 ` [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber 2021-04-09 13:33 ` [ptxdist] [APPLIED] " Michael Olbrich 2 siblings, 1 reply; 7+ messages in thread From: Steffen Trumtrar @ 2021-04-01 8:36 UTC (permalink / raw) To: ptxdist barebox supports setting a buildsystem version. This is useful to have an exact buildsystem version like a commit hash accessible from barebox. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> --- platforms/barebox.in | 13 +++++++++++++ rules/barebox.make | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/platforms/barebox.in b/platforms/barebox.in index 70d175fb5a03..d35d165011b9 100644 --- a/platforms/barebox.in +++ b/platforms/barebox.in @@ -27,6 +27,19 @@ config BAREBOX_VERSION string default "2016.08.0" +config BAREBOX_CONFIG_BUILDSYSTEM_VERSION + prompt "add a buildsystem version to the barebox binary" + bool + help + When this option is enabled, the nv variable "nv.buildsystem_version" + in barebox is set to PTXCONF_BAREBOX_BUILDSYSTEM_VERSION. + +config BAREBOX_BUILDSYSTEM_VERSION + prompt "barebox buildsystem version" + depends on BAREBOX_CONFIG_BUILDSYSTEM_VERSION + string + default "${PTXDIST_VCS_VERSION}" + config BAREBOX_MD5 prompt "barebox source md5sum" string diff --git a/rules/barebox.make b/rules/barebox.make index 23c948408ab3..bea9f3adcbf8 100644 --- a/rules/barebox.make +++ b/rules/barebox.make @@ -46,6 +46,11 @@ BAREBOX_CONF_OPT := \ O=$(BAREBOX_BUILD_DIR) \ $(call barebox-opts, BAREBOX) +ifdef PTXCONF_BAREBOX_CONFIG_BUILDSYSTEM_VERSION +BAREBOX_CONF_OPT += \ + BUILDSYSTEM_VERSION=$(PTXCONF_BAREBOX_BUILDSYSTEM_VERSION) +endif + BAREBOX_MAKE_OPT := $(BAREBOX_CONF_OPT) BAREBOX_TAGS_OPT := TAGS tags cscope -- 2.29.2 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [APPLIED] rules: barebox: support barebox buildsystem_version 2021-04-01 8:36 ` [ptxdist] [PATCH v3 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar @ 2021-04-09 13:33 ` Michael Olbrich 0 siblings, 0 replies; 7+ messages in thread From: Michael Olbrich @ 2021-04-09 13:33 UTC (permalink / raw) To: ptxdist; +Cc: Steffen Trumtrar Thanks, applied as f5500c922424ee71dd99e80f743ed6d994e5bca6. Michael [sent from post-receive hook] On Fri, 09 Apr 2021 15:33:18 +0200, Steffen Trumtrar <s.trumtrar@pengutronix.de> wrote: > barebox supports setting a buildsystem version. This is useful to have > an exact buildsystem version like a commit hash accessible from barebox. > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> > Message-Id: <20210401083641.9251-2-s.trumtrar@pengutronix.de> > Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> > > diff --git a/platforms/barebox.in b/platforms/barebox.in > index 70d175fb5a03..d35d165011b9 100644 > --- a/platforms/barebox.in > +++ b/platforms/barebox.in > @@ -27,6 +27,19 @@ config BAREBOX_VERSION > string > default "2016.08.0" > > +config BAREBOX_CONFIG_BUILDSYSTEM_VERSION > + prompt "add a buildsystem version to the barebox binary" > + bool > + help > + When this option is enabled, the nv variable "nv.buildsystem_version" > + in barebox is set to PTXCONF_BAREBOX_BUILDSYSTEM_VERSION. > + > +config BAREBOX_BUILDSYSTEM_VERSION > + prompt "barebox buildsystem version" > + depends on BAREBOX_CONFIG_BUILDSYSTEM_VERSION > + string > + default "${PTXDIST_VCS_VERSION}" > + > config BAREBOX_MD5 > prompt "barebox source md5sum" > string > diff --git a/rules/barebox.make b/rules/barebox.make > index 23c948408ab3..bea9f3adcbf8 100644 > --- a/rules/barebox.make > +++ b/rules/barebox.make > @@ -46,6 +46,11 @@ BAREBOX_CONF_OPT := \ > O=$(BAREBOX_BUILD_DIR) \ > $(call barebox-opts, BAREBOX) > > +ifdef PTXCONF_BAREBOX_CONFIG_BUILDSYSTEM_VERSION > +BAREBOX_CONF_OPT += \ > + BUILDSYSTEM_VERSION=$(PTXCONF_BAREBOX_BUILDSYSTEM_VERSION) > +endif > + > BAREBOX_MAKE_OPT := $(BAREBOX_CONF_OPT) > > BAREBOX_TAGS_OPT := TAGS tags cscope _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash 2021-04-01 8:36 [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar 2021-04-01 8:36 ` [ptxdist] [PATCH v3 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar @ 2021-04-04 17:16 ` Roland Hieber 2021-04-07 14:43 ` Michael Olbrich 2021-04-09 13:33 ` [ptxdist] [APPLIED] " Michael Olbrich 2 siblings, 1 reply; 7+ messages in thread From: Roland Hieber @ 2021-04-04 17:16 UTC (permalink / raw) To: Steffen Trumtrar; +Cc: ptxdist On Thu, Apr 01, 2021 at 10:36:40AM +0200, Steffen Trumtrar wrote: > Add a script to determine a uniquely abbreviated commit object of the > current bsp state. The information is exported to the variable > PTXDIST_VCS_VERSION so it can be used from other scripts and rules. > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> > --- > changes in v3: > - redirect stderr on second git call, too > - fix PTXDIST_BUILD_VERSION_VCS -> PTXDIST_VCS_VERSION > - fix whitespace on indent > > changes in v2: > - use "--tags" in git describe > > scripts/lib/ptxd_make_vcs_version.sh | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > create mode 100644 scripts/lib/ptxd_make_vcs_version.sh > > diff --git a/scripts/lib/ptxd_make_vcs_version.sh b/scripts/lib/ptxd_make_vcs_version.sh > new file mode 100644 > index 000000000000..338658aa789f > --- /dev/null > +++ b/scripts/lib/ptxd_make_vcs_version.sh > @@ -0,0 +1,22 @@ > +#!/bin/bash > +# > +# Copyright (C) 2020 by Steffen Trumtrar <s.trumtrar@pengutronix.de> > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +ptxd_make_vcs_version() { > + PTXDIST_VCS_VERSION="$(echo \ > + $(git describe 2>/dev/null || \ > + git describe --always --tags 2>/dev/null))" Hmm, why do you do an additional echo here when git-describe already outputs the thing? - Roland > + > + if [ -z "${PTXDIST_VCS_VERSION}" ]; then > + PTXDIST_VCS_VERSION="unknown" > + fi > + > + export PTXDIST_VCS_VERSION > +} > +export -f ptxd_make_vcs_version > + > +ptxd_make_vcs_version > -- > 2.29.2 -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash 2021-04-04 17:16 ` [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber @ 2021-04-07 14:43 ` Michael Olbrich 2021-04-08 5:58 ` Steffen Trumtrar 0 siblings, 1 reply; 7+ messages in thread From: Michael Olbrich @ 2021-04-07 14:43 UTC (permalink / raw) To: Steffen Trumtrar; +Cc: ptxdist, Roland Hieber On Sun, Apr 04, 2021 at 07:16:40PM +0200, Roland Hieber wrote: > On Thu, Apr 01, 2021 at 10:36:40AM +0200, Steffen Trumtrar wrote: > > Add a script to determine a uniquely abbreviated commit object of the > > current bsp state. The information is exported to the variable > > PTXDIST_VCS_VERSION so it can be used from other scripts and rules. > > > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> > > --- > > changes in v3: > > - redirect stderr on second git call, too > > - fix PTXDIST_BUILD_VERSION_VCS -> PTXDIST_VCS_VERSION > > - fix whitespace on indent > > > > changes in v2: > > - use "--tags" in git describe > > > > scripts/lib/ptxd_make_vcs_version.sh | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > create mode 100644 scripts/lib/ptxd_make_vcs_version.sh > > > > diff --git a/scripts/lib/ptxd_make_vcs_version.sh b/scripts/lib/ptxd_make_vcs_version.sh > > new file mode 100644 > > index 000000000000..338658aa789f > > --- /dev/null > > +++ b/scripts/lib/ptxd_make_vcs_version.sh > > @@ -0,0 +1,22 @@ > > +#!/bin/bash > > +# > > +# Copyright (C) 2020 by Steffen Trumtrar <s.trumtrar@pengutronix.de> > > +# > > +# For further information about the PTXdist project and license conditions > > +# see the README file. > > +# > > + > > +ptxd_make_vcs_version() { > > + PTXDIST_VCS_VERSION="$(echo \ > > + $(git describe 2>/dev/null || \ > > + git describe --always --tags 2>/dev/null))" > > Hmm, why do you do an additional echo here when git-describe already > outputs the thing? Steffen? I can do a local fixup to drop the echo, but I need to know if there is a reason to keep it. Michael > > + > > + if [ -z "${PTXDIST_VCS_VERSION}" ]; then > > + PTXDIST_VCS_VERSION="unknown" > > + fi > > + > > + export PTXDIST_VCS_VERSION > > +} > > +export -f ptxd_make_vcs_version > > + > > +ptxd_make_vcs_version > > -- > > 2.29.2 > > -- > Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | > Steuerwalder Str. 21 | https://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 > -- 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash 2021-04-07 14:43 ` Michael Olbrich @ 2021-04-08 5:58 ` Steffen Trumtrar 0 siblings, 0 replies; 7+ messages in thread From: Steffen Trumtrar @ 2021-04-08 5:58 UTC (permalink / raw) To: Michael Olbrich; +Cc: ptxdist, Roland Hieber Hi! Michael Olbrich <m.olbrich@pengutronix.de> writes: > On Sun, Apr 04, 2021 at 07:16:40PM +0200, Roland Hieber wrote: >> On Thu, Apr 01, 2021 at 10:36:40AM +0200, Steffen Trumtrar wrote: >> > Add a script to determine a uniquely abbreviated commit object of the >> > current bsp state. The information is exported to the variable >> > PTXDIST_VCS_VERSION so it can be used from other scripts and rules. >> > >> > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> >> > --- >> > changes in v3: >> > - redirect stderr on second git call, too >> > - fix PTXDIST_BUILD_VERSION_VCS -> PTXDIST_VCS_VERSION >> > - fix whitespace on indent >> > >> > changes in v2: >> > - use "--tags" in git describe >> > >> > scripts/lib/ptxd_make_vcs_version.sh | 22 ++++++++++++++++++++++ >> > 1 file changed, 22 insertions(+) >> > create mode 100644 scripts/lib/ptxd_make_vcs_version.sh >> > >> > diff --git a/scripts/lib/ptxd_make_vcs_version.sh b/scripts/lib/ptxd_make_vcs_version.sh >> > new file mode 100644 >> > index 000000000000..338658aa789f >> > --- /dev/null >> > +++ b/scripts/lib/ptxd_make_vcs_version.sh >> > @@ -0,0 +1,22 @@ >> > +#!/bin/bash >> > +# >> > +# Copyright (C) 2020 by Steffen Trumtrar <s.trumtrar@pengutronix.de> >> > +# >> > +# For further information about the PTXdist project and license conditions >> > +# see the README file. >> > +# >> > + >> > +ptxd_make_vcs_version() { >> > + PTXDIST_VCS_VERSION="$(echo \ >> > + $(git describe 2>/dev/null || \ >> > + git describe --always --tags 2>/dev/null))" >> >> Hmm, why do you do an additional echo here when git-describe already >> outputs the thing? > > Steffen? I can do a local fixup to drop the echo, but I need to know if > there is a reason to keep it. > > Michael > Please just drop the echo Michael. Looks like Roland is right and I just blindly copied from an other script without thinking. Just tested without the echo and works fine. Steffen -- Pengutronix e.K. | Dipl.-Inform. Steffen Trumtrar | Steuerwalder Str. 21 | https://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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ptxdist] [APPLIED] ptxd_make_vcs_version: add script to determine vcs hash 2021-04-01 8:36 [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar 2021-04-01 8:36 ` [ptxdist] [PATCH v3 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar 2021-04-04 17:16 ` [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber @ 2021-04-09 13:33 ` Michael Olbrich 2 siblings, 0 replies; 7+ messages in thread From: Michael Olbrich @ 2021-04-09 13:33 UTC (permalink / raw) To: ptxdist; +Cc: Steffen Trumtrar Thanks, applied as 669c4e26a1ccaeff28b0d21dbf9c079560d85fef. Michael [sent from post-receive hook] On Fri, 09 Apr 2021 15:33:17 +0200, Steffen Trumtrar <s.trumtrar@pengutronix.de> wrote: > Add a script to determine a uniquely abbreviated commit object of the > current bsp state. The information is exported to the variable > PTXDIST_VCS_VERSION so it can be used from other scripts and rules. > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> > Message-Id: <20210401083641.9251-1-s.trumtrar@pengutronix.de> > [mol: drop unnecessary 'echo'] > Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> > > diff --git a/scripts/lib/ptxd_make_vcs_version.sh b/scripts/lib/ptxd_make_vcs_version.sh > new file mode 100644 > index 000000000000..69e486ab31a5 > --- /dev/null > +++ b/scripts/lib/ptxd_make_vcs_version.sh > @@ -0,0 +1,21 @@ > +#!/bin/bash > +# > +# Copyright (C) 2020 by Steffen Trumtrar <s.trumtrar@pengutronix.de> > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +ptxd_make_vcs_version() { > + PTXDIST_VCS_VERSION="$(git describe 2>/dev/null || \ > + git describe --always --tags 2>/dev/null)" > + > + if [ -z "${PTXDIST_VCS_VERSION}" ]; then > + PTXDIST_VCS_VERSION="unknown" > + fi > + > + export PTXDIST_VCS_VERSION > +} > +export -f ptxd_make_vcs_version > + > +ptxd_make_vcs_version _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-04-09 13:33 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-04-01 8:36 [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar 2021-04-01 8:36 ` [ptxdist] [PATCH v3 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar 2021-04-09 13:33 ` [ptxdist] [APPLIED] " Michael Olbrich 2021-04-04 17:16 ` [ptxdist] [PATCH v3 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber 2021-04-07 14:43 ` Michael Olbrich 2021-04-08 5:58 ` Steffen Trumtrar 2021-04-09 13:33 ` [ptxdist] [APPLIED] " Michael Olbrich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox