lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <15447.1425431256@turing-police.cc.vt.edu>
Date:	Tue, 03 Mar 2015 20:07:36 -0500
From:	Valdis Kletnieks <Valdis.Kletnieks@...edu>
To:	akpm@...ux-foundation.org, linus@...ux-foundation.org
cc:	linux-kernel@...r.kernel.org
Subject: [RFC PATCH] Don't reset timestamps in include/generated if not needed

Kbuild regenerates bounds.h and asm-offsets.h, resetting the timestamps
and forcing rebuilds even if the contents haven't changed.  Add a bit of
shell magic to only replace the file if the contents have in fact changed,
which should speed up git bisects and similar.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@...edu>

---
So I was doing a git bisect, and getting towards the end, and wondering why
it's taking a long time for each build, and I notice that netfilter modules
are being rebuilt, even though 'git bisect visualize' doesn't show anything
that should have touched netfilter.  Turns out the offender is bounds.h

Fully 3/4 of my modules have a dependency on bounds.h - and we touch it
all the time, even if the contents haven't changed.

RFC because I can't wrap my head around why this wasn't done ages ago.
If I'm missing something something obvious, please apply a cluestick. :)

Lightly tested - if I rm one of those two files, it gets rebuilt. If I
insert some whitespace, it gets replaced. If I don't touch it, the datestamp
doesn't change.

--- linux-next/Kbuild.dist	2015-03-03 19:50:45.175673346 -0500
+++ linux-next/Kbuild	2015-03-03 20:03:20.107820199 -0500
@@ -15,7 +15,7 @@
 
 quiet_cmd_offsets = GEN     $@
 define cmd_offsets
-	(set -e; \
+	( (set -e; \
 	 echo "#ifndef $2"; \
 	 echo "#define $2"; \
 	 echo "/*"; \
@@ -26,7 +26,10 @@
 	 echo ""; \
 	 sed -ne $(sed-y) $<; \
 	 echo ""; \
-	 echo "#endif" ) > $@
+	 echo "#endif" ) > $@...p; \
+	 if [ ! -f $@ ]; then mv $@...p $@; \
+	 elif cmp -s $@ $@...p ; then rm $@...p; \
+	 else mv -f $@...p $@; fi )
 endef
 
 #####


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ