]> git.proxmox.com Git - pve-kernel.git/blobdiff - debian/rules
d/rules: close race between 'cp' and module handling
[pve-kernel.git] / debian / rules
index 7b1b251dd781e13ff86de3d4b932376f83d7c375..6be3f18d964dee4b86a3d56c25de51568f5af0dd 100755 (executable)
@@ -14,6 +14,7 @@ include debian/rules.d/${DEB_BUILD_ARCH}.mk
 CHANGELOG_DATE:=$(shell dpkg-parsechangelog -SDate)
 
 PVE_KERNEL_PKG=pve-kernel-${KVNAME}
+PVE_DEBUG_KERNEL_PKG=pve-kernel-${KVNAME}-dbgsym
 PVE_HEADER_PKG=pve-headers-${KVNAME}
 PVE_USR_HEADER_PKG=pve-kernel-libc-dev
 LINUX_TOOLS_PKG=linux-tools-${KERNEL_MAJMIN}
@@ -113,6 +114,9 @@ binary: install
 .config_mark:
        cd ${KERNEL_SRC}; scripts/config ${PVE_CONFIG_OPTS}
        ${MAKE} -C ${KERNEL_SRC} oldconfig
+       # copy to allow building in parallel to kernel/module compilation without interference
+       rm -rf ${KERNEL_SRC_COPY}
+       cp -ar ${KERNEL_SRC} ${KERNEL_SRC_COPY}
        touch $@
 
 .compile_mark: .config_mark
@@ -132,6 +136,16 @@ binary: install
        install -m 644 $(addprefix ${MODULES}/,zfs.ko zavl.ko znvpair.ko zunicode.ko zcommon.ko icp.ko zlua.ko spl.ko zzstd.ko) debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME}/zfs
        # remove firmware
        rm -rf debian/${PVE_KERNEL_PKG}/lib/firmware
+
+       # debug package
+       mkdir -p debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}
+       mkdir debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/boot
+       install -m 644 ${KERNEL_SRC}/vmlinux debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/boot/vmlinux-${KVNAME}
+       cp -r debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME} debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/
+       rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/source
+       rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/build
+       rm -f debian/${PVE_DEBUG_KERNEL_PKG}/usr/lib/debug/lib/modules/${KVNAME}/modules.*
+
        # strip debug info
        find debian/${PVE_KERNEL_PKG}/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done
        # finalize
@@ -146,7 +160,7 @@ binary: install
        touch $@
 
 .tools_compile_mark: .compile_mark
-       ${MAKE} -C ${KERNEL_SRC}/tools/perf prefix=/usr HAVE_NO_LIBBFD=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 NO_LIBPYTHON=1 NO_LIBPERL=1 NO_LIBCRYPTO=1 PYTHON=python2.7
+       ${MAKE} -C ${KERNEL_SRC}/tools/perf prefix=/usr HAVE_NO_LIBBFD=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 NO_LIBPYTHON=1 NO_LIBPERL=1 NO_LIBCRYPTO=1 PYTHON=python3
        echo "checking GPL-2 only perf binary for library linkage with incompatible licenses.."
        ! ldd ${KERNEL_SRC}/tools/perf/perf | grep -q -E '\blibbfd'
        ! ldd ${KERNEL_SRC}/tools/perf/perf | grep -q -E '\blibcrypto'
@@ -168,9 +182,6 @@ binary: install
        rm -rf debian/${PVE_HEADER_PKG}
        mkdir -p debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME}
        install -m 0644 ${KERNEL_SRC}/.config debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME}
-       # copy to allow building in parallel to kernel/module compilation without interference
-       rm -rf ${KERNEL_SRC_COPY}
-       cp -ar ${KERNEL_SRC} ${KERNEL_SRC_COPY}
        make -C ${KERNEL_SRC_COPY} mrproper
        cd ${KERNEL_SRC_COPY}; find . -path './debian/*' -prune \
            -o -path './include/*' -prune \