@@ -84,12 +84,25 @@ deploy_kernel_headers () {
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
113
126
BUILD_DEBUG=$( if_enabled_echo CONFIG_DEBUG_INFO Yes)
114
127
115
128
# Setup the directory structure
116
- rm -rf " $tmpdir " " $libc_headers_dir " " $ dbg_dir" debian/files
129
+ rm -rf " $tmpdir " " $dbg_dir " debian/files
117
130
mkdir -m 755 -p " $tmpdir /DEBIAN"
118
131
mkdir -p " $tmpdir /lib" " $tmpdir /boot"
119
132
@@ -163,16 +176,6 @@ if is_enabled CONFIG_MODULES; then
163
176
fi
164
177
fi
165
178
166
- if [ " $ARCH " != " um" ]; then
167
- $MAKE -f $srctree /Makefile headers
168
- $MAKE -f $srctree /Makefile headers_install INSTALL_HDR_PATH=" $libc_headers_dir /usr"
169
- # move asm headers to /usr/include/<libc-machine>/asm to match the structure
170
- # used by Debian-based distros (to support multi-arch)
171
- host_arch=$( dpkg-architecture -a$( cat debian/arch) -qDEB_HOST_MULTIARCH)
172
- mkdir $libc_headers_dir /usr/include/$host_arch
173
- mv $libc_headers_dir /usr/include/asm $libc_headers_dir /usr/include/$host_arch /
174
- fi
175
-
176
179
# Install the maintainer scripts
177
180
# Note: hook scripts under /etc/kernel are also executed by official Debian
178
181
# kernel packages, as well as kernel packages built using make-kpkg.
@@ -202,7 +205,8 @@ if [ "$ARCH" != "um" ]; then
202
205
deploy_kernel_headers debian/linux-headers
203
206
create_package linux-headers-$version debian/linux-headers
204
207
205
- create_package " $libc_headers_packagename " " $libc_headers_dir "
208
+ deploy_libc_headers debian/linux-libc-dev
209
+ create_package linux-libc-dev debian/linux-libc-dev
206
210
fi
207
211
208
212
create_package " $packagename " " $tmpdir "
0 commit comments