Skip to contentSkip to conversation

ntp: rename patches to follow BR guidelines

PATCH New Danomi Manchego 2 participants 6 messages Jul 18, 2014 – Jul 19, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ntp: rename patches to follow BR guidelines

---
 .../{ntp-adjtimex.patch => ntp-001-adjtimex.patch} |    0
 package/ntp/{ntp-nano.patch => ntp-002-nano.patch} |    0
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename package/ntp/{ntp-adjtimex.patch => ntp-001-adjtimex.patch} (100%)
 rename package/ntp/{ntp-nano.patch => ntp-002-nano.patch} (100%)
package/ntp/ntp-001-adjtimex.patch renamed from package/ntp/ntp-adjtimex.patch +0 -0
similarity index 100%
rename from package/ntp/ntp-adjtimex.patch
rename to package/ntp/ntp-001-adjtimex.patch
package/ntp/ntp-002-nano.patch renamed from package/ntp/ntp-nano.patch +0 -0
similarity index 100%
rename from package/ntp/ntp-nano.patch
rename to package/ntp/ntp-002-nano.patch
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/2 ntp: prevent keyword-gen failure during ntp_keyword.h check

During the first compile, the keyword-gen check is not run. However, it gets run on the first rebuild. Because we are cross-compiling, the keyword-gen can't run on the host. Since this is only used to check if ntp_keyword.h is up to date, we simply drop the check altogether.

---

Note: "the first rebuild" means "the first 'make ntp-rebuild'"

---
 package/ntp/ntp-003-skip-keyword-check.patch |   56 ++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/ntp/ntp-003-skip-keyword-check.patch
package/ntp/ntp-003-skip-keyword-check.patch new file +56 -0
new file mode 100644
index 0000000..dc09fbc
@@ -0,0 +1,56 @@
+ntp: prevent keyword-gen failure during ntp_keyword.h check
+
+During the first compile, the keyword-gen check is not run.  However,
+it gets run on the first rebuild.  Because we are cross-compiling, the
+keyword-gen can't run on the host.  Since this is only used to check if
+ntp_keyword.h is up to date, we simply drop the check altogether.
+
+Signed-off-by: Danomi Manchego <[email protected]>
+
+
+diff -purN a/ntpd/Makefile.am b/ntpd/Makefile.am
+--- a/ntpd/Makefile.am	2014-07-16 15:16:30.650280205 -0400
++++ b/ntpd/Makefile.am	2014-07-16 15:24:57.256527446 -0400
+@@ -213,17 +213,8 @@ libntpd_a_SOURCES =		\
+ 	refclock_zyfer.c	\
+ 	$(NULL)
+ 
+-k-g-u-submake: keyword-gen
+-	./keyword-gen $(srcdir)/ntp_parser.h > k-g.out
+-	@grep -v diff_ignore_line < k-g.out > cmp1
+-	@grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2
+-	@cmp cmp1 cmp2 > /dev/null || \
+-		{ mv -f k-g.out $(srcdir)/ntp_keyword.h && \
+-		  echo 'Generated changed ntp_keyword.h.' ;}
+-	@[ ! -f k-g.out ] || \
+-		{ rm k-g.out && echo 'ntp_keyword.h is up to date.' ;}
+-	@rm cmp1 cmp2
+-	@echo 'keyword-gen and ntp_keyword.h are up to date.' > $@
++k-g-u-submake:
++	# Skip keyword-gen check due to cross-compile
+ 
+ $(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h
+ 	$(MAKE) k-g-u-submake	# avoid explicit dependency
+diff -purN a/ntpd/Makefile.in b/ntpd/Makefile.in
+--- a/ntpd/Makefile.in	2014-07-16 15:16:30.650280205 -0400
++++ b/ntpd/Makefile.in	2014-07-16 15:25:08.764962071 -0400
+@@ -1182,17 +1182,8 @@ vphack_after:
+ check-local: @MAKE_CHECK_Y2K@ $(CHECK_SAVECONFIG)
+ 	test -z "@MAKE_CHECK_Y2K@" || ./@MAKE_CHECK_Y2K@
+ 
+-k-g-u-submake: keyword-gen
+-	./keyword-gen $(srcdir)/ntp_parser.h > k-g.out
+-	@grep -v diff_ignore_line < k-g.out > cmp1
+-	@grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2
+-	@cmp cmp1 cmp2 > /dev/null || \
+-		{ mv -f k-g.out $(srcdir)/ntp_keyword.h && \
+-		  echo 'Generated changed ntp_keyword.h.' ;}
+-	@[ ! -f k-g.out ] || \
+-		{ rm k-g.out && echo 'ntp_keyword.h is up to date.' ;}
+-	@rm cmp1 cmp2
+-	@echo 'keyword-gen and ntp_keyword.h are up to date.' > $@
++k-g-u-submake:
++	# Skip keyword-gen check due to cross-compile
+ 
+ $(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h
+ 	$(MAKE) k-g-u-submake	# avoid explicit dependency
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 ntp: prevent keyword-gen failure during ntp_keyword.h check

Dear Danomi Manchego,

Quoted 6 lines · Danomi Manchego

During the first compile, the keyword-gen check is not run. However, it gets run on the first rebuild. Because we are cross-compiling, the keyword-gen can't run on the host. Since this is only used to check if ntp_keyword.h is up to date, we simply drop the check altogether.

I haven't applied this one, because I'm not entirely satisfied by the explanation here. Why isn't the keyword-gen check executed on the first run? I did some testing, and I indeed don't see the rule about ntp_keyword.h being evaluated on the first build. Do you have more details about what makes the difference between the first and subsequent builds?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 ntp: prevent keyword-gen failure during ntp_keyword.h check

Quoted 8 lines · Thomas Petazzoni

Dear Danomi Manchego,

Quoted 5 lines · Danomi Manchego

During the first compile, the keyword-gen check is not run. However, it gets run on the first rebuild. Because we are cross-compiling, the keyword-gen can't run on the host. Since this is only used to check if ntp_keyword.h is up to date, we simply drop the check altogether.

Quoted 8 lines
Quoted 1 line

I haven't applied this one, because I'm not entirely satisfied by the explanation here. Why isn't the keyword-gen check executed on the first run? I did some testing, and I indeed don't see the rule about ntp_keyword.h being evaluated on the first build. Do you have more details about what makes the difference between the first and subsequent builds?

No. Stranger yet, when the patch is applied, I found that the keyword-gen check is only run on the *first* ntp-rebuild. Further ntp-rebuilds do not cause the check to re-occur.

But anyway, I didn't notice any indication that the keyword-gen would be compiled with a HOSTCC, so I reasoned that if it's cross-compiled, then it shouldn't be run on the build machine in any circumstance. So I didn't investigate further.

Danomi -

#4 lore raw

PATCH 2/2 ntp: prevent keyword-gen failure during ntp_keyword.h check

Dear Danomi Manchego,

Quoted 7 lines · Danomi Manchego
Quoted 6 lines

I haven't applied this one, because I'm not entirely satisfied by the explanation here. Why isn't the keyword-gen check executed on the first run? I did some testing, and I indeed don't see the rule about ntp_keyword.h being evaluated on the first build. Do you have more details about what makes the difference between the first and subsequent builds?

Quoted 8 lines

No. Stranger yet, when the patch is applied, I found that the keyword-gen check is only run on the *first* ntp-rebuild. Further ntp-rebuilds do not cause the check to re-occur.

But anyway, I didn't notice any indication that the keyword-gen would be compiled with a HOSTCC, so I reasoned that if it's cross-compiled, then it shouldn't be run on the build machine in any circumstance. So I didn't investigate further.

Right, but the ntp source code comes with a pre-generated result of this keyword-gen program, which allows the first build to work properly. So it'd be good to understand why this logic used for the first build doesn't work for the subsequent builds.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/2 ntp: rename patches to follow BR guidelines

In reply to Danomi Manchego

Dear Danomi Manchego,

Quoted 7 lines · Danomi Manchego
---
 .../{ntp-adjtimex.patch => ntp-001-adjtimex.patch} |    0
 package/ntp/{ntp-nano.patch => ntp-002-nano.patch} |    0
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename package/ntp/{ntp-adjtimex.patch => ntp-001-adjtimex.patch} (100%)
 rename package/ntp/{ntp-nano.patch => ntp-002-nano.patch} (100%)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com