mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
kbuild: deb-pkg: Don't fail if modules.order is missing
[ Upstream commitbcbbf493f2
] Kernels built without CONFIG_MODULES might still want to create -dbg deb packages but install_linux_image_dbg() assumes modules.order always exists. This obviously isn't true if no modules were built, so we should skip reading modules.order in that case. Fixes:16c36f8864
("kbuild: deb-pkg: use build ID instead of debug link for dbg package") Signed-off-by: Matt Fleming <mfleming@cloudflare.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8d9cc7f159
commit
029ee0022a
@ -97,16 +97,18 @@ install_linux_image_dbg () {
|
||||
|
||||
# Parse modules.order directly because 'make modules_install' may sign,
|
||||
# compress modules, and then run unneeded depmod.
|
||||
while read -r mod; do
|
||||
mod="${mod%.o}.ko"
|
||||
dbg="${pdir}/usr/lib/debug/lib/modules/${KERNELRELEASE}/kernel/${mod}"
|
||||
buildid=$("${READELF}" -n "${mod}" | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
|
||||
link="${pdir}/usr/lib/debug/.build-id/${buildid}.debug"
|
||||
if is_enabled CONFIG_MODULES; then
|
||||
while read -r mod; do
|
||||
mod="${mod%.o}.ko"
|
||||
dbg="${pdir}/usr/lib/debug/lib/modules/${KERNELRELEASE}/kernel/${mod}"
|
||||
buildid=$("${READELF}" -n "${mod}" | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
|
||||
link="${pdir}/usr/lib/debug/.build-id/${buildid}.debug"
|
||||
|
||||
mkdir -p "${dbg%/*}" "${link%/*}"
|
||||
"${OBJCOPY}" --only-keep-debug "${mod}" "${dbg}"
|
||||
ln -sf --relative "${dbg}" "${link}"
|
||||
done < modules.order
|
||||
mkdir -p "${dbg%/*}" "${link%/*}"
|
||||
"${OBJCOPY}" --only-keep-debug "${mod}" "${dbg}"
|
||||
ln -sf --relative "${dbg}" "${link}"
|
||||
done < modules.order
|
||||
fi
|
||||
|
||||
# Build debug package
|
||||
# Different tools want the image in different locations
|
||||
|
Loading…
Reference in New Issue
Block a user