[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Obsolete support for old-style xen and kernel-package types in debian/ dir



I noticed that debian/templates/ contains a bunch of what I think is
obsolete support for old-style Xen split-modules packaging as well as
the kernel-package image type. Is it worth cleaning that up in trunk
and/or sid? Specifically I think the following could be removed:
        debian/templates/control.image.type-kernel-package.in
        debian/templates/control.image.type-modulesextra.in
        debian/templates/control.image.type-modulesinline.in
        debian/templates/image.xen.postinst.in
        debian/templates/image.xen.postrm.in
        debian/templates/image.xen.prerm.in
and debian/bin/gencontrol.py:do_flavour_packages could be simplified by
switching uses of "type: plain-s390-tape" to "type: standalone" allowing
removal of the special casing in favour of something like:
        +        image = self.templates["control.image.type-%s" % config_entry_image['type']]
        +        build_modules = config_entry_image['type'] != 'standalone'
(or maybe a separate 'modules' boolean in the config entries)

I'm not sure that the "provides: linux-modules-xxx" in image.type-plain
is still useful if the modulesextra variant is removed, I suspect that
could also be dropped.

The patch at the bottom illustrates what I think could be dropped if
desired.

(I suspect there is also scope for similar cleanups in linux-latest-2.6)

I also noticed that control.image.type-standalone.in and
debian/templates/control.image.type-plain.in differ in that the former
does not depend on module-init-tools (which is certainly deliberate) but
it also does not recommend firmware-linux-free or depend on linux-base
+debconf (which I'm not sure about).

I happened to notice all of this while investigating a warning from the
build process:
        dpkg-gencontrol: warning: Depends field of package <...>: unknown substitution variable ${shlibs:Depends}

I suspect shlibs:Depends can be removed from the depends in
templates/control.image.*.in since a linux-image package is unlikely to
contain binaries with shlibs dependencies IMHO.

Ian

diff --git a/linux-2.6/debian/bin/gencontrol.py b/linux-2.6/debian/bin/gencontrol.py
index 389660a..fa1a47e 100755
--- a/linux-2.6/debian/bin/gencontrol.py
+++ b/linux-2.6/debian/bin/gencontrol.py
@@ -155,29 +155,8 @@ class Gencontrol(Base):
         packages_dummy = []
         packages_own = []
 
-        if config_entry_image['type'] == 'plain-s390-tape':
-            image = self.templates["control.image.type-standalone"]
-            build_modules = False
-        elif config_entry_image['type'] == 'plain-xen':
-            raise RuntimeError
-            image = self.templates["control.image.type-modulesextra"]
-            build_modules = True
-            config_entry_xen = self.config.merge('xen', arch, featureset, flavour)
-            if config_entry_xen.get('dom0-support', True):
-                p = self.process_packages(self.templates['control.xen-linux-system'], vars)
-                l = PackageRelationGroup()
-                xen_versions = []
-                for xen_flavour in config_entry_xen['flavours']:
-                    for version in config_entry_xen['versions']:
-                        l.append("xen-hypervisor-%s-%s" % (version, xen_flavour))
-                        xen_versions.append('%s-%s' % (version, xen_flavour))
-                makeflags['XEN_VERSIONS'] = ' '.join(xen_versions)
-                p[0]['Depends'].append(l)
-                packages_dummy.extend(p)
-        else:
-            build_modules = True
-            image = self.templates["control.image.type-%s" % config_entry_image['type']]
-            #image = self.templates["control.image.type-modulesinline"]
+        image = self.templates["control.image.type-%s" % config_entry_image['type']]
+        build_modules = config_entry_image['type'] != 'standalone'
 
         config_entry_xen = self.config.merge('xen', arch, featureset, flavour)
         if config_entry_xen.get('dom0-support', False):
@@ -207,11 +186,6 @@ class Gencontrol(Base):
 
         self.merge_packages(packages, packages_own + packages_dummy, arch)
 
-        if config_entry_image['type'] == 'plain-xen':
-            for i in ('postinst', 'postrm', 'prerm'):
-                j = self.substitute(self.templates["image.xen.%s" % i], vars)
-                file("debian/%s.%s" % (packages_own[0]['Package'], i), 'w').write(j)
-
         def get_config(*entry_name):
             entry_real = ('image',) + entry_name
             entry = self.config.get(entry_real, None)
diff --git a/linux-2.6/debian/config/s390/defines b/linux-2.6/debian/config/s390/defines
index 8f58399..8f29ab7 100644
--- a/linux-2.6/debian/config/s390/defines
+++ b/linux-2.6/debian/config/s390/defines
@@ -28,7 +28,7 @@ parts: tape
 [s390-tape_image]
 initramfs: false
 override-localversion: s390
-type: plain-s390-tape
+type: standalone
 
 [s390x_description]
 hardware: IBM zSeries
@@ -44,5 +44,5 @@ parts: tape
 [s390x-tape_image]
 initramfs: false
 override-localversion: s390x
-type: plain-s390-tape
+type: standalone
 
diff --git a/linux-2.6/debian/templates/control.image.type-kernel-package.in b/linux-2.6/debian/templates/control.image.type-kernel-package.in
deleted file mode 100644
index 391a44d..0000000
--- a/linux-2.6/debian/templates/control.image.type-kernel-package.in
+++ /dev/null
@@ -1,7 +0,0 @@
-Package: linux-image-@upstreamversion@@abiname@@localversion@
-Provides: linux-image, linux-image-@major@, linux-modules-@upstreamversion@@abiname@@localversion@
-Pre-Depends: debconf | debconf-2.0
-Depends: module-init-tools, ${misc:Depends}
-Suggests: linux-doc-@version@
-Description: Linux @upstreamversion@ for @class@
- The Linux kernel @upstreamversion@ and modules for use on @longclass@.
diff --git a/linux-2.6/debian/templates/control.image.type-modulesextra.in b/linux-2.6/debian/templates/control.image.type-modulesextra.in
deleted file mode 100644
index a3e84f8..0000000
--- a/linux-2.6/debian/templates/control.image.type-modulesextra.in
+++ /dev/null
@@ -1,11 +0,0 @@
-Package: linux-image-@upstreamversion@@abiname@@localversion@
-Provides: linux-image, linux-image-@major@
-Depends: linux-modules-@upstreamversion@@abiname@@localversion@ (= ${binary:Version}), ${misc:Depends}
-Suggests: linux-doc-@version@
-Description: Linux @upstreamversion@ for @class@
- The Linux kernel @upstreamversion@ for use on @longclass@.
-
-Package: linux-modules-@upstreamversion@@abiname@@localversion@
-Depends: module-init-tools, ${misc:Depends}
-Description: Linux @upstreamversion@ modules for @class@
- Modules for Linux kernel @upstreamversion@ for use on @longclass@.
diff --git a/linux-2.6/debian/templates/control.image.type-modulesinline.in b/linux-2.6/debian/templates/control.image.type-modulesinline.in
deleted file mode 100644
index dcc82a9..0000000
--- a/linux-2.6/debian/templates/control.image.type-modulesinline.in
+++ /dev/null
@@ -1,6 +0,0 @@
-Package: linux-image-@upstreamversion@@abiname@@localversion@
-Provides: linux-image, linux-image-@major@, linux-modules-@upstreamversion@@abiname@@localversion@
-Depends: module-init-tools, ${misc:Depends}
-Suggests: linux-doc-@version@
-Description: Linux @upstreamversion@ for @class@
- The Linux kernel @upstreamversion@ for use on @longclass@.
diff --git a/linux-2.6/debian/templates/control.image.type-plain.in b/linux-2.6/debian/templates/control.image.type-plain.in
index 4a00c40..d838369 100644
--- a/linux-2.6/debian/templates/control.image.type-plain.in
+++ b/linux-2.6/debian/templates/control.image.type-plain.in
@@ -1,7 +1,7 @@
 Package: linux-image-@upstreamversion@@abiname@@localversion@
 Provides: linux-image, linux-image-@major@, linux-modules-@upstreamversion@@abiname@@localversion@
 Pre-Depends: debconf | debconf-2.0
-Depends: module-init-tools, linux-base (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends: module-init-tools, linux-base (>= ${source:Version}), ${misc:Depends}
 Recommends: firmware-linux-free (>= @source_upstream@)
 Suggests: linux-doc-@version@
 Description: Linux @upstreamversion@ for @class@
diff --git a/linux-2.6/debian/templates/control.image.type-standalone.in b/linux-2.6/debian/templates/control.image.type-standalone.in
index c15b1d8..a75d9ae 100644
--- a/linux-2.6/debian/templates/control.image.type-standalone.in
+++ b/linux-2.6/debian/templates/control.image.type-standalone.in
@@ -1,6 +1,6 @@
 Package: linux-image-@upstreamversion@@abiname@@localversion@
 Provides: linux-image, linux-image-@major@
+Depends: ${misc:Depends}
 Suggests: linux-doc-@version@
-Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Linux @upstreamversion@ for @class@
  The Linux kernel @upstreamversion@ for use on @longclass@.
diff --git a/linux-2.6/debian/templates/image.xen.postinst.in b/linux-2.6/debian/templates/image.xen.postinst.in
deleted file mode 100644
index 5b6e8b1..0000000
--- a/linux-2.6/debian/templates/image.xen.postinst.in
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-set -e
-
-case "$1" in
-    configure)
-        if [ "$2" ]; then
-            update-initramfs -u -k @upstreamversion@@abiname@@localversion@
-        else
-            update-initramfs -c -t -k @upstreamversion@@abiname@@localversion@
-            command -v update-grub > /dev/null && update-grub
-        fi
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-#DEBHELPER#
-
-exit 0
-
-
diff --git a/linux-2.6/debian/templates/image.xen.postrm.in b/linux-2.6/debian/templates/image.xen.postrm.in
deleted file mode 100644
index 9ce193b..0000000
--- a/linux-2.6/debian/templates/image.xen.postrm.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-set -e
-
-case "$1" in
-    remove)
-        command -v update-grub > /dev/null && update-grub
-    ;;
-
-    purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-
-    *)
-        echo "postrm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff --git a/linux-2.6/debian/templates/image.xen.prerm.in b/linux-2.6/debian/templates/image.xen.prerm.in
deleted file mode 100644
index afeecaa..0000000
--- a/linux-2.6/debian/templates/image.xen.prerm.in
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -e
-
-case "$1" in
-    remove)
-        update-initramfs -d -k @upstreamversion@@abiname@@localversion@ || true
-    ;;
-
-    upgrade|deconfigure|failed-upgrade)
-    ;;
-
-    *)
-        echo "prerm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-#DEBHELPER#
-
-exit 0
-
-

-- 
Ian Campbell

When I was in school, I cheated on my metaphysics exam: I looked into
the soul of the boy sitting next to me.
		-- Woody Allen


Reply to: