From a93dbd844e7f3a69bec594adb14e9e3a9c93e747 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 7 Jan 2012 22:08:58 +0000 Subject: [PATCH] Install /lib/modules//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/, 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 --- debian/bin/no-depmod | 18 ++++++++++++++++++ debian/changelog | 2 ++ debian/rules.real | 6 ++++-- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100755 debian/bin/no-depmod diff --git a/debian/bin/no-depmod b/debian/bin/no-depmod new file mode 100755 index 000000000..ed5a8463f --- /dev/null +++ b/debian/bin/no-depmod @@ -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 diff --git a/debian/changelog b/debian/changelog index cc9a23ee1..01b7d02a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 (fixes FTBFS) + * Install /lib/modules//modules.builtin in linux-image + packages [ Bastian Blank ] * crypt: Enable some amd64 only ciphers. diff --git a/debian/rules.real b/debian/rules.real index f58221f8f..9a46a1049 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -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) \