mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash
@ 2021-03-30  7:52 Steffen Trumtrar
  2021-03-30  7:52 ` [ptxdist] [PATCH 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar
  2021-03-30  9:24 ` [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber
  0 siblings, 2 replies; 4+ messages in thread
From: Steffen Trumtrar @ 2021-03-30  7:52 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>
---
 scripts/lib/ptxd_make_vcs_version.sh | 20 ++++++++++++++++++++
 1 file changed, 20 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..680fb38ff818
--- /dev/null
+++ b/scripts/lib/ptxd_make_vcs_version.sh
@@ -0,0 +1,20 @@
+#!/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 --always))"
+
+    if [ -z "${PTXDIST_VCS_VERSION}" ]; then
+       PTXDIST_BUILD_VERSION_VCS="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] 4+ messages in thread

* [ptxdist] [PATCH 2/2] rules: barebox: support barebox buildsystem_version
  2021-03-30  7:52 [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar
@ 2021-03-30  7:52 ` Steffen Trumtrar
  2021-03-30  9:24 ` [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber
  1 sibling, 0 replies; 4+ messages in thread
From: Steffen Trumtrar @ 2021-03-30  7:52 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] 4+ messages in thread

* Re: [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash
  2021-03-30  7:52 [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar
  2021-03-30  7:52 ` [ptxdist] [PATCH 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar
@ 2021-03-30  9:24 ` Roland Hieber
  2021-03-30 13:25   ` Michael Olbrich
  1 sibling, 1 reply; 4+ messages in thread
From: Roland Hieber @ 2021-03-30  9:24 UTC (permalink / raw)
  To: Steffen Trumtrar; +Cc: ptxdist

On Tue, Mar 30, 2021 at 09:52:01AM +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>
> ---
>  scripts/lib/ptxd_make_vcs_version.sh | 20 ++++++++++++++++++++
>  1 file changed, 20 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..680fb38ff818
> --- /dev/null
> +++ b/scripts/lib/ptxd_make_vcs_version.sh
> @@ -0,0 +1,20 @@
> +#!/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 --always))"

Add a --tags here so it also uses non-annotated tags.

 - Roland

> +
> +    if [ -z "${PTXDIST_VCS_VERSION}" ]; then
> +       PTXDIST_BUILD_VERSION_VCS="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
> 

-- 
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] 4+ messages in thread

* Re: [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash
  2021-03-30  9:24 ` [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber
@ 2021-03-30 13:25   ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2021-03-30 13:25 UTC (permalink / raw)
  To: ptxdist

On Tue, Mar 30, 2021 at 11:24:36AM +0200, Roland Hieber wrote:
> On Tue, Mar 30, 2021 at 09:52:01AM +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>
> > ---
> >  scripts/lib/ptxd_make_vcs_version.sh | 20 ++++++++++++++++++++
> >  1 file changed, 20 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..680fb38ff818
> > --- /dev/null
> > +++ b/scripts/lib/ptxd_make_vcs_version.sh
> > @@ -0,0 +1,20 @@
> > +#!/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 --always))"
> 
> Add a --tags here so it also uses non-annotated tags.

That's always a bit problematic: I've seen projects that use annotated tags
for releases and other tags for random stuff. Maybe:

git describe 2>/dev/null || git describe --always --tags

Michael

>  - Roland
> 
> > +
> > +    if [ -z "${PTXDIST_VCS_VERSION}" ]; then
> > +       PTXDIST_BUILD_VERSION_VCS="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
> > 
> 
> -- 
> 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
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-30 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  7:52 [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Steffen Trumtrar
2021-03-30  7:52 ` [ptxdist] [PATCH 2/2] rules: barebox: support barebox buildsystem_version Steffen Trumtrar
2021-03-30  9:24 ` [ptxdist] [PATCH 1/2] ptxd_make_vcs_version: add script to determine vcs hash Roland Hieber
2021-03-30 13:25   ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox