[kernel] r5144 - in dists/trunk/linux-2.6/debian: . bin templates

Sven Luther luther at costa.debian.org
Fri Dec 30 08:46:39 UTC 2005


Author: luther
Date: Fri Dec 30 08:46:37 2005
New Revision: 5144

Added:
   dists/trunk/linux-2.6/debian/bin/kconfig.ml
      - copied, changed from r5143, dists/trunk/scripts/kconfig.ml
Modified:
   dists/trunk/linux-2.6/debian/changelog
   dists/trunk/linux-2.6/debian/rules.real
   dists/trunk/linux-2.6/debian/templates/control.source.in
Log:
Added kconfig.ml and now use it to generate the config files from the snipplets,
keeping more specific options over more generic ones.
Build-depend on k-p 10.028 or higher.


Copied: dists/trunk/linux-2.6/debian/bin/kconfig.ml (from r5143, dists/trunk/scripts/kconfig.ml)
==============================================================================
--- dists/trunk/scripts/kconfig.ml	(original)
+++ dists/trunk/linux-2.6/debian/bin/kconfig.ml	Fri Dec 30 08:46:37 2005
@@ -2,16 +2,22 @@
 
 let basedir = ref "debian/arch"
 let arch = ref ""
+let subarch = ref ""
 let flavour = ref ""
 let config_name = ref ""
+let verbose = ref false
+let archindir = ref false
 
 let spec = [
   "-b", Arg.Set_string basedir, "base dir of the arch configurations [default: debian/arch]";
-  "-a", Arg.Set_string arch, "architecture";
+  "-ba", Arg.Set archindir, "basedir includes arch";
+  "-a", Arg.Set_string arch, "arch";
+  "-s", Arg.Set_string subarch, "subarch";
   "-f", Arg.Set_string flavour, "flavour";
+  "-v", Arg.Set verbose, "verbose";
 ]
 let usage =
-  "./kconfig.ml [ -b basedir ] -a arch -f flavour" ^ "\n" ^
+  "./kconfig.ml [ -b basedir ] -a arch [ -s subarch ] -f flavour" ^ "\n" ^
   "./kconfig.ml config_file"
 
 let () = Arg.parse
@@ -86,7 +92,23 @@
 
 let print_config m = C.iter (function _ -> print_option) m
 
+let parse_config_file name m force =
+  try 
+    let config = open_in name in
+    let m = parse_config config m in
+    close_in config;
+    m
+  with Sys_error s ->
+    if force then raise (Sys_error s) else m
+
 let () =
+  begin
+    if !verbose then
+      if !config_name <> "" then
+        Printf.printf "Reading config file %s" !config_name
+      else
+        Printf.printf "Creating config file for arch %s, subarch %s, flavour %s (basedir is %s)\n" !arch !subarch !flavour !basedir
+  end;
   if !config_name <> "" then 
     try
       let config = open_in !config_name in
@@ -96,15 +118,20 @@
     with Sys_error s -> Printf.printf "Error: %s\n" s
   else if !arch <> "" && !flavour <> "" then
     try
-      let config = open_in (!basedir ^ "/config") in
-      let m = parse_config config C.empty in
-      close_in config;
-      let config = open_in (!basedir ^ "/" ^ !arch ^ "/config") in
-      let m = parse_config config C.empty in
-      close_in config;
-      let config = open_in (!basedir ^ "/" ^ !arch ^ "/config." ^ !flavour) in
-      let m = parse_config config C.empty in
-      close_in config;
+      let dir = if !archindir then Filename.dirname !basedir else !basedir in
+      let m = parse_config_file (dir ^ "/config") C.empty false in
+      let archdir = dir ^ "/" ^ !arch in
+      let m = parse_config_file (archdir ^ "/config") m false in
+      let () = if !verbose then Printf.printf "XXX archdir is %s\n" archdir else () in
+      let m, archdir = 
+        if !subarch <> ""  && !subarch <> "none" then 
+	  let () = if !verbose then Printf.printf "XXX subarch case ... subarch is %s\n" !subarch else () in
+	  let archdir = archdir ^ "/" ^ !subarch in
+          parse_config_file (archdir ^ "/config") m false, archdir
+	else m, archdir
+      in
+      let () = if !verbose then Printf.printf "XXX archdir is %s\n" archdir else () in
+      let m = parse_config_file (archdir ^ "/config." ^ !flavour) m true in
       print_config m;
     with Sys_error s -> Printf.printf "Error: %s\n" s
   else

Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog	(original)
+++ dists/trunk/linux-2.6/debian/changelog	Fri Dec 30 08:46:37 2005
@@ -44,6 +44,12 @@
   * [powerpc] Fixed apus patch for 2.6.15-rc7 (and beyond hopefully).
   * [powerpc] Fixed config options, but i guess jonas broke it again with his
     cleanup, oh well :)
+  * Added debian/bin/kconfig.ml to process config file snipplet, so we can
+    preserve the pre 2.6.15 ordering of config file snipplets. Upto 2.6.15
+    the kernel Kconfig magic apparently kept the later occuring config options,
+    but it seems that this is no more the case. Instead of catting the config
+    files together, not use the kconfig.ml script to read in the files from
+    more generic to more specific, and keep only the more specific.
   
   [ Jurij Smakov ]
   * [sparc] Correct the patch for the atyfb framebuffer driver

Modified: dists/trunk/linux-2.6/debian/rules.real
==============================================================================
--- dists/trunk/linux-2.6/debian/rules.real	(original)
+++ dists/trunk/linux-2.6/debian/rules.real	Fri Dec 30 08:46:37 2005
@@ -93,14 +93,7 @@
 endif
 $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(basedir)/config.$(FLAVOUR) $(config_common)
 	@echo "Generating configuration file $@:"
-	rm -f '$@'
-	for i in $(config_common); do	\
-	  if [ -f "$${i}" ]; then	\
-	    cat "$${i}" >> '$@';	\
-	  fi;				\
-	done
-#	Flavour config file must be present
-	cat '$(basedir)/config.$(FLAVOUR)' >> '$@'
+	debian/bin/kconfig.ml -b "$(basedir)" -a "$(ARCH)" -s "$(SUBARCH)" -f "$(FLAVOUR)" > '$@'
 
 $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
 $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION)

Modified: dists/trunk/linux-2.6/debian/templates/control.source.in
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/control.source.in	(original)
+++ dists/trunk/linux-2.6/debian/templates/control.source.in	Fri Dec 30 08:46:37 2005
@@ -4,5 +4,5 @@
 Maintainer: Debian Kernel Team <debian-kernel at lists.debian.org>
 Uploaders: Andres Salomon <dilinger at debian.org>, Bastian Blank <waldi at debian.org>, Simon Horman <horms at debian.org>, Sven Luther <luther at debian.org>, Jonas Smedegaard <dr at jones.dk>, Norbert Tretkowski <nobse at debian.org>, Frederik Schüler <fs at debian.org>
 Standards-Version: 3.6.1.0
-Build-Depends: gcc (>= 4:4.0) [!m68k], gcc-3.3 [m68k], binutils-hppa64 [hppa], gcc-4.0-hppa64 [hppa], debhelper (>= 4.1.0), module-init-tools, dpkg-dev (>= 1.10.23), debianutils (>= 1.6), bzip2, sparc-utils [sparc], kernel-package (>= 9.008.3)
+Build-Depends: gcc (>= 4:4.0) [!m68k], gcc-3.3 [m68k], binutils-hppa64 [hppa], gcc-4.0-hppa64 [hppa], debhelper (>= 4.1.0), module-init-tools, dpkg-dev (>= 1.10.23), debianutils (>= 1.6), bzip2, sparc-utils [sparc], kernel-package (>= 10.028), ocaml-interp
 Build-Depends-Indep: docbook-utils, gs, transfig, xmlto, dh-kpatches (>= 0.99.3)



More information about the Kernel-svn-changes mailing list