[kernel] r15651 - in dists/sid/linux-2.6: . debian debian/bin debian/lib/python/debian_linux debian/templates

Bastian Blank waldi at alioth.debian.org
Sun May 9 16:50:32 UTC 2010


Author: waldi
Date: Sun May  9 16:50:27 2010
New Revision: 15651

Log:
Merge debugging package support.

Added:
   dists/sid/linux-2.6/debian/templates/control.image-dbg.in
      - copied, changed from r15566, dists/trunk/linux-2.6/debian/templates/control.image-dbg.in
Modified:
   dists/sid/linux-2.6/   (props changed)
   dists/sid/linux-2.6/debian/bin/gencontrol.py
   dists/sid/linux-2.6/debian/bin/kconfig.py
   dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py
   dists/sid/linux-2.6/debian/lib/python/debian_linux/kconfig.py
   dists/sid/linux-2.6/debian/rules.real

Modified: dists/sid/linux-2.6/debian/bin/gencontrol.py
==============================================================================
--- dists/sid/linux-2.6/debian/bin/gencontrol.py	Sun May  9 08:09:46 2010	(r15650)
+++ dists/sid/linux-2.6/debian/bin/gencontrol.py	Sun May  9 16:50:27 2010	(r15651)
@@ -110,6 +110,7 @@
         config_entry_base = self.config.merge('base', arch, featureset, flavour)
         config_entry_description = self.config.merge('description', arch, featureset, flavour)
         config_entry_image = self.config.merge('image', arch, featureset, flavour)
+        config_entry_image_dbg = self.config.merge('image-dbg', arch, featureset, flavour)
         config_entry_relations = self.config.merge('relations', arch, featureset, flavour)
 
         compiler = config_entry_base.get('compiler', 'gcc')
@@ -197,6 +198,11 @@
             packages_own.append(package_headers)
             extra['headers_arch_depends'].append('%s (= ${binary:Version})' % packages_own[-1]['Package'])
 
+        build_debug = config_entry_image_dbg.get('enabled')
+        if build_debug:
+            makeflags['DEBUG'] = True
+            packages_own.extend(self.process_packages(self.templates['control.image-dbg'], vars))
+
         self.merge_packages(packages, packages_own + packages_dummy, arch)
 
         if config_entry_image['type'] == 'plain-xen':
@@ -245,6 +251,8 @@
         kconfig.extend(check_config("%s/%s/config" % (arch, featureset), False, arch, featureset))
         kconfig.extend(check_config("%s/%s/config.%s" % (arch, featureset, flavour), False, arch, featureset, flavour))
         makeflags['KCONFIG'] = ' '.join(kconfig)
+        if build_debug:
+            makeflags['KCONFIG_OPTIONS'] = '-o DEBUG_INFO=y'
 
         cmds_binary_arch = ["$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags]
         if packages_dummy:

Modified: dists/sid/linux-2.6/debian/bin/kconfig.py
==============================================================================
--- dists/sid/linux-2.6/debian/bin/kconfig.py	Sun May  9 08:09:46 2010	(r15650)
+++ dists/sid/linux-2.6/debian/bin/kconfig.py	Sun May  9 16:50:27 2010	(r15651)
@@ -1,13 +1,37 @@
 #!/usr/bin/env python
 
-import optparse, os.path, sys
+import optparse
+import os.path
+import re
+import sys
+
 from debian_linux.kconfig import *
 
-def merge(output, *config):
+def merge(output, configs, overrides):
     kconfig = KconfigFile()
-    for c in config:
+    for c in configs:
         kconfig.read(file(c))
+    for key, value in overrides.iteritems():
+        kconfig.set(key, value)
     file(output, "w").write(str(kconfig))
 
+def opt_callback_dict(option, opt, value, parser):
+    match = re.match('^\s*(\S+)=(\S+)\s*$', value)
+    if not match:
+        raise optparse.OptionValueError('not key=value')
+    dest = option.dest
+    data = getattr(parser.values, dest)
+    data[match.group(1)] = match.group(2)
+
 if __name__ == '__main__':
-    sys.exit(merge(*sys.argv[1:]))
+    parser = optparse.OptionParser(usage = "%prog [OPTION]... FILE...")
+    parser.add_option('-o', '--override',
+            action='callback',
+            callback=opt_callback_dict,
+            default={},
+            dest='overrides',
+            help="Override option",
+            type='string')
+    options, args = parser.parse_args()
+
+    merge(args[0], args[1:], options.overrides)

Modified: dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py
==============================================================================
--- dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py	Sun May  9 08:09:46 2010	(r15650)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/config.py	Sun May  9 16:50:27 2010	(r15651)
@@ -121,6 +121,9 @@
             'initramfs': SchemaItemBoolean(),
             'initramfs-generators': SchemaItemList(),
         },
+        'image-dbg': {
+            'enabled': SchemaItemBoolean(),
+        },
         'relations': {
         },
         'xen': {

Modified: dists/sid/linux-2.6/debian/lib/python/debian_linux/kconfig.py
==============================================================================
--- dists/sid/linux-2.6/debian/lib/python/debian_linux/kconfig.py	Sun May  9 08:09:46 2010	(r15650)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/kconfig.py	Sun May  9 16:50:27 2010	(r15651)
@@ -55,19 +55,22 @@
                 i = line.find('=')
                 option = line[7:i]
                 value = line[i+1:]
-                if value in ('y', 'm'):
-                    entry = EntryTristate(option, value)
-                else:
-                    entry = EntryString(option, value)
-                self[option] = entry
+                self.set(option, value)
             elif line.startswith("# CONFIG_"):
                 option = line[9:-11]
-                self[option] = EntryTristate(option)
+                self.set(option, 'n')
             elif line.startswith("#") or not line:
                 pass
             else:
                 raise RuntimeError, "Can't recognize %s" % line
 
+    def set(self, key, value):
+        if value in ('y', 'm', 'n'):
+            entry = EntryTristate(key, value)
+        else:
+            entry = EntryString(key, value)
+        self[key] = entry
+
     def str_iter(self):
         for key, value in self.iteritems():
             yield str(value)

Modified: dists/sid/linux-2.6/debian/rules.real
==============================================================================
--- dists/sid/linux-2.6/debian/rules.real	Sun May  9 08:09:46 2010	(r15650)
+++ dists/sid/linux-2.6/debian/rules.real	Sun May  9 16:50:27 2010	(r15651)
@@ -40,6 +40,9 @@
 binary-arch-arch: install-libc-dev_$(ARCH)
 binary-arch-featureset: install-headers_$(ARCH)_$(FEATURESET)
 binary-arch-flavour: install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
+ifeq ($(DEBUG),True)
+  binary-arch-flavour: install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+endif
 ifeq ($(MODULES),True)
   binary-arch-flavour: install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
 endif
@@ -60,7 +63,7 @@
 source-featureset: $(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET)
 
 $(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(KCONFIG)
-	python debian/bin/kconfig.py '$@' $(KCONFIG)
+	python debian/bin/kconfig.py '$@' $(KCONFIG) $(KCONFIG_OPTIONS)
 
 $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
 $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION)
@@ -150,7 +153,7 @@
 	dh_shlibdeps
 	dh_gencontrol -- $(GENCONTROL_ARGS)
 	dh_md5sums
-	dh_builddeb
+	dh_builddeb -- $(BUILDDEB_ARGS)
 
 install-dummy:
 	dh_testdir
@@ -326,7 +329,7 @@
 	  install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image \
 	  DIR='$(DIR)' PACKAGE_DIR='$(PACKAGE_DIR)' INSTALL_DIR='$(INSTALL_DIR)' REAL_VERSION='$(REAL_VERSION)'
 ifeq ($(MODULES),True)
-	+$(MAKE_CLEAN) -C $(DIR) modules_install INSTALL_MOD_PATH='$(CURDIR)'/$(PACKAGE_DIR)
+	+$(MAKE_CLEAN) -C $(DIR) modules_install INSTALL_MOD_PATH='$(CURDIR)'/$(PACKAGE_DIR) INSTALL_MOD_STRIP=1
 	cp $(DIR)/.config $(PACKAGE_DIR)/boot/config-$(REAL_VERSION)
 	cp $(DIR)/System.map $(PACKAGE_DIR)/boot/System.map-$(REAL_VERSION)
 	rm $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/{build,source,modules.*}
@@ -440,6 +443,25 @@
 	echo /var/lib/$(PACKAGE_NAME)/xen-versions >> $(PACKAGE_DIR)/DEBIAN/conffiles
 	+$(MAKE_SELF) install-base DH_OPTIONS='-p$(PACKAGE_NAME) -p$(MODULES_PACKAGE_NAME)'
 
+install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
+install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME = linux-image-$(REAL_VERSION)-dbg
+install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_DIR = debian/$(PACKAGE_NAME)
+install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): DEBUG_DIR = $(PACKAGE_DIR)/usr/lib/debug
+install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): DIR = $(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
+install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): DH_OPTIONS = -p$(PACKAGE_NAME)
+install-image-dbg_$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs usr/lib/debug
+	install -m644 $(DIR)/vmlinux $(DEBUG_DIR)/vmlinux-$(REAL_VERSION)
+ifeq ($(MODULES),True)
+	+$(MAKE_CLEAN) -C $(DIR) modules_install INSTALL_MOD_PATH='$(CURDIR)'/$(DEBUG_DIR)
+	rm $(DEBUG_DIR)/lib/modules/*/{build,source,modules.*}
+	rm $(DEBUG_DIR)/lib/firmware -rf
+endif
+	+$(MAKE_SELF) install-base BUILDDEB_ARGS="-Zbzip2"
+
 install-patch: PACKAGE = linux-patch-debian-$(VERSION)
 install-patch: pbase := /usr/src/kernel-patches/all/$(UPSTREAMVERSION)
 install-patch: pfull := debian/$(PACKAGE)$(pbase)

Copied and modified: dists/sid/linux-2.6/debian/templates/control.image-dbg.in (from r15566, dists/trunk/linux-2.6/debian/templates/control.image-dbg.in)
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/control.image-dbg.in	Tue Apr 27 08:50:30 2010	(r15566, copy source)
+++ dists/sid/linux-2.6/debian/templates/control.image-dbg.in	Sun May  9 16:50:27 2010	(r15651)
@@ -1,3 +1,6 @@
 Package: linux-image- at upstreamversion@@abiname@@localversion at -dbg
+Section: debug
+Priority: extra
 Description: Debugging infos for Linux @upstreamversion@@abiname@@localversion@
- TODO
+ This package provides the binary debug image and pre-built debug loadable                                                     
+ modules for Linux kernel @upstreamversion@ on @longclass@ machines.



More information about the Kernel-svn-changes mailing list