Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

builddeb: split libc headers deployment out into a function

Deploy user-space headers (linux-libc-dev package) in a separate
function for readability.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+18 -14
+18 -14
scripts/package/builddeb
··· 84 84 ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build 85 85 } 86 86 87 + deploy_libc_headers () { 88 + pdir=$1 89 + 90 + rm -rf $pdir 91 + 92 + $MAKE -f $srctree/Makefile headers 93 + $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr 94 + 95 + # move asm headers to /usr/include/<libc-machine>/asm to match the structure 96 + # used by Debian-based distros (to support multi-arch) 97 + host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH) 98 + mkdir $pdir/usr/include/$host_arch 99 + mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/ 100 + } 101 + 87 102 version=$KERNELRELEASE 88 103 tmpdir=debian/linux-image 89 - libc_headers_dir=debian/linux-libc-dev 90 104 dbg_dir=debian/linux-image-dbg 91 105 packagename=linux-image-$version 92 - libc_headers_packagename=linux-libc-dev 93 106 dbg_packagename=$packagename-dbg 94 107 95 108 if [ "$ARCH" = "um" ] ; then ··· 126 113 BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes) 127 114 128 115 # Setup the directory structure 129 - rm -rf "$tmpdir" "$libc_headers_dir" "$dbg_dir" debian/files 116 + rm -rf "$tmpdir" "$dbg_dir" debian/files 130 117 mkdir -m 755 -p "$tmpdir/DEBIAN" 131 118 mkdir -p "$tmpdir/lib" "$tmpdir/boot" 132 119 ··· 176 163 fi 177 164 fi 178 165 179 - if [ "$ARCH" != "um" ]; then 180 - $MAKE -f $srctree/Makefile headers 181 - $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" 182 - # move asm headers to /usr/include/<libc-machine>/asm to match the structure 183 - # used by Debian-based distros (to support multi-arch) 184 - host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH) 185 - mkdir $libc_headers_dir/usr/include/$host_arch 186 - mv $libc_headers_dir/usr/include/asm $libc_headers_dir/usr/include/$host_arch/ 187 - fi 188 - 189 166 # Install the maintainer scripts 190 167 # Note: hook scripts under /etc/kernel are also executed by official Debian 191 168 # kernel packages, as well as kernel packages built using make-kpkg. ··· 205 202 deploy_kernel_headers debian/linux-headers 206 203 create_package linux-headers-$version debian/linux-headers 207 204 208 - create_package "$libc_headers_packagename" "$libc_headers_dir" 205 + deploy_libc_headers debian/linux-libc-dev 206 + create_package linux-libc-dev debian/linux-libc-dev 209 207 fi 210 208 211 209 create_package "$packagename" "$tmpdir"