Maverick pull request, LP587893

Message ID
State Accepted
Delegated to: Leann Ogasawara
Headers show

Commit Message

Tim Gardner June 2, 2010, 4:54 p.m.

Please find included a pull request to correct the virtual flavour size 
issues. I've added debian/docs/README.inclusion-list which explains
my reasoning.



Leann Ogasawara June 2, 2010, 8:02 p.m. | #1
Applied to Maverick master.



diff --git a/debian.master/d-i/modules/block-modules b/debian.master/d-i/modules/block-modules
index ada17c5..27f9e9d 100644
--- a/debian.master/d-i/modules/block-modules
+++ b/debian.master/d-i/modules/block-modules
@@ -5,7 +5,7 @@  bpck6 ?
 cciss ?
 comm ?
 cpqarray ?
+DAC960 ?
 dstr ?
 epat ?
 epia ?

From e2f71a8c2da1ec118abe50a7a5e9d85a4c936b1d Mon Sep 17 00:00:00 2001
From: Tim Gardner <>
Date: Tue, 1 Jun 2010 11:39:15 -0600
Subject: [PATCH 2/3] UBUNTU: [Config] Added module inclusion support

In order to preserve some semblance of commonality in the
config files, I decided to build the virtual flavour by compiling all
of the default modules, then whittling the package down by removing modules
not specifically required for the virtual flavour. The package construction
process looks for a file in debian.<BRANCH>/control.d/<FLAVOUR>.inclusion-list
for a recipe. Note that you may also have to define some udeb module flavour
exclusions in debian.<BRANCH>/d-i/exclude-<ARCH>-<FLAVOUR>.

Signed-off-by: Tim Gardner <>
 debian/docs/README.inclusion-list |   51 +++++++++++++++++++++++++++++++++++++
 debian/rules.d/   |   11 ++++++++
 debian/scripts/module-inclusion   |   51 +++++++++++++++++++++++++++++++++++++
 3 files changed, 113 insertions(+), 0 deletions(-)
 create mode 100644 debian/docs/README.inclusion-list
 create mode 100755 debian/scripts/module-inclusion

diff --git a/debian/docs/README.inclusion-list b/debian/docs/README.inclusion-list
new file mode 100644
index 0000000..b025393
--- /dev/null
+++ b/debian/docs/README.inclusion-list
@@ -0,0 +1,51 @@ 
+This README describes the reason for, and the use of, module
+inclusion lists.
+The original Hardy release had the notion of sub-flavours,
+e.g., a flavour that was constructed as a subset of an existing flavour.
+For example, the virtual flavour was extracted from the server flavour using
+a subset of the server flavour modules. However, there were some difficult
+mainteneance issues with regard to packaging, make rules, and scripts. This
+re-implementation of the sub-flavours philosophy is hopefully simpler,
+and retrofitable to all releases.
+A module inclusion list looks at the problem of of constructing a package
+from the perspective of what modules do we _want_ in the package, as opposed
+to what modules we _don't_ want. As the kernel matures, more and more devices are added
+which makes the problem of configuration maintenance a real pain in the ass.
+If we took the approach of disabling all of the config options that we don't want,
+then the differences between flavours will quickly become quite large, making
+it difficult to quickly compare the individual flavour configs.  Each time a
+new config option is added then we also have to make a decision about disabling in
+order to continue to keep the minimal number of modules.
+A module inclusion list is applied on a per-flavour basis. For example,
+debian.<BRANCH>/control.d/${flavour}.inclusion-list. For example, the
+config for virtual is very close to server and generic, but the inclusion list
+causes the virtual package to be constructed with _only_ the modules described 
+in the inclusion list.
+The inclusion list format is a simple bash regular expression list of files. For example,
+These 3 regular expression forms are suitable for expansion by bash and as inputs to 'find'.
+See debian/scripts/module-inclusion for details.
+There are 2 log files created as a side effect of the application of the module
+inclusion list; $(flavour).inclusion-list.log and $(flavour).depmod.log.
+$(flavour).inclusion-list.log : This log is created while the inclusion list
+modules are being copied. If any are missing, then those warnings go in this log.
+While its not considered a fatal error, you should endevour to correct your inclusion
+list such that there are no missing modules.
+$(flavour).depmod.log : The log is created as a result of running depmod on the
+resulting set of modules. If there are missing symbols then you'll find that information
+here. Again, you should modify your inclusion list such that there are no missing
+Tim Gardner <>
+June 2, 2010
diff --git a/debian/rules.d/ b/debian/rules.d/
index c9b0c2e..0b2e03d 100644
--- a/debian/rules.d/
+++ b/debian/rules.d/
@@ -78,6 +78,17 @@  endif
+	#
+	# Remove all modules not in the inclusion list.
+	#
+	if [ -f $(DEBIAN)/control.d/$(target_flavour).inclusion-list ] ; then \
+		$(DROOT)/scripts/module-inclusion $(pkgdir)/lib/modules/$(abi_release)-$*/kernel \
+			$(DEBIAN)/control.d/$(target_flavour).inclusion-list 2>&1 | \
+				tee $(target_flavour).inclusion-list.log; \
+		/sbin/depmod -b $(pkgdir) -ea -F $(pkgdir)/boot/$(abi_release)-$* \
+			$(abi_release)-$* 2>&1 |tee $(target_flavour).depmod.log; \
+	fi
 ifeq ($(no_dumpfile),)
 	makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \
 		-x $(builddir)/build-$*/vmlinux
diff --git a/debian/scripts/module-inclusion b/debian/scripts/module-inclusion
new file mode 100755
index 0000000..ec3ce5e
--- /dev/null
+++ b/debian/scripts/module-inclusion
@@ -0,0 +1,51 @@ 
+# Build a new directory of modules based on an inclusion list.
+# The includsion list format must be a bash regular expression.
+# example: $0 debian/build/build-virtual debian.master/control.d/virtual.inclusion-list
+# Prep a destination directory.
+mkdir -p ${NROOT}
+rsync -a --exclude="*.ko" ${ROOT}/ ${NROOT}
+cat ${ILIST} |while read i
+	#
+	# 'find' blurts a warning if it cannot find any ko files.
+	#
+	if echo "$i" | grep '\*' > /dev/null
+	then
+		(cd ${ROOT}; eval find "${i}" -name "*.ko") |while read f
+		do
+			mkdir -p ${NROOT}/`dirname $f`
+			cp ${ROOT}/$f ${NROOT}/$f
+		done
+	else
+		if [ -f "${ROOT}/$i" ]
+		then
+			mkdir -p ${NROOT}/`dirname $i`
+			cp ${ROOT}/$i ${NROOT}/$i
+		else
+			echo Warning: Could not find ${ROOT}/$i
+		fi
+	fi
+# Cleanup
+rm -rf ${ROOT}
+mv ${NROOT} ${ROOT}
+exit 0

From fde00e3837e66e5305216e935228472dbc5c1836 Mon Sep 17 00:00:00 2001
From: Tim Gardner <>
Date: Tue, 1 Jun 2010 19:21:40 -0600
Subject: [PATCH 3/3] UBUNTU: [Config] Added virtual flavour module inclusion list and d-i package definitions


Signed-off-by: Tim Gardner <>
 debian.master/control.d/virtual.inclusion-list  |  131 +++++++++++++++++++++++
 debian.master/d-i/exclude-modules.amd64-virtual |   12 ++
 debian.master/d-i/exclude-modules.i386-virtual  |   12 ++
 3 files changed, 155 insertions(+), 0 deletions(-)
 create mode 100644 debian.master/control.d/virtual.inclusion-list
 create mode 100644 debian.master/d-i/exclude-modules.amd64-virtual
 create mode 100644 debian.master/d-i/exclude-modules.i386-virtual

diff --git a/debian.master/control.d/virtual.inclusion-list b/debian.master/control.d/virtual.inclusion-list
new file mode 100644
index 0000000..de1ce7b
--- /dev/null
+++ b/debian.master/control.d/virtual.inclusion-list
@@ -0,0 +1,131 @@ 
diff --git a/debian.master/d-i/exclude-modules.amd64-virtual b/debian.master/d-i/exclude-modules.amd64-virtual
new file mode 100644
index 0000000..e17fd2f
--- /dev/null
+++ b/debian.master/d-i/exclude-modules.amd64-virtual
@@ -0,0 +1,12 @@ 
diff --git a/debian.master/d-i/exclude-modules.i386-virtual b/debian.master/d-i/exclude-modules.i386-virtual
new file mode 100644
index 0000000..e17fd2f
--- /dev/null
+++ b/debian.master/d-i/exclude-modules.i386-virtual
@@ -0,0 +1,12 @@