Skip to content

Commit bb2a1aa

Browse files
bwhacksgregkh
authored andcommitted
deb-pkg: Fix cross-building linux-headers package
commit f8ce239 upstream. builddeb generates a control file that says the linux-headers package can only be built for the build system primary architecture. This breaks cross-building configurations. We should use $debarch for this instead. Since $debarch is not yet set when generating the control file, set Architecture: any and use control file variables to fill in the description. Fixes: cd8d60a ('kbuild: create linux-headers package in deb-pkg') Reported-and-tested-by: "Niew, Sh." <shniew@gmail.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0d9b29c commit bb2a1aa

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎scripts/package/builddeb‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ create_package() {
6262
fi
6363

6464
# Create the package
65-
dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
65+
dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
6666
dpkg --build "$pdir" ..
6767
}
6868

@@ -288,15 +288,14 @@ mkdir -p "$destdir"
288288
(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
289289
ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
290290
rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
291-
arch=$(dpkg --print-architecture)
292291

293292
cat <<EOF >> debian/control
294293
295294
Package: $kernel_headers_packagename
296295
Provides: linux-headers, linux-headers-2.6
297-
Architecture: $arch
298-
Description: Linux kernel headers for $KERNELRELEASE on $arch
299-
This package provides kernel header files for $KERNELRELEASE on $arch
296+
Architecture: any
297+
Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch}
298+
This package provides kernel header files for $KERNELRELEASE on \${kernel:debarch}
300299
.
301300
This is useful for people who need to build external modules
302301
EOF

0 commit comments

Comments
 (0)