From patchwork Wed May 25 20:34:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Sharma X-Patchwork-Id: 817522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4PKZ1Je003878 for ; Wed, 25 May 2011 20:35:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932439Ab1EYUep (ORCPT ); Wed, 25 May 2011 16:34:45 -0400 Received: from outmail006.snc4.facebook.com ([66.220.144.138]:36272 "EHLO mx-out.facebook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755678Ab1EYUem (ORCPT ); Wed, 25 May 2011 16:34:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=fb.com; s=s1024-2011-q2; c=relaxed/simple; q=dns/txt; i=@fb.com; t=1306355681; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=JLZfvuletuFQ93uu312mO0RaPCughFca7eYXMHVwZQc=; b=Uf26nLjmhYds8KHtydQ3bFTmPbdyzjrEO2qq/h6HzTJdtGxXasb2KzMxsUeoRAWh GyaP2GBOYh9UZbsJ0ykc/Qjo7qnDLdwqluGx02j4xZ447cPVRStAfPZQV/F/4GCd SBUX030MN3HCAj2yQ9fMpB1V+O2vVInMmxzmvuAUtUM=; Received: from [10.47.65.39] ([10.47.65.39:34658] helo=facebook.com) by 10.30.169.31 (envelope-from ) (ecelerity 2.2.2.45 r(34222M)) with ESMTP id AC/F7-23640-1E76DDD4; Wed, 25 May 2011 13:34:41 -0700 Received: from dev1756.snc6.facebook.com (localhost.localdomain [127.0.0.1]) by dev1756.snc6.facebook.com (Postfix) with ESMTP id AE73E918422; Wed, 25 May 2011 13:34:41 -0700 (PDT) Received: (from asharma@localhost) by dev1756.snc6.facebook.com (8.13.8/8.13.8/Submit) id p4PKYfoZ031759; Wed, 25 May 2011 13:34:41 -0700 X-Authentication-Warning: dev1756.snc6.facebook.com: asharma set sender to asharma@fb.com using -f Date: Wed, 25 May 2011 13:34:41 -0700 From: Arun Sharma To: Arun Sharma Cc: Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] kbuild: Add a kernel-devel package Message-ID: <20110525203441.GA30980@dev1756.snc6.facebook.com> References: <1305653779-3445-1-git-send-email-asharma@fb.com> <1305653779-3445-2-git-send-email-asharma@fb.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1305653779-3445-2-git-send-email-asharma@fb.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 25 May 2011 20:35:01 +0000 (UTC) [ Updated version of this patch. ] kbuild: Add a kernel-devel package Useful for building modules without having kernel sources Signed-off-by: Arun Sharma --- 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 f5f0cb5..c79b777 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -49,6 +49,14 @@ echo "" echo "%description" echo "The Linux Kernel, the operating system core itself" 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" @@ -96,6 +104,11 @@ echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2" echo 'mv vmlinux.orig vmlinux' echo "%endif" +echo 'rm -rf $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}" +echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE" +echo "rsync -avz --exclude '.git/' --exclude '*vmlinux*' --exclude '.*' --exclude '*.o' --exclude '*.so' --exclude '*.ko' . "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE/" +echo 'pushd $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE"' && ln -s build source && ln -s '"/usr/src/kernels/$KERNELRELEASE"' build && popd' + echo "" echo "%preun" echo '/sbin/new-kernel-pkg --rminitrd --rmmoddep --remove '"$KERNELRELEASE"' || exit $?' @@ -115,3 +128,7 @@ echo "/lib/modules/$KERNELRELEASE" echo "/lib/firmware" echo "/boot/*" echo "" +echo "%files devel" +echo '%defattr (-, root, root)' +echo "/usr/src/kernels/$KERNELRELEASE" +echo ""