diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index cc95d7a67..741ec4855 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -373,18 +373,32 @@ rm -rf "${tmpdir}" for s in ${separate_patches} do - fileset=$s - for f in $(set | grep "^$s=" | sed -e "s/^$s='\(.*\)'\$/\1/" -e "s/^$s=\(.*\)\$/\1/") - do - if [ "${f#scst/include}" != "${f}" ]; then - add_file "${f}" "include/scst/${f#scst/include/}" - elif [ "${f#doc}" != "${f}" ]; then - add_file "${f}" "Documentation/scst/${f#doc/}" - else - add_file "${f}" "drivers/scst/${f#scst/src/}" + { + fileset=$s + for f in $(set | grep "^$s=" | sed -e "s/^$s='\(.*\)'\$/\1/" -e "s/^$s=\(.*\)\$/\1/") + do + if [ "${f#scst/include}" != "${f}" ]; then + add_file "${f}" "include/scst/${f#scst/include/}" + elif [ "${f#doc}" != "${f}" ]; then + add_file "${f}" "Documentation/scst/${f#doc/}" + else + add_file "${f}" "drivers/scst/${f#scst/src/}" + fi + done + if [ "$s" = "scst_03_public_headers" ]; then + tmp_itf_ver="$(mktemp /tmp/scst-itf-ver.h.XXXXXXXXXX)" + cat <<"EOF" >$tmp_itf_ver +/* Autogenerated, don't edit */ + +#define SCST_INTF_VER "SCST_INTF_VER" +#define SCST_CONST_INTF_VER "SCST_CONST_INTF_VER" +#define DEV_USER_INTF_VER "DEV_USER_INTF_VER" +EOF + add_file "$tmp_itf_ver" "include/scst/scst_itf_ver.h" + rm -f "$tmp_itf_ver" fi - done \ - | process_patch "${s}.diff" + } | + process_patch "${s}.diff" done {