Skip to contentSkip to conversation

prepare-kernel shouldnt alter files thru links

PATCH In review Jim Cromie 2 participants 2 messages May 8, 2006

lore
Share & tools
lore

Jim Cromie

author
#0 lore raw

PATCH 1/1 prepare-kernel shouldnt alter files thru links

attached patch corrects a mistake in rev 985, which chmod'd a read-only file, even if it was a symlink from a kernel-tree cloned with lndir. This resulted in a bad original tree for use in building vanilla kernels.

with patch, script renames the symlink, copies it to the expected name,
and *then* chmods it, and appends to it. Now vanilla kernel builds also
using same tree re-make w/o actually recompiling anything.

prepare-kernel.sh +4 -0
Index: scripts/prepare-kernel.sh
===================================================================
@@ -48,6 +48,10 @@
 patch_append() {
     file="$1"
     if test "x$output_patch" = "x"; then
+	if test -L "$linux_tree/$file" ; then
+	    mv "$linux_tree/$file" "$linux_tree/$file.orig"
+	    cp "$linux_tree/$file.orig" "$linux_tree/$file"
+	fi
 	chmod +w "$linux_tree/$file"
         cat >> "$linux_tree/$file"
     else
#1 lore raw
Quoted 9 lines · Jim Cromie

attached patch corrects a mistake in rev 985, which chmod'd a read-only file, even if it was a symlink from a kernel-tree cloned with lndir. This resulted in a bad original tree for use in building vanilla kernels.

with patch, script renames the symlink, copies it to the expected name,
and *then* chmods it, and appends to it. Now vanilla kernel builds also
using same tree re-make w/o actually recompiling anything.

Sounds reasonable. Applied, thanks.

Signature · 1 line
Philippe.