From: edwardsg@sgi.com (Greg Edwards)
To: linux-kernel@vger.kernel.org
Subject: [PATCH] build binary rpm from pre-built tree
Date: Thu, 15 Jul 2004 18:14:01 -0500 [thread overview]
Message-ID: <20040715231401.GK12258@sgi.com> (raw)
Many times it would be nice to quickly package up a kernel tree you're
working on, without having to rebuild the whole thing again from a clean
source tree (like the current rpm-pkg target does). The patch below
adds an "rpmbin-pkg" target which uses your existing (already built)
tree.
Signed-off-by: Greg Edwards <edwardsg@sgi.com>
Greg
===== scripts/package/Makefile 1.1 vs edited =====
--- 1.1/scripts/package/Makefile 2004-06-20 22:46:25 -05:00
+++ edited/scripts/package/Makefile 2004-07-15 17:55:24 -05:00
@@ -31,7 +31,7 @@
MKSPEC := $(srctree)/scripts/package/mkspec
PREV := set -e; cd ..;
-.PHONY: rpm-pkg rpm
+.PHONY: rpm-pkg rpm rpmbin-pkg
$(objtree)/kernel.spec: $(MKSPEC)
$(CONFIG_SHELL) $(MKSPEC) > $@
@@ -49,6 +49,16 @@
$(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz
rm ../$(KERNELPATH).tar.gz
+
+rpmbin-pkg: $(MKSPEC)
+ $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/kernel.spec
+
+ set -e; \
+ $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
+ set -e; \
+ mv -f $(objtree)/.tmp_version $(objtree)/.version
+
+ $(RPM) --define "_builddir $(srctree)" --target $(UTS_MACHINE) -bb $(objtree)/kernel.spec
clean-rule += rm -f $(objtree)/kernel.spec
===== scripts/package/mkspec 1.9 vs edited =====
--- 1.9/scripts/package/mkspec 2004-06-20 20:23:45 -05:00
+++ edited/scripts/package/mkspec 2004-07-15 17:55:02 -05:00
@@ -9,6 +9,13 @@
# Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net>
#
+# how we were called determines which rpms we build and how we build them
+if [ "$1" = "prebuilt" ]; then
+ PREBUILT=true
+else
+ PREBUILT=false
+fi
+
# starting to output the spec
if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then
PROVIDES=kernel-drm
@@ -26,8 +33,12 @@
echo "Group: System Environment/Kernel"
echo "Vendor: The Linux Community"
echo "URL: http://www.kernel.org"
+
+if ! $PREBUILT; then
echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//g"
+fi
+
echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
echo "Provides: $PROVIDES"
echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
@@ -36,12 +47,20 @@
echo "%description"
echo "The Linux Kernel, the operating system core itself"
echo ""
+
+if ! $PREBUILT; then
echo "%prep"
echo "%setup -q"
echo ""
+fi
+
echo "%build"
+
+if ! $PREBUILT; then
echo "make clean && make"
echo ""
+fi
+
echo "%install"
echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
reply other threads:[~2004-07-15 23:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040715231401.GK12258@sgi.com \
--to=edwardsg@sgi.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.