[Maverick] [PATCH] UBUNTU: execute module-inclusion within a subshell

Leann Ogasawara leann.ogasawara at canonical.com
Tue Sep 14 05:57:27 UTC 2010


Hi All,

LP Bug 621175 reports that the -virtual kernel .deb size is much larger
than expected.  They should be around 9.9M but are currently 33M:

$ ls -sh *.deb
33M linux-image-2.6.35-21-virtual_2.6.35-21.31_amd64.deb
33M linux-image-2.6.35-21-virtual_2.6.35-21.31_i386.deb

I examined the build logs from the actual buildd's:

http://launchpadlibrarian.net/55565061/buildlog_ubuntu-maverick-amd64.linux_2.6.35-21.31_FULLYBUILT.txt.gz

I noticed something peculiar in the 2.6.35-21.31 build log:

#
# Remove all modules not in the inclusion list.
#
if [ -f debian.master/control.d/virtual.inclusion-list ] ; then \
		debian/scripts/module-inclusion /build/buildd/linux-2.6.35/debian/linux-image-2.6.35-21-virtual/lib/modules/2.6.35-21-virtual/kernel \
			debian.master/control.d/virtual.inclusion-list 2>&1 | \
				tee virtual.inclusion-list.log; \
		/sbin/depmod -b /build/buildd/linux-2.6.35/debian/linux-image-2.6.35-21-virtual -ea -F /build/buildd/linux-2.6.35/debian/linux-image-2.6.35-21-virtual/boot/System.map-2.6.35-21-virtual \
			2.6.35-21-virtual 2>&1 |tee virtual.depmod.log; \
	fi
/bin/bash: line 1: debian/scripts/module-inclusion: Permission denied

Due to the Permission denied error, the virtual images are not removing
all the modules not in the inclusion list, thus resulting in the larger
-virtual deb size.  When doing dpkg-buildpackage -S -rfakeroot... with
the orig.tar.gz I noticed the following warning:

dpkg-source: warning: executable mode 0755 of
'debian/scripts/module-inclusion' will not be represented in diff

Thus it seems the executable permissions for
debian/scripts/module-inclusion are not represented which results in the
Permission denied error.  To test this, I removed the executable
permissions for debian/scripts/module-inclusion from my local test build
and was able to reproduce the Permission denied error.  Applying the
following patch to execute debian/scripts/module-inclusion within a
sub-shell seems to resolve the issue.  Feedback/comments appreciated.
This is intended for Maverick.

Thanks,
Leann

>From 9699fb7763d3223441d66bdf980cbadec109395f Mon Sep 17 00:00:00 2001
From: Leann Ogasawara <leann.ogasawara at canonical.com>
Date: Mon, 13 Sep 2010 22:26:20 -0700
Subject: [PATCH] UBUNTU: execute module-inclusion within a subshell

BugLink: http://bugs.launchpad.net/bugs/621175

When uploading the kernel with the orig.tar.gz included, executable
modes are not represented in the diff, eg:

  dpkg-source: warning: executable mode 0755 of 'debian/scripts/module-inclusion' will not be represented in diff

As a result, when debian/scripts/module-inclusion is called when
building the -virtual kernel .deb, we see the following error:

  /bin/bash: line 1: debian/scripts/module-inclusion: Permission denied

This results in a larger -virtual kernel .deb size because the
module-inclusion script is not run which prevents the removal of modules
not in the inclusion list.  The following patch calls
debian/scripts/module-inclusion from within a subshell in order for it
to execute.

Signed-off-by: Leann Ogasawara <leann.ogasawara at canonical.com>
---
 debian/rules.d/2-binary-arch.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index da93e4d..1d26496 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -82,7 +82,7 @@ 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 \
+		$(SHELL) $(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)-$* \
-- 
1.7.1







More information about the kernel-team mailing list