2021-05-07 08:33:06 +02:00
|
|
|
diff -Naur drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/gen_compat_patch.sh
|
|
|
|
--- drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh 2021-05-07 11:24:44.877547149 +0800
|
|
|
|
+++ drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/gen_compat_patch.sh 2021-05-07 12:30:58.385703306 +0800
|
|
|
|
@@ -44,9 +44,19 @@
|
2020-10-12 07:30:03 +02:00
|
|
|
|
|
|
|
if hash spatch && spatch_is_recent; then
|
|
|
|
K=$(cat $incdir/kernelrelease.txt)
|
2021-05-07 08:33:06 +02:00
|
|
|
+
|
2020-10-12 07:30:03 +02:00
|
|
|
+ echo " compat.h content ";
|
|
|
|
+ cat $incdir/compat.h;
|
|
|
|
+ echo " ------------------- ";
|
2021-05-07 08:33:06 +02:00
|
|
|
+
|
2020-10-12 07:30:03 +02:00
|
|
|
echo " GENPATCHNAMES "$K
|
|
|
|
gcc -I $incdir -o $incdir/gen_patch_names -std=c99 drbd-kernel-compat/gen_patch_names.c
|
|
|
|
$incdir/gen_patch_names > $incdir/applied_cocci_files.txt
|
2021-05-07 08:33:06 +02:00
|
|
|
+
|
2020-10-12 07:30:03 +02:00
|
|
|
+ echo " APPLIED_COCCI_FILES ";
|
|
|
|
+ cat $incdir/applied_cocci_files.txt;
|
|
|
|
+ echo " ------------------- ";
|
2021-05-07 08:33:06 +02:00
|
|
|
+
|
2020-10-12 07:30:03 +02:00
|
|
|
rm $incdir/gen_patch_names
|
|
|
|
rm -f $incdir/.compat.cocci
|
|
|
|
rm -f $incdir/.compat.patch
|
2021-05-07 08:33:06 +02:00
|
|
|
@@ -67,7 +77,15 @@
|
2019-10-11 05:26:45 +02:00
|
|
|
< drbd-kernel-compat/cocci/debugfs_compat_template.cocci.in \
|
2020-02-25 10:53:38 +01:00
|
|
|
>> $incdir/.compat.cocci
|
|
|
|
done
|
2019-10-11 05:26:45 +02:00
|
|
|
+
|
|
|
|
+ coccilibpath=$(rpm -ql coccinelle|grep standard.h|xargs dirname);
|
|
|
|
+ echo " SPATCH_SOURCES: "$*;
|
|
|
|
+ echo " COCCI_LIBPATH: "$coccilibpath;
|
2020-02-25 10:53:38 +01:00
|
|
|
+
|
|
|
|
if [ -e $incdir/.compat.cocci ]; then
|
2021-05-07 08:33:06 +02:00
|
|
|
+ echo " GENCOCCIRULES .compat.cocci";
|
|
|
|
+ cat $incdir/.compat.cocci;
|
|
|
|
+
|
|
|
|
echo " SPATCH $chksum "$K
|
|
|
|
# Note: $* (or $@) is NOT make magic variable now, this is a shell script
|
|
|
|
# make $@, the target file, was passed as $1, and is now $compat_patch
|
|
|
|
@@ -77,8 +95,14 @@
|
|
|
|
# we know we don't have white-space in the argument list
|
2020-10-12 07:30:03 +02:00
|
|
|
|
2021-05-07 08:33:06 +02:00
|
|
|
set +e
|
2020-02-25 10:53:38 +01:00
|
|
|
+
|
2021-05-07 08:33:06 +02:00
|
|
|
+ command="spatch --sp-file $incdir/.compat.cocci $@ --macro-file drbd-kernel-compat/cocci_macros.h --macro-file-builtins $coccilibpath/standard.h --iso-file $coccilibpath/standard.iso --very-quiet --all-includes > $compat_patch.tmp 2> $incdir/.spatch.stderr"
|
|
|
|
+ echo " SPATCH COMMAND $command ";
|
|
|
|
+
|
|
|
|
spatch --sp-file "$incdir/.compat.cocci" "$@" \
|
|
|
|
--macro-file drbd-kernel-compat/cocci_macros.h \
|
|
|
|
+ --macro-file-builtins $coccilibpath/standard.h \
|
|
|
|
+ --iso-file $coccilibpath/standard.iso \
|
|
|
|
--very-quiet \
|
|
|
|
--all-includes \
|
|
|
|
> "$compat_patch.tmp" \
|
|
|
|
@@ -94,9 +118,21 @@
|
|
|
|
echo " SPATCH $chksum "$K" - nothing to do"
|
|
|
|
touch $compat_patch.tmp
|
|
|
|
fi
|
2019-10-11 05:26:45 +02:00
|
|
|
+
|
|
|
|
+ echo " GENSPATCHFILE $compat_patch.tmp ";
|
|
|
|
+ cat $compat_patch.tmp;
|
|
|
|
+
|
|
|
|
if [ -e $incdir/.compat.patch ]; then
|
2021-05-07 08:33:06 +02:00
|
|
|
+ echo " EXIST $incdir/.compat.patch ";
|
2020-02-25 10:53:38 +01:00
|
|
|
cat $incdir/.compat.patch >> $compat_patch.tmp
|
2021-05-07 08:33:06 +02:00
|
|
|
+ cat $compat_patch.tmp;
|
2020-02-25 10:53:38 +01:00
|
|
|
fi
|
2021-05-07 08:33:06 +02:00
|
|
|
+
|
|
|
|
+ if [ -e $incdir/.spatch.stderr ]; then
|
|
|
|
+ echo " GENSPATCHERR .spatch.stderr";
|
|
|
|
+ cat $incdir/.spatch.stderr;
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
mv $compat_patch.tmp $compat_patch
|
|
|
|
# keep it around
|
|
|
|
# to better be able to match the "stderr" warnings to their source files
|