diff --git a/kernel.spec b/kernel.spec index 8754e72b5..60720e9a3 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1333,8 +1333,57 @@ BuildKernel() { rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include cp .config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build + # the full copy of scripts also copies a bunch of binaries which ends + # up screwing the debuginfo. It's just easier to remove them. + if [ -f scripts/asn1_compiler ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/asn1_compiler + fi + if [ -f scripts/sign-file ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/sign-file + fi + if [ -f scripts/extract-cert ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/extract-cert + fi + if [ -f scripts/pnmtologo ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/pnmtologo + fi + if [ -f scripts/unifdef ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/unifdef + fi + if [ -f scripts/sortextable ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/sortextable + fi + if [ -f scripts/basic/fixdep ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/basic/fixdep + fi + if [ -f scripts/recordmcount ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/recordmcount + fi + if [ -f scripts/conmakehash ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/conmakehash + fi + if [ -f scripts/kallsyms ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/kallsyms + fi + if [ -f scripts/basic/bin2c ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/basic/bin2c + fi + if [ -f scripts/mod/mk_elfconfig ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/mod/mk_elfconfig + fi + if [ -f scripts/mod/modpost ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/mod/modpost + fi + if [ -f scripts/kconfig/conf ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/kconfig/conf + fi + if [ -f scripts/selinux/mdp/mdp ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/selinux/mdp/mdp + fi + if [ -f scripts/selinux/genheaders/genheaders ]; then + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/selinux/genheaders/genheaders + fi if [ -f tools/objtool/objtool ]; then - cp -a tools/objtool/objtool $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/objtool/ || : # these are a few files associated with objtool cp -a --parents tools/build/Build.include $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents tools/build/Build $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ @@ -1342,6 +1391,9 @@ BuildKernel() { cp -a --parents tools/scripts/utilities.mak $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ # also more than necessary but it's not that many more files cp -a --parents tools/objtool/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ + # these can be rebuilt + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/objtool/fixdep + rm $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/objtool/objtool cp -a --parents tools/lib/str_error_r.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents tools/lib/string.c $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a --parents tools/lib/subcmd/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/