Commit bcbbf493 authored by Matt Fleming's avatar Matt Fleming Committed by Masahiro Yamada
Browse files

kbuild: deb-pkg: Don't fail if modules.order is missing



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: 16c36f88 ("kbuild: deb-pkg: use build ID instead of debug link for dbg package")
Signed-off-by: default avatarMatt Fleming <mfleming@cloudflare.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent dbefa1f3
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ install_linux_image_dbg () {

	# Parse modules.order directly because 'make modules_install' may sign,
	# compress modules, and then run unneeded depmod.
	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}"
@@ -106,6 +107,7 @@ install_linux_image_dbg () {
			"${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