diff --git a/debian/arch/sparc/defines b/debian/arch/sparc/defines index 901252cf0..e014a74e0 100644 --- a/debian/arch/sparc/defines +++ b/debian/arch/sparc/defines @@ -10,7 +10,7 @@ suggests: silo, fdutils kernel-arch: sparc kernel-subarch: sparc kernel-headers-dirs: sparc -image-postproc: strip -R .comment -R .note -K sun4u_init -K _end -K _start arch/sparc/boot/image +image-postproc: sparc32-image-postproc class: uniprocessor sparc32 (sun4m) machines [sparc64] diff --git a/debian/bin/sparc32-image-postproc b/debian/bin/sparc32-image-postproc new file mode 100755 index 000000000..f88d90c84 --- /dev/null +++ b/debian/bin/sparc32-image-postproc @@ -0,0 +1,10 @@ +#!/bin/sh +# It is a bit cumbersome here. Since we are executed when +# the image is already installed and in place, we must +# unpack it, then strip it, then gzip it again. +image_dest="${IMAGE_TOP}/boot/vmlinuz-${version}" +image_temp="$(mktemp)" +gzip -dc "${image_dest}" > "${image_temp}" +strip -R .comment -R .note -K sun4u_init -K _end -K _start "${image_temp}" +gzip -9c "${image_temp}" > "${image_dest}" +rm -rf "${image_temp}" diff --git a/debian/rules.real b/debian/rules.real index 75dd6255e..fc3a3c709 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -163,9 +163,6 @@ install-doc: $(STAMPS_DIR)/source cd '$(DIR)' && $(setup_env) make-kpkg --stem linux \ --config defconfig kernel-manual cat '$(DIR)/debian/files' >> debian/files -ifdef IMAGE_POSTPROC - cd '$(DIR)'; $(IMAGE_POSTPROC) -endif @for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \ echo "mv \"$(BUILD_DIR)/$$i\" .."; \ mv "$(BUILD_DIR)/$$i" ..; \ @@ -185,11 +182,13 @@ 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 -ifdef IMAGE_POSTPROC - cd '$(DIR)'; $(IMAGE_POSTPROC) -endif @for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \ echo "mv \"$(BUILD_DIR)/$$i\" .."; \ mv "$(BUILD_DIR)/$$i" ..; \