FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

LinkBack Thread Tools
Old 06-01-2010, 05:39 PM
Tim Gardner
Default 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 <tim.gardner@canonical.com>
debian/docs/README.inclusion-list | 51 +++++++++++++++++++++++++++++++++++++
debian/rules.d/2-binary-arch.mk | 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 <tim.gardner@canonical.com>
+June 2, 2010
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index c9b0c2e..0b2e03d 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -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/System.map-$(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

Thread Tools

All times are GMT. The time now is 09:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org