Skip to content

Commit bac977c

Browse files
committed
kbuild: deb-pkg: do not build linux-headers package if CONFIG_MODULES=n
Since commit 269a535 ("modpost: generate vmlinux.symvers and reuse it for the second modpost"), with CONFIG_MODULES disabled, "make deb-pkg" (or "make bindeb-pkg") fails with: find: ‘Module.symvers’: No such file or directory If CONFIG_MODULES is disabled, it doesn't really make sense to build the linux-headers package. Fixes: 269a535 ("modpost: generate vmlinux.symvers and reuse it for the second modpost") Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 172aad8 commit bac977c

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

scripts/package/builddeb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ EOF
207207
done
208208

209209
if [ "$ARCH" != "um" ]; then
210-
deploy_kernel_headers debian/linux-headers
211-
create_package linux-headers-$version debian/linux-headers
210+
if is_enabled CONFIG_MODULES; then
211+
deploy_kernel_headers debian/linux-headers
212+
create_package linux-headers-$version debian/linux-headers
213+
fi
212214

213215
deploy_libc_headers debian/linux-libc-dev
214216
create_package linux-libc-dev debian/linux-libc-dev

scripts/package/mkdebian

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,6 @@ Description: Linux kernel, version $version
184184
This package contains the Linux kernel, modules and corresponding other
185185
files, version: $version.
186186
187-
Package: $kernel_headers_packagename
188-
Architecture: $debarch
189-
Description: Linux kernel headers for $version on $debarch
190-
This package provides kernel header files for $version on $debarch
191-
.
192-
This is useful for people who need to build external modules
193-
194187
Package: linux-libc-dev
195188
Section: devel
196189
Provides: linux-kernel-headers
@@ -201,6 +194,18 @@ Description: Linux support headers for userspace development
201194
Multi-Arch: same
202195
EOF
203196

197+
if is_enabled CONFIG_MODULES; then
198+
cat <<EOF >> debian/control
199+
200+
Package: $kernel_headers_packagename
201+
Architecture: $debarch
202+
Description: Linux kernel headers for $version on $debarch
203+
This package provides kernel header files for $version on $debarch
204+
.
205+
This is useful for people who need to build external modules
206+
EOF
207+
fi
208+
204209
if is_enabled CONFIG_DEBUG_INFO; then
205210
cat <<EOF >> debian/control
206211

0 commit comments

Comments
 (0)