]> git.proxmox.com Git - pve-kernel.git/commitdiff
add pve-kernel-libc-dev headers package
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 May 2020 15:12:08 +0000 (17:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 28 May 2020 12:07:11 +0000 (14:07 +0200)
This was long overdue, allows to access the full feature set of our
kernel for some tools using the Linux API directly.

Packaging mostly taken from Debian[0]

[0]: https://salsa.debian.org/kernel-team/linux/-/blob/debian/4.19.118-2/debian/rules.real#L367

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
debian/control.in
debian/rules

index 9b807c1d40c5b83186a97d50236110b9f68185f4..b9809f16c97dcefdca14ae0565cc3f866712230c 100644 (file)
@@ -69,3 +69,15 @@ Depends: busybox,
 Recommends: grub-pc | grub-efi-amd64 | grub-efi-ia32 | grub-efi-arm64,
 Description: The Proxmox PVE Kernel Image
  This package contains the linux kernel and initial ramdisk used for booting
+
+Package: pve-kernel-libc-dev
+Section: devel
+Priority: optional
+Architecture: any
+Provides: linux-libc-dev,
+Conflicts: linux-libc-dev,
+Replaces: linux-libc-dev,
+Depends: ${misc:Depends}
+Description: Linux support headers for userspace development
+ This package provides userspaces headers from the Linux kernel.  These headers
+ are used by the installed headers for GNU libc and other system libraries.
index e530eb54870753c934a4a188846fbd6aa635acf3..f531ac5fd80c8f3ac482bd55047760e9f68e4389 100755 (executable)
@@ -15,6 +15,7 @@ CHANGELOG_DATE:=$(shell dpkg-parsechangelog -SDate)
 
 PVE_KERNEL_PKG=pve-kernel-${KVNAME}
 PVE_HEADER_PKG=pve-headers-${KVNAME}
+PVE_USR_HEADER_PKG=pve-kernel-libc-dev
 LINUX_TOOLS_PKG=linux-tools-${KERNEL_MAJMIN}
 KERNEL_SRC_COPY=${KERNEL_SRC}_tmp
 
@@ -87,7 +88,7 @@ debian/control: $(wildcard debian/*.in)
 
 build: .compile_mark .tools_compile_mark .modules_compile_mark
 
-install: .install_mark .tools_install_mark .headers_install_mark
+install: .install_mark .tools_install_mark .headers_install_mark .usr_headers_install_mark
        dh_installdocs -A debian/copyright debian/SOURCE
        dh_installchangelogs
        dh_installman
@@ -97,7 +98,7 @@ install: .install_mark .tools_install_mark .headers_install_mark
 
 binary: install
        debian/rules fwcheck abicheck
-       dh_strip -N${PVE_HEADER_PKG}
+       dh_strip -N${PVE_HEADER_PKG} -N${PVE_USR_HEADER_PKG}
        dh_makeshlibs
        dh_shlibdeps
        dh_installdeb
@@ -207,6 +208,23 @@ binary: install
        ln -sf /usr/src/linux-headers-${KVNAME} debian/${PVE_HEADER_PKG}/lib/modules/${KVNAME}/build
        touch $@
 
+.usr_headers_install_mark: PKG_DIR = debian/${PVE_USR_HEADER_PKG}
+.usr_headers_install_mark: OUT_DIR = ${PKG_DIR}/usr
+.usr_headers_install_mark: .config_mark
+       rm -rf '${PKG_DIR}'
+       mkdir -p  '${PKG_DIR}'
+       $(MAKE) -C ${KERNEL_SRC} headers_check ARCH=$(KERNEL_HEADER_ARCH)
+       $(MAKE) -C ${KERNEL_SRC} headers_install ARCH=$(KERNEL_HEADER_ARCH) INSTALL_HDR_PATH='$(CURDIR)'/$(OUT_DIR)
+       rm -rf $(OUT_DIR)/include/drm $(OUT_DIR)/include/scsi
+       find $(OUT_DIR)/include \( -name .install -o -name ..install.cmd \) -execdir rm {} +
+
+# Move include/asm to arch-specific directory
+       mkdir -p $(OUT_DIR)/include/$(DEB_HOST_MULTIARCH)
+       mv $(OUT_DIR)/include/asm $(OUT_DIR)/include/$(DEB_HOST_MULTIARCH)/
+       test ! -d $(OUT_DIR)/include/arch || \
+               mv $(OUT_DIR)/include/arch $(OUT_DIR)/include/$(DEB_HOST_MULTIARCH)/
+       touch $@
+
 .modules_compile_mark: ${MODULES}/zfs.ko
        touch $@