debuginfo: Allow kbuilds with the output directory

Consider another directory level when searching for vmlinux, for kernel
builds in sub-directory using `make O=output_dir'. Also, improve warning
message making it more understandable.
This commit is contained in:
Виталий Чикунов 2020-11-03 13:49:30 +03:00
parent 4f5394b5a1
commit 4738619b15

View File

@ -31,14 +31,14 @@ elif [ -z "${f#./lib/modules/*.ko.[gx]z}" ]; then
elif [ -z "${f##./boot/vmlinuz-*}" ]; then
# Compressed kernel: trigger extraction of vmlinux from the source.
kver=${f#./boot/vmlinuz-}
vmlinuxs=$(find "$RPM_BUILD_DIR" -depth -maxdepth 3 -type f -name vmlinux -print -quit)
vmlinuxs=$(find "$RPM_BUILD_DIR" -depth -maxdepth 4 -type f -name vmlinux -print -quit)
vmlinuxd=./usr/lib/debug/lib/modules/$kver/vmlinux
if [ -f "$vmlinuxs" ]; then
install -pD -m644 "$vmlinuxs" "$vmlinuxd"
f=$vmlinuxd
else
Warning "vmlinux not found for -debuginfo"
Warning "vmlinux not found in $RPM_BUILD_DIR for -debuginfo"
exit
fi
fi