kbuild: fix spurious initramfs rebuild
authorMaxime Bizon <mbizon@freebox.fr>
Mon, 9 Feb 2009 17:49:52 +0000 (18:49 +0100)
committerSam Ravnborg <sam@ravnborg.org>
Sat, 11 Apr 2009 06:18:12 +0000 (08:18 +0200)
When gen_initramfs_list is used to generate make dependencies, it
includes symbolic links, for which make tracks the link target. Any
change to that target will cause an initramfs rebuild, even if the
symlink points to something outside of the initramfs directory.

If the target happens to be /tmp, the rebuild occurs for each kernel
build, since gen_initramfs_list uses mktemp...

Proposed way to fix it is to omit symbolic links from generated
dependencies, but this has a small drawback: changing perm/owner on a
symlink will go unnoticed.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/gen_initramfs_list.sh

index 3eea8f1..76af5f9 100644 (file)
@@ -97,7 +97,7 @@ print_mtime() {
 }
 
 list_parse() {
-       echo "$1 \\"
+       [ ! -L "$1" ] && echo "$1 \\" || :
 }
 
 # for each file print a line in following format