It has been ages since I wanted to patch the kernel when I built a
custom kernel. I tried putting the patch in the spec file where the
other patches were, but it doesn't apply. There is no error, or even
indication that it saw the patch, so I am obviously doing it
incorrectly.
I'm building the kernel from the srpm using rpmbuild. It builds fine
when unpatched. I can, of course, just untar the kernel tar file,
apply the patch, and tar it. But, it should be simple to do from the
spec file directly. Can anyone point me to the current procedure?
Here is what is in the spec file:
```
## Patches needed for building this package
%if !%{nopatches}
Patch1: patch-%{patchversion}-redhat.patch
Patch2: 0001-my_custom_change.patch
%endif
# empty final patch to facilitate testing of kernel patches
Patch999999: linux-kernel-test.patch
```
I tried it outside the if, still didn't work:
```
## Patches needed for building this package
%if !%{nopatches}
Patch1: patch-%{patchversion}-redhat.patch
%endif
Patch2: 0001-my_custom_change.patch
# empty final patch to facilitate testing of kernel patches
Patch999999: linux-kernel-test.patch
```
Here is the output with this version in the spec file.
+ ApplyOptionalPatch patch-6.4-redhat.patch
+ local patch=patch-6.4-redhat.patch
+ shift
+ '[' '!' -f /home/stan/rpmbuild/SOURCES/patch-6.4-redhat.patch ']'
++ wc -l /home/stan/rpmbuild/SOURCES/patch-6.4-redhat.patch
++ awk '{print $1}'
+ local C=2978
+ '[' 2978 -gt 9 ']'
+ ApplyPatch patch-6.4-redhat.patch
+ local patch=patch-6.4-redhat.patch
+ shift
+ '[' '!' -f /home/stan/rpmbuild/SOURCES/patch-6.4-redhat.patch ']'
+ case "$patch" in
+ git --work-tree=. apply
+ ApplyOptionalPatch linux-kernel-test.patch
+ local patch=linux-kernel-test.patch
+ shift
+ '[' '!' -f /home/stan/rpmbuild/SOURCES/linux-kernel-test.patch ']'
++ wc -l /home/stan/rpmbuild/SOURCES/linux-kernel-test.patch
It finds the Patch999999 patch which is empty, and in
~/rpmbuild/SOURCE like my patch, so why isn't it finding my patch?
Thanks for any help.