Install /lib/modules/<kernel-version>/modules.builtin in linux-image packages

We want to avoid shipping any files generated by depmod (which should
be generated in the postinst) and the 'build' and 'source' symlinks
(which should be installed by the linux-headers package).  Since
depmod has generated more and more files over time, we have been
removing all unexpected files under /lib/modules/<kernel-version>,
accidentally including modules.builtin which is *not* generated by
depmod.

Try to solve the problem generally by substituting a dummy depmod
command and then just removing the 'build' and 'source' symlinks.


svn path=/dists/trunk/linux-2.6/; revision=18456
This commit is contained in:
Ben Hutchings 2012-01-07 22:08:58 +00:00
parent e3913e88f2
commit a93dbd844e
3 changed files with 24 additions and 2 deletions

18
debian/bin/no-depmod vendored Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
set -e
# This is a dummy substitute for depmod. Since we run depmod during
# postinst, we do not need or want to package the files that it
# generates.
if [ "x$1" = x-V ]; then
# Satisfy version test
echo 'not really module-init-tools'
elif [ "x$1" = x-b -a "${2%/depmod.??????}" != "$2" ]; then
# Satisfy test of short kernel versions
mkdir -p "$2/lib/modules/$3"
touch "$2/lib/modules/$3/modules.dep"
else
echo 'skipping depmod'
fi

2
debian/changelog vendored
View File

@ -10,6 +10,8 @@ linux-2.6 (3.2-1~experimental.1) UNRELEASED; urgency=low
* media/dvb: Enable DVB_USB_IT913X as module (Closes: #653776)
* [arm] Remove use of possibly undefined BUILD_BUG_ON in <asm/bug.h>
(fixes FTBFS)
* Install /lib/modules/<kernel-version>/modules.builtin in linux-image
packages
[ Bastian Blank ]
* crypt: Enable some amd64 only ciphers.

6
debian/rules.real vendored
View File

@ -335,7 +335,8 @@ install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain:
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) INSTALL_MOD_STRIP=1
chmod 755 $(CURDIR)/debian/bin/no-depmod
+$(MAKE_CLEAN) -C $(DIR) modules_install DEPMOD='$(CURDIR)/debian/bin/no-depmod' INSTALL_MOD_PATH='$(CURDIR)'/$(PACKAGE_DIR) INSTALL_MOD_STRIP=1
ifeq ($(DEBUG),True)
find $(PACKAGE_DIR) -name '*.ko' | sed 's|$(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/kernel/||' | while read module ; do \
objcopy --add-gnu-debuglink=$(DIR)/$$module $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/kernel/$$module || exit; \
@ -343,7 +344,8 @@ ifeq ($(DEBUG),True)
endif
cp $(DIR)/.config $(PACKAGE_DIR)/boot/config-$(REAL_VERSION)
cp $(DIR)/System.map $(PACKAGE_DIR)/boot/System.map-$(REAL_VERSION)
find $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/ -mindepth 1 -maxdepth 1 \! -name kernel \! -name modules.order -exec rm {} \+
rm -f $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/build
rm -f $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/source
rm $(PACKAGE_DIR)/lib/firmware -rf
endif
+$(MAKE_SELF) \