From a7670c6ba1fe42b077d2f5f298f0a08c41f9240a Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 13 Dec 2013 07:06:41 +0100 Subject: [PATCH] add kernel header package --- Makefile | 25 +++--------------- headers-control.in | 10 ++++++++ headers-postinst.in | 62 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 headers-control.in create mode 100644 headers-postinst.in diff --git a/Makefile b/Makefile index 469dd2e..1673a64 100644 --- a/Makefile +++ b/Makefile @@ -65,22 +65,7 @@ HDR_DEB=${HDRPACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb PVEPKG=proxmox-ve-${KERNEL_VER} PVE_DEB=${PVEPKG}_${RELEASE}-${PKGREL}_all.deb -all: check_gcc ${DST_DEB} ${FW_DEB} -#${PVE_DEB} ${HDR_DEB} - -${PVE_DEB} pve: proxmox-ve/control proxmox-ve/postinst - rm -rf proxmox-ve/data - mkdir -p proxmox-ve/data/DEBIAN - mkdir -p proxmox-ve/data/usr/share/doc/${PVEPKG}/ - install -m 0644 proxmox-ve/proxmox-release\@proxmox.com.pubkey proxmox-ve/data/usr/share/doc/${PVEPKG} - sed -e 's/@KVNAME@/${KVNAME}/' -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@RELEASE@/${RELEASE}/' -e 's/@PKGREL@/${PKGREL}/' proxmox-ve/data/DEBIAN/control - sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' proxmox-ve/data/DEBIAN/postinst - chmod 0755 proxmox-ve/data/DEBIAN/postinst - echo "git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${PVEPKG}/SOURCE - install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${PVEPKG} - install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${PVEPKG} - gzip --best proxmox-ve/data/usr/share/doc/${PVEPKG}/changelog.Debian - dpkg-deb --build proxmox-ve/data ${PVE_DEB} +all: check_gcc ${DST_DEB} ${FW_DEB} ${HDR_DEB} check_gcc: gcc --version|grep "4.7.2" || false @@ -274,7 +259,7 @@ ${HDR_DEB} hdr: .compile_mark headers-control.in headers-postinst.in chmod 0755 $(headers_tmp)/DEBIAN/postinst install -D -m 644 copyright $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/copyright install -D -m 644 changelog.Debian $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian - echo "git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git\\ngit checkout ${GITVERSION}" > $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/SOURCE + echo "git clone git://git.proxmox.com/git/pve-kernel-3.10.0.git\\ngit checkout ${GITVERSION}" > $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/SOURCE gzip -f --best $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian install -m 0644 ${KERNEL_SRC}/.config $(headers_dir) install -m 0644 ${KERNEL_SRC}/Module.symvers $(headers_dir) @@ -322,17 +307,15 @@ ${FW_DEB} fw: control.firmware linux-firmware.git/WHENCE dvb-firmware.git/README dpkg-deb --build fwdata ${FW_DEB} .PHONY: upload -upload: ${DST_DEB} # ${PVE_DEB} ${HDR_DEB} ${FW_DEB} +upload: ${DST_DEB} ${HDR_DEB} ${FW_DEB} umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw mkdir -p /pve/${RELEASE}/extra mkdir -p /pve/${RELEASE}/install rm -rf /pve/${RELEASE}/extra/${PACKAGE}_*.deb rm -rf /pve/${RELEASE}/extra/${HDRPACKAGE}_*.deb - rm -rf /pve/${RELEASE}/extra/${PVEPKG}_*.deb rm -rf /pve/${RELEASE}/extra/pve-firmware*.deb rm -rf /pve/${RELEASE}/extra/Packages* -# cp ${DST_DEB} ${PVE_DEB} ${HDR_DEB} ${FW_DEB} /pve/${RELEASE}/extra - cp ${DST_DEB} ${FW_DEB} /pve/${RELEASE}/extra + cp ${DST_DEB} ${FW_DEB} ${HDR_DEB} /pve/${RELEASE}/extra cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro diff --git a/headers-control.in b/headers-control.in new file mode 100644 index 0000000..ae8bc33 --- /dev/null +++ b/headers-control.in @@ -0,0 +1,10 @@ +Package: pve-headers-@KVNAME@ +Version: @KERNEL_VER@-@PKGREL@ +Section: devel +Priority: optional +Architecture: amd64 +Provides: linux-headers, linux-headers-2.6 +Depends: coreutils | fileutils (>= 4.0), pve-kernel-@KVNAME@ +Maintainer: Proxmox Support Team +Description: The Proxmox PVE Kernel Headers + This package contains the linux kernel headers diff --git a/headers-postinst.in b/headers-postinst.in new file mode 100644 index 0000000..4536e24 --- /dev/null +++ b/headers-postinst.in @@ -0,0 +1,62 @@ +#! /bin/sh + +# Abort if any command returns an error value +set -e + +case "$1" in + configure) + + ln -sf /usr/src/linux-headers-@@KVNAME@@ /lib/modules/@@KVNAME@@/build + + # There are three sub-cases: + if test "${2+set}" != set; then + # We're being installed by an ancient dpkg which doesn't remember + # which version was most recently configured, or even whether + # there is a most recently configured version. + : + + elif test -z "$2" -o "$2" = ""; then + # The package has not ever been configured on this system, or was + # purged since it was last configured. + : + + else + # Version $2 is the most recently configured version of this + # package. + : + + fi ;; + abort-upgrade) + # Back out of an attempt to upgrade this package FROM THIS VERSION + # to version $2. Undo the effects of "prerm upgrade $2". + : + + ;; + abort-remove) + if test "$2" != in-favour; then + echo "$0: undocumented call to \`postinst $*'" 1>&2 + exit 0 + fi + # Back out of an attempt to remove this package, which was due to + # a conflict with package $3 (version $4). Undo the effects of + # "prerm remove in-favour $3 $4". + : + + ;; + abort-deconfigure) + if test "$2" != in-favour -o "$5" != removing; then + echo "$0: undocumented call to \`postinst $*'" 1>&2 + exit 0 + fi + # Back out of an attempt to deconfigure this package, which was + # due to package $6 (version $7) which we depend on being removed + # to make way for package $3 (version $4). Undo the effects of + # "prerm deconfigure in-favour $3 $4 removing $6 $7". + : + + ;; + *) echo "$0: didn't understand being called with \`$1'" 1>&2 + exit 0;; +esac + +exit 0 -- 2.39.2