From patchwork Mon Jul 8 11:47:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Marciniszyn, Mike" X-Patchwork-Id: 2824813 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 366B7C0AB2 for ; Mon, 8 Jul 2013 11:47:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19C852013A for ; Mon, 8 Jul 2013 11:47:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A2CD20124 for ; Mon, 8 Jul 2013 11:47:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751648Ab3GHLrh (ORCPT ); Mon, 8 Jul 2013 07:47:37 -0400 Received: from mga09.intel.com ([134.134.136.24]:48296 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213Ab3GHLrh (ORCPT ); Mon, 8 Jul 2013 07:47:37 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 08 Jul 2013 04:45:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,1020,1363158000"; d="scan'208";a="361984449" Received: from sedona.ch.intel.com ([143.182.228.65]) by fmsmga001.fm.intel.com with ESMTP; 08 Jul 2013 04:48:37 -0700 Received: from phlsvsles11.ph.intel.com (phlsvsles11.ph.intel.com [10.228.195.43]) by sedona.ch.intel.com (8.13.6/8.14.3/Standard MailSET/Hub) with ESMTP id r68BlZAY010842; Mon, 8 Jul 2013 04:47:36 -0700 Received: from phlsvslse11.ph.intel.com (localhost [127.0.0.1]) by phlsvsles11.ph.intel.com with ESMTP id r68BlYAm020406; Mon, 8 Jul 2013 07:47:35 -0400 Subject: [PATCH v2] kbuild: add generation of kernel-devel To: mmarek@suse.cz From: Mike Marciniszyn Cc: linux-kbuild@vger.kernel.org, mmarcini@yahoo.com Date: Mon, 08 Jul 2013 07:47:34 -0400 Message-ID: <20130708114734.20384.74966.stgit@phlsvslse11.ph.intel.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change the spec file to generate a kernel-devel module allowing for compilation of external kernel modules. Signed-off-by: Mike Marciniszyn --- scripts/package/mkspec | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 514aeb2..4df699e 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -59,6 +59,14 @@ echo "header files define structures and constants that are needed for" echo "building most standard programs and are also needed for rebuilding the" echo "glibc package." echo "" +echo "%package devel" +echo "Summary: Development package for building kernel modules to match the $__KERNELRELEASE kernel" +echo "Group: System Environment/Kernel" +echo "AutoReqProv: no" +echo "%description -n kernel-devel" +echo "This package provides kernel headers and makefiles sufficient to build modules" +echo "against the $__KERNELRELEASE kernel package." +echo "" if ! $PREBUILT; then echo "%prep" @@ -109,6 +117,14 @@ echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2" echo 'mv vmlinux.orig vmlinux' echo "%endif" +echo 'rm -f $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}" +echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE" +echo "EXCLUDES=\"$RCS_TAR_IGNORE --exclude .tmp_versions --exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=firmware --exclude .config.old --exclude .missing-syscalls.d\"" +echo "tar "'$EXCLUDES'" -cf- . | (cd "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE;tar xvf -)" +echo 'cd $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE" +echo "ln -sf /usr/src/kernels/$KERNELRELEASE build" +echo "ln -sf /usr/src/kernels/$KERNELRELEASE source" + echo "" echo "%clean" echo 'rm -rf $RPM_BUILD_ROOT' @@ -133,3 +149,7 @@ echo "%files headers" echo '%defattr (-, root, root)' echo "/usr/include" echo "" +echo "%files devel" +echo '%defattr (-, root, root)' +echo "/usr/src/kernels/$KERNELRELEASE" +echo ""