rpms/kernel/devel Makefile, 1.49, 1.50 kernel-2.6.spec, 1.3213, 1.3214 linux-2.6-build-nonintconfig.patch, 1.7, 1.8

Roland McGrath (roland) fedora-extras-commits at redhat.com
Fri Jun 8 20:24:59 UTC 2007


Author: roland

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22382

Modified Files:
	Makefile kernel-2.6.spec linux-2.6-build-nonintconfig.patch 
Log Message:
* Fri Jun  8 2007 Roland McGrath <roland at redhat.com>
- Add spec hacks to enable building alternate vanilla and git-based rpms.
- Enable sparse checking in build for F7 and later.




Index: Makefile
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/Makefile,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- Makefile	28 May 2007 05:02:05 -0000	1.49
+++ Makefile	8 Jun 2007 20:24:24 -0000	1.50
@@ -14,7 +14,22 @@
 # local targets we need to carry around in addition to the default sources
 TARGETS		= configs download
 
-include ../common/Makefile.common
+define find-makefile-common
+for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+endef
+
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
+
+ifeq ($(MAKEFILE_COMMON),)
+# attept a checkout
+define checkout-makefile-common
+test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
+endef
+
+MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
+endif
+
+include $(MAKEFILE_COMMON)
 include Makefile.config
 
 debug:
@@ -70,3 +85,120 @@
 
 # since i386 isn't a target...
 compile compile-short: DIST_DEFINES += --target $(shell uname -m)
+
+#
+# Hacks for building vanilla (unpatched) kernel rpms.
+# Use "make vanilla-TARGET" like "make TARGET" (make vanilla-scratch-build).
+#
+vanilla-%: $(SPECFILE:.spec=-vanilla.spec)
+	@$(MAKE) $* SPECFILE=$<
+
+$(SPECFILE:.spec=-vanilla.spec): $(SPECFILE)
+	@rm -f $@
+	(echo %define nopatches 1; cat $<) > $@
+
+scratch-build: test-srpm
+	$(BUILD_CLIENT) $(BUILD_FLAGS) --scratch $(COLLECTION) \
+			$(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE).src.rpm
+
+# Dismal kludge for building via brew from cvs after "make vanilla-tag".
+ifdef BEEHIVE_SRPM_BUILD
+export CHECKOUT_TAG ?= $(shell sed s/^.// CVS/Tag)
+tag-pattern = $(TAG_NAME)-$(TAG_VERSION)-0_%_$(TAG_RELEASE)
+ifeq (,$(filter-out $(tag-pattern),$(CHECKOUT_TAG)))
+variant := $(patsubst $(tag-pattern),%,$(CHECKOUT_TAG))
+srpm: SPECFILE := $(wildcard $(SPECFILE:.spec=-$(variant).spec) \
+			     $(SPECFILE:.spec=-t.$(variant).spec))
+srpm beehive-sprm: RELEASE := 0.$(variant).$(RELEASE)
+endif
+endif
+
+
+#
+# Hacks for building kernel rpms from upstream code plus local GIT branches.
+# Use "make git/BRANCH/TARGET" like "make TARGET".
+# Use "make git/BRANCH-fedora/TARGET" to include Fedora patches on top.
+#
+ifndef GIT_SPEC
+git/%:
+	@$(MAKE) GIT_SPEC=$(subst /,-,$(*D)) git-$(*F)
+else
+git-%: $(SPECFILE:.spec=-t.$(GIT_SPEC).spec)
+	@$(MAKE) GIT_SPEC= $* SPECFILE=$<
+endif
+
+#
+# Your git-branches.mk file can define GIT_DIR, e.g.:
+#	GIT_DIR = ${HOME}/kernel/.git
+# Make sure GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL are also set
+# or your rpm changelogs will look like crap.
+#
+# For each branch it can define a variable branch-BRANCH or tag-BRANCH
+# giving the parent of BRANCH to diff against in a separate patch.  If
+# the parent is unknown, it will use $(branch-upstream) defaulting to
+# "refs/remotes/upstream/master".
+#
+# Defining tag-BRANCH means the tag corresponds to an upstream patch in
+# the sources file, so that is used instead of generating a patch with
+# git.  If there is no tag-upstream defined, it will figure out a vNNN
+# tag or vNNN-gitN pseudo-tag from the last patch in the sources file.
+# For example:
+#	tag-some-hacks = v2.6.21-rc5
+#	branch-more-hacks = some-hacks
+# Leads to patches:
+#	git diff v2.6.21-rc5..more-hacks > linux-2.6.21-rc5-some-hacks.patch
+#	git diff some-hacks..more-hacks > linux-2.6.21-rc5-more-hacks.patch
+# Whereas having no git-branches.mk at all but doing
+# "make GIT_DIR=... git/mybranch/test-srpm" does:
+#	id=`cat patch-2.6.21-rc5-git4.id` # auto-fetched via upstream file
+#	git diff $id..upstream > linux-2.6.21-rc5-git4-upstream.patch
+#	git diff upstream..mybranch > linux-2.6.21-rc5-git4-mybranch.patch
+# If the upstream patch (or any branch patch) is empty it's left out.
+#
+git-branches.mk:;
+-include git-branches.mk
+
+branch-upstream ?= refs/remotes/upstream/master
+
+ifdef GIT_DIR
+export GIT_DIR
+export GIT_AUTHOR_NAME
+export GIT_AUTHOR_EMAIL
+gen-patches ?= gen-patches
+
+ifndef havespec
+$(SPECFILE:.spec=-t.%-fedora.spec): $(SPECFILE) $(gen-patches) FORCE
+	./$(gen-patches) --fedora < $< > $@ $(gen-patches-args)
+$(SPECFILE:.spec=-t.%.spec): $(SPECFILE) $(gen-patches) FORCE
+	./$(gen-patches) < $< > $@ $(gen-patches-args)
+.PRECIOUS: $(SPECFILE:.spec=-t.%.spec) $(SPECFILE:.spec=-t.%-fedora.spec)
+endif
+
+spec-%: $(SPECFILE:.spec=-t.%.spec) ;
+$(SPECFILE):;
+FORCE:;
+
+branch-of-* = $(firstword $(head-$*) $*)
+gen-patches-args = --name $* v$(VERSION) $(call heads,$(branch-of-*))
+define heads
+$(if $(tag-$1),$(filter-out v$(VERSION),$(tag-$1)),\
+     $(call heads,$(firstword $(branch-$1) $(branch-upstream)))) $1
+endef
+
+files-%-fedora:
+	@echo $(SPECFILE:.spec=-t.$*-fedora.spec)
+	@$(call list-patches,$(branch-of-*))
+files-%:
+	@echo $(SPECFILE:.spec=-t.$*.spec)
+	@$(call list-patches,$(branch-of-*))
+define list-patches
+$(if $(tag-$1),version=$(patsubst v%,%,$(tag-$1)),\
+     $(call list-patches,$(firstword $(branch-$1) $(branch-upstream)))); \
+echo linux-$${version}-$(patsubst refs/remotes/%/master,%,$1).patch
+endef
+
+ifndef tag-$(branch-upstream)
+tag-$(branch-upstream) := $(shell \
+	sed -n 's/^.*  *//;s/\.bz2$$//;s/patch-/v/p' sources)
+endif
+endif


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.3213
retrieving revision 1.3214
diff -u -r1.3213 -r1.3214
--- kernel-2.6.spec	7 Jun 2007 20:12:42 -0000	1.3213
+++ kernel-2.6.spec	8 Jun 2007 20:24:24 -0000	1.3214
@@ -41,6 +41,9 @@
 
 # Whether or not to do C=1 builds with sparse
 %define usesparse 0
+%if "%fedora" >= "7"
+%define usesparse 1
+%endif
 
 # Whether or not to apply the Xen patches -- leave this enabled
 %define includexen 0
@@ -63,7 +66,8 @@
 %define sublevel 21
 %define kversion 2.6.%{sublevel}
 %define rpmversion 2.6.%{sublevel}
-%define release %(R="$Revision$"; RR="${R##: }"; echo ${RR%%?})%{?dist}%{?buildid}
+%define specrelease %(R="$Revision$"; RR="${R##: }"; echo ${RR%%?})%{?dist}%{?buildid}
+%define release %{specrelease}
 
 %define make_target bzImage
 %define kernel_image x86
@@ -76,6 +80,24 @@
 %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}
 %define hdrarch %_target_cpu
 
+%if 0%{!?nopatches:1}
+%define nopatches 0
+%endif
+
+%if %{nopatches}
+%define includexen 0
+%define variant -vanilla
+%else
+%define variant_fedora -fedora
+%endif
+
+%define using_upstream_branch 0
+%if 0%{?upstream_branch:1}
+%define using_upstream_branch 1
+%define variant -%{upstream_branch}%{?variant_fedora}
+%define release %{upstream_branch_release}.%{specrelease}
+%endif
+
 # if requested, only build base kernel
 %if %{with_baseonly}
 %define with_smp 0
@@ -248,6 +270,15 @@
 %define kernel_image vmlinux
 %endif
 
+%if %{nopatches}
+%define with_modsign 0
+# Ignore unknown options in our config-* files.
+# Some options go with patches we're not applying.
+%define oldconfig_target loose_nonint_oldconfig
+%else
+%define oldconfig_target nonint_oldconfig
+%endif
+
 # To temporarily exclude an architecture from being built, add it to
 # %nobuildarches. Do _NOT_ use the ExclusiveArch: line, because if we
 # don't build kernel-headers then the new build system will no longer let
@@ -297,7 +328,7 @@
 #
 %define kernel_prereq  fileutils, module-init-tools, initscripts >= 8.11.1-1, mkinitrd >= 6.0.9-1
 
-Name: kernel
+Name: kernel%{?variant}
 Group: System Environment/Kernel
 License: GPLv2
 Version: %{rpmversion}
@@ -332,7 +363,9 @@
 BuildPreReq: gnupg
 %endif
 BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config
+%if %{usesparse}
 BuildRequires: sparse >= 0.3
+%endif
 BuildConflicts: rhbuildsys(DiskFree) < 500Mb
 
 
@@ -380,7 +413,16 @@
 Source81: config-rhel-x86-generic
 Source82: config-olpc-generic
 
+%if %{using_upstream_branch}
+### BRANCH PATCH ###
+%else
+# Here should be only the patches up to the upstream canonical Linus tree.
 Patch00: patch-2.6.22-rc4.bz2
+%endif
+
+%if !%{nopatches}
+
+# Patches 10 through 99 are for things that are going upstream really soon.
 Patch10: linux-2.6-utrace.patch
 Patch20: nouveau-drm.patch
 Patch30: linux-2.6-sysrq-c.patch
@@ -457,6 +499,8 @@
 Patch870: xen-11668-hvm_disable_fix.patch
 Patch880: xen-dom0-reboot.patch
 
+%endif
+
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root-%{_target_cpu}
 
 # Override find_provides to use a script that provides "kernel(symbol) = hash".
@@ -849,10 +893,16 @@
     patch -p1 -F1 -s < $RPM_SOURCE_DIR/$1
 }
 
+%if %{using_upstream_branch}
+### BRANCH APPLY ###
+%else
 
 # Update to latest upstream.
 bzcat $RPM_SOURCE_DIR/patch-2.6.22-rc4.bz2 | patch -p1 -F1 -s
 
+%endif
+%if !%{nopatches}
+
 # Patches 10 through 100 are meant for core subsystem upgrades
 
 # Roland's utrace ptrace replacement.
@@ -895,12 +945,14 @@
 #
 # Bugfixes to the core system and patches related to how RPMs are build
 #
+%endif
 
 # This patch adds a "make nonint_oldconfig" which is non-interactive and
 # also gives a list of missing options at the end. Useful for automated
 # builds (as used in the buildsystem).
 ApplyPatch linux-2.6-build-nonintconfig.patch
 
+%if !%{nopatches}
 # Exec shield
 ApplyPatch linux-2.6-execshield.patch
 
@@ -1076,6 +1128,7 @@
 ApplyPatch linux-2.6-warnings-register.patch
 
 # END OF PATCH APPLICATIONS
+%endif
 
 cp %{SOURCE10} Documentation/
 
@@ -1098,7 +1151,7 @@
 do
   mv $i .config
   Arch=`head -1 .config | cut -b 3-`
-  make ARCH=$Arch nonint_oldconfig > /dev/null
+  make ARCH=$Arch %{oldconfig_target} > /dev/null
   echo "# $Arch" > configs/$i
   cat .config >> configs/$i
 done
@@ -1184,7 +1237,7 @@
        KernelImage=arch/$Arch/boot/bzImage
     fi
 
-    make -s ARCH=$Arch nonint_oldconfig > /dev/null
+    make -s ARCH=$Arch %{oldconfig_target} > /dev/null
     make -s ARCH=$Arch %{?_smp_mflags} $MakeTarget %{?sparse_mflags}
     make -s ARCH=$Arch %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
 
@@ -2024,6 +2077,10 @@
 %endif
 
 %changelog
+* Fri Jun  8 2007 Roland McGrath <roland at redhat.com>
+- Add spec hacks to enable building alternate vanilla and git-based rpms.
+- Enable sparse checking in build for F7 and later.
+
 * Thu Jun 07 2007 John W. Linville <linville at redhat.com>
 - Re-introduce iwlwifi patch w/ update to version 0.0.24
 

linux-2.6-build-nonintconfig.patch:

Index: linux-2.6-build-nonintconfig.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-build-nonintconfig.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- linux-2.6-build-nonintconfig.patch	28 May 2007 03:29:08 -0000	1.7
+++ linux-2.6-build-nonintconfig.patch	8 Jun 2007 20:24:24 -0000	1.8
@@ -1,15 +1,29 @@
-diff -urNp --exclude-from=/home/davej/.exclude linux-600/scripts/kconfig/conf.c linux-800/scripts/kconfig/conf.c
---- linux-600/scripts/kconfig/conf.c
-+++ linux-800/scripts/kconfig/conf.c
-@@ -20,6 +20,7 @@ enum {
+--- linux-2.6.17/scripts/kconfig/Makefile.nonintconfig
++++ linux-2.6.17/scripts/kconfig/Makefile
+@@ -23,6 +23,11 @@ oldconfig: $(obj)/conf
+ silentoldconfig: $(obj)/conf
+ 	$< -s arch/$(ARCH)/Kconfig
+ 
++nonint_oldconfig: $(obj)/conf
++	$< -b arch/$(ARCH)/Kconfig
++loose_nonint_oldconfig: $(obj)/conf
++	$< -B arch/$(ARCH)/Kconfig
++
+ update-po-config: $(obj)/kxgettext
+ 	xgettext --default-domain=linux \
+           --add-comments --keyword=_ --keyword=N_ \
+--- linux-2.6.17/scripts/kconfig/conf.c.nonintconfig
++++ linux-2.6.17/scripts/kconfig/conf.c
+@@ -21,6 +21,8 @@ enum {
  	ask_all,
  	ask_new,
  	ask_silent,
 +	dont_ask,
++	dont_ask_dont_tell,
  	set_default,
  	set_yes,
  	set_mod,
-@@ -37,6 +37,8 @@ static struct menu *rootEntry;
+@@ -37,6 +39,8 @@ static struct menu *rootEntry;
  
  static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
  
@@ -18,7 +32,7 @@
  static void strip(char *str)
  {
  	char *p = str;
-@@ -93,6 +96,12 @@ static void conf_askvalue(struct symbol 
+@@ -103,6 +107,14 @@ static void conf_askvalue(struct symbol 
  		fflush(stdout);
  		fgets(line, 128, stdin);
  		return;
@@ -27,76 +41,71 @@
 +			fprintf(stderr,"CONFIG_%s\n",sym->name);
 +			return_value++;
 +		}
++		/*FALLTHROUGH*/
++	case dont_ask_dont_tell:
 +		return;
  	case set_default:
  		printf("%s\n", def);
  		return;
-@@ -337,6 +346,10 @@ static int conf_choice(struct menu *menu
+@@ -346,6 +358,11 @@ static int conf_choice(struct menu *menu
  			printf("?");
  		printf("]: ");
  		switch (input_mode) {
 +		case dont_ask:
++		case dont_ask_dont_tell:
 +			cnt = def;
 +			printf("%d\n", cnt);
 +			break;
  		case ask_new:
  		case ask_silent:
  			if (!is_new) {
-@@ -495,7 +495,10 @@ static void check_conf(struct menu *menu
+@@ -482,6 +499,10 @@ static void check_conf(struct menu *menu
  			if (!conf_cnt++)
  				printf(_("*\n* Restart config...\n*\n"));
  			rootEntry = menu_get_parent_menu(menu);
--			conf(rootEntry);
-+			if (input_mode == dont_ask)
++			if (input_mode == dont_ask
++			    || input_mode == dont_ask_dont_tell)
 +				fprintf(stderr,"CONFIG_%s\n",sym->name);
 +			else
-+				conf(rootEntry);
+ 			conf(rootEntry);
  		}
  	}
- 
-@@ -517,6 +517,9 @@ int main(int ac, char **av)
+@@ -501,6 +522,12 @@ int main(int ac, char **av)
  		case 'o':
  			input_mode = ask_new;
  			break;
 +		case 'b':
 +			input_mode = dont_ask;
 +			break;
++		case 'B':
++			input_mode = dont_ask_dont_tell;
++			break;
  		case 's':
  			input_mode = ask_silent;
  			valid_stdin = isatty(0) && isatty(1) && isatty(2);
-@@ -557,6 +576,7 @@ int main(int ac, char **av)
+@@ -566,6 +593,8 @@ int main(int ac, char **av)
  		}
  	case ask_all:
  	case ask_new:
 +	case dont_ask:
++	case dont_ask_dont_tell:
  		conf_read(NULL);
  		break;
- 	default:
-@@ -632,7 +632,7 @@ int main(int ac, char **av)
+ 	case set_no:
+@@ -612,7 +641,8 @@ int main(int ac, char **av)
  	do {
  		conf_cnt = 0;
  		check_conf(&rootmenu);
 -	} while (conf_cnt);
-+	} while ((conf_cnt) && (input_mode != dont_ask));
++ 	} while (conf_cnt && (input_mode != dont_ask
++			      && input_mode != dont_ask_dont_tell));
  	if (conf_write(NULL)) {
  		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
  		return 1;
-@@ -643,5 +643,5 @@ skip_check:
+@@ -623,5 +653,5 @@ skip_check:
  		return 1;
  	}
  
 -	return 0;
 +	return return_value;
  }
---- linux-2.6.16.noarch/scripts/kconfig/Makefile~	2006-03-25 15:55:18.000000000 -0500
-+++ linux-2.6.16.noarch/scripts/kconfig/Makefile	2006-03-25 15:55:47.000000000 -0500
-@@ -23,6 +23,9 @@ oldconfig: $(obj)/conf
- silentoldconfig: $(obj)/conf
- 	$< -s arch/$(ARCH)/Kconfig
- 
-+nonint_oldconfig: scripts/kconfig/conf
-+	./scripts/kconfig/conf -b arch/$(ARCH)/Kconfig
-+
- update-po-config: $(obj)/kxgettext
- 	xgettext --default-domain=linux \
-           --add-comments --keyword=_ --keyword=N_ \




More information about the fedora-extras-commits mailing list