prepare-kernel.sh: Warn when result can be defective
PATCH v2 1/1 prepare-kernel.sh: Warn when result can be defective
If the target Linux source tree contains stale files which are owned by Xenomai, the result can be defective when --outpatch is used.
Detect such situations and warn the user to avoid crazy errors.
It happened to me twice that the resulting patch was faulty because my kernel tree contained old Xenomail related files. Hopefully this saves somebody else valuable debug time.
---
v1 tried to be smart in link mode too, but made things worse, this version adds only a warning for outpatch mode which is the use case I'm actually focusing on and initially faced problems.
--- scripts/prepare-kernel.sh | 3 +++ 1 file changed, 3 insertions(+)
scripts/prepare-kernel.sh +3 -0
@@ -126,6 +126,9 @@ patch_link() { fi else if test `check_filter $link_dir/$f` = "ok"; then + if test -e $linux_tree/$link_dir/$f; then + echo "$me: warning: $link_dir/$f already present in Linux kernel tree, output patch might be defective" >&2 + fi mkdir -p $temp_tree/$link_dir/$d cp $xenomai_root/$target_dir/$f $temp_tree/$link_dir/$f fi
Signature · 1 line
2.35.3
Jan Kiszka
AppliedQuoted 23 lines · Richard Weinberger
If the target Linux source tree contains stale files which are owned by Xenomai, the result can be defective when --outpatch is used.
Detect such situations and warn the user to avoid crazy errors.It happened to me twice that the resulting patch was faulty because my kernel tree contained old Xenomail related files. Hopefully this saves somebody else valuable debug time.
Signed-off-by Richard Weinberger <[email protected]>---
v1 tried to be smart in link mode too, but made things worse, this version adds only a warning for outpatch mode which is the use case I'm actually focusing on and initially faced problems.--- scripts/prepare-kernel.sh | 3 +++ 1 file changed, 3 insertions(+)scripts/prepare-kernel.sh +0
-0
scripts/prepare-kernel.sh patch_link() { · line 134
Quoted 9 lines
scripts/prepare-kernel.sh +3
-0@@ -126,6 +126,9 @@ patch_link() { fi else if test `check_filter $link_dir/$f` = "ok"; then + if test -e $linux_tree/$link_dir/$f; then + echo "$me: warning: $link_dir/$f already present in Linux kernel tree, output patch might be defective" >&2 + fi mkdir -p $temp_tree/$link_dir/$d cp $xenomai_root/$target_dir/$f $temp_tree/$link_dir/$f fi
Thanks, applied.
Jan
Signature · 2 lines
Siemens AG, Technology Linux Expert Center