Skip to contentSkip to conversation

fix spurious initramfs rebuild

PATCH Applied Maxime Bizon 2 participants 2 messages Feb 9, 2009 – Apr 10, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix spurious initramfs rebuild

Hello,

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.

scripts/gen_initramfs_list.sh renamed from scripts/gen_initramfs_list.sh.old +1 -1
@@ -97,7 +97,7 @@
 }
 
 list_parse() {
-	echo "$1 \\"
+	[ ! -L "$1" ] && echo "$1 \\" || :
 }
 
 # for each file print a line in following format
Signature · 1 line
Maxime
Applied
#1 lore raw
Quoted 23 lines · Maxime Bizon

Hello,

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.

scripts/gen_initramfs_list.sh line 103

Quoted 8 lines
scripts/gen_initramfs_list.sh renamed from scripts/gen_initramfs_list.sh.old +1 -1
@@ -97,7 +97,7 @@
 }
 
 list_parse() {
-	echo "$1 \\"
+	[ ! -L "$1" ] && echo "$1 \\" || :
 }
 
 # for each file print a line in following format

Applied.

Sam