From d13d95a7583767e38f7ed1158b2f3530987b4b5c Mon Sep 17 00:00:00 2001 From: Bastian Blank Date: Mon, 27 Feb 2006 18:07:20 +0000 Subject: [PATCH] * debian/arch/defines: Set image type. * debian/bin/gencontrol.py: Don't supply a default value for the image type. * debian/rules.real: Support plain images. svn path=/dists/trunk/linux-2.6/; revision=5976 --- debian/arch/defines | 1 + debian/bin/gencontrol.py | 1 - debian/rules.real | 83 +++++++++++++++++++++++++++------------- 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/debian/arch/defines b/debian/arch/defines index 45fd60bcb..de05628ef 100644 --- a/debian/arch/defines +++ b/debian/arch/defines @@ -15,6 +15,7 @@ arches: s390 sparc image-ramdisk-generators: yaird initramfs-tools +type: kernel-package [mips] available: False diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py index ea3f2b748..ba374b480 100755 --- a/debian/bin/gencontrol.py +++ b/debian/bin/gencontrol.py @@ -77,7 +77,6 @@ class gencontrol(debian_linux.gencontrol.gencontrol): def do_flavour_makeflags(self, makeflags, arch, subarch, flavour): config_entry = self.config.merge('base', arch, subarch, flavour) - makeflags['TYPE'] = 'kernel-package' for i in ( ('compiler', 'COMPILER'), ('kernel-arch', 'KERNEL_ARCH'), diff --git a/debian/rules.real b/debian/rules.real index 8e0412fcf..5fc871985 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -56,15 +56,15 @@ setup_env += MAKEFLAGS='$(setup_makeflags)' # Targets # binary-arch-subarch: install-header-$(ARCH)-$(SUBARCH) -binary-arch-flavour: install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR) install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR) +binary-arch-flavour: install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR) binary-indep: install-doc install-patch install-source install-tree -build: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) +build: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) setup-arch: $(STAMPS_DIR)/source setup-subarch: -setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR) +setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) # # Generates the kernel config file for a subarch by merging @@ -119,20 +119,35 @@ $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source # that in this file it should be always placed *before* the # build-$(subarch)-% target, which creates the build directory. # -$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) -$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR) +$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) + +$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-kernel-package: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) cd '$(DIR)'; $(setup_env) PATH='$(CURDIR)/build:$(CURDIR)/bin:$(PATH)' $(kpkg_image) build touch '$@' -$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH) -$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) -$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR) $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH) +$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) + cd '$(DIR)'; $(setup_env) make ARCH=$(KERNEL_ARCH) + touch '$@' + +$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH) +$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) + +$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-kernel-package: $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR) $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH) rm -rf '$(DIR)' cp -al '$(SOURCE_DIR)' '$(DIR)' cp '$<' '$(DIR)/.config' cd '$(DIR)'; $(setup_env) $(kpkg_image) configure touch '$@' +$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain: $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR) $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH) + rm -rf '$(DIR)' + cp -al '$(SOURCE_DIR)' '$(DIR)' + cp '$<' '$(DIR)/.config' + # TODO + echo '$(KPKG_ABINAME)$(LOCALVERSION)' > '$(DIR)/localversion' + cd '$(DIR)'; $(setup_env) make prepare ARCH=$(KERNEL_ARCH) + touch '$@' + install-base: dh_installchangelogs dh_installdocs @@ -170,24 +185,6 @@ install-dummy: dh_clean -d -k $(MAKE) -f debian/rules.real install-base -install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) -install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/$@ -install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) - rm -rf '$(DIR)' - cp -al '$(SOURCE_DIR)' '$(DIR)' -ifdef IMAGE_POSTPROC -# Install the postproc script into the hook directory - install -d '$(DIR)/debian/image.d' - install 'debian/bin/$(IMAGE_POSTPROC)' '$(DIR)/debian/image.d' -endif - cd '$(DIR)'; $(setup_env) $(kpkg_image) kernel-image - cat '$(DIR)/debian/files' >> debian/files - @for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \ - echo "mv \"$(BUILD_DIR)/$$i\" .."; \ - mv "$(BUILD_DIR)/$$i" ..; \ - done - rm -rf '$(DIR)' - install-header-$(ARCH)-$(SUBARCH): PACKAGE_NAME = linux-headers-$(VERSION)-$(ABINAME)$(LOCALVERSION_HEADERS) install-header-$(ARCH)-$(SUBARCH): DH_OPTIONS = -p$(PACKAGE_NAME) install-header-$(ARCH)-$(SUBARCH): BASE_DIR = /usr/src/$(PACKAGE_NAME) @@ -226,7 +223,7 @@ install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR = $(BUILD_DIR)/build-$( install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): REF_DIR = $(BUILD_DIR)/source-$(ARCH)-$(SUBARCH) install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME) install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR = $(PACKAGE_DIR)/$(BASE_DIR) -install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) +install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) dh_testdir dh_testroot dh_clean -k -d @@ -300,6 +297,38 @@ install-headers-all: dh_python $(DH_OPTIONS) -V 2.4 /usr/src/linux-headers-$(VERSION)/lib/python $(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)' +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): REAL_VERSION = $(VERSION)-$(ABINAME)$(LOCALVERSION) +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): PACKAGE_NAME = linux-image-$(REAL_VERSION) +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME) +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DIR=$(BUILD_DIR)/$@ +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): DH_OPTIONS = -p$(PACKAGE_NAME) + +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-kernel-package: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) + rm -rf '$(DIR)' + cp -al '$(SOURCE_DIR)' '$(DIR)' +ifdef IMAGE_POSTPROC +# Install the postproc script into the hook directory + install -d '$(DIR)/debian/image.d' + install 'debian/bin/$(IMAGE_POSTPROC)' '$(DIR)/debian/image.d' +endif + cd '$(DIR)'; $(setup_env) $(kpkg_image) kernel-image + cat '$(DIR)/debian/files' >> debian/files + @for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \ + echo "mv \"$(BUILD_DIR)/$$i\" .."; \ + mv "$(BUILD_DIR)/$$i" ..; \ + done + rm -rf '$(DIR)' + +install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE) + dh_testdir + dh_testroot + dh_clean -d -k + dh_installdirs 'boot' + cp '$(SOURCE_DIR)/vmlinuz' $(PACKAGE_DIR)/boot/vmlinuz-$(VERSION)-$(ABINAME)$(LOCALVERSION) + cd '$(SOURCE_DIR)'; $(setup_env) make modules_install ARCH=$(KERNEL_ARCH) INSTALL_MOD_PATH=$(PACKAGE_DIR) + $(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)' + install-patch: PACKAGE = linux-patch-debian-$(VERSION) install-patch: pbase := /usr/src/kernel-patches/all/$(SOURCE_UPSTREAM) install-patch: pfull := debian/$(PACKAGE)$(pbase)