linux/debian/patches/debian/powerpc-mkvmlinuz-support-p...

58 lines
2.7 KiB
Diff

#
# Mkvmlinuz support patch, called by debian's kernel-package to generate
# the files needed by mkvmlinuz to generate the bootable images from vmlinux.
# Author: Sven Luther <luther@debian.org>
# Based on work from: Jens Schmalzing <jensen@debian.org>
# Original comment from Jens :
# This shell script is intended to be put into the debian subdirectory
# of a Linux kernel tree, where make-kpkg will find and execute it
# while building a kernel-image package. The purpose of this script
# is to add glue (object code, libraries, utilities and so on) from
# the kernel tree to the kernel-image package. Later, the mkvmlinuz
# utility, which is available as a separate Debian package, can use
# this glue to create a bootable compressed kernel from the
# uncompressed kernel in the kernel-image package and optionally a
# ramdisk. This is especially important on PowerPC subarchitectures
# that don't have a boot loader, but also comes handy for rescue
# systems and the like.
# Upstream status: This patch stays a debian specific patch for now,
# but it is not in a form where it could go upstream.
#
--- linux-2.6.19-rc6/arch/powerpc/Makefile.orig 2006-11-24 17:43:15.000000000 +0100
+++ linux-2.6.19-rc6/arch/powerpc/Makefile 2006-11-24 17:44:32.000000000 +0100
@@ -148,7 +148,7 @@
CPPFLAGS_vmlinux.lds := -Upowerpc
-BOOT_TARGETS = zImage zImage.initrd uImage
+BOOT_TARGETS = zImage zImage.initrd uImage mkvmlinuz_support_install
PHONY += $(BOOT_TARGETS)
--- linux-2.6.19-rc6/arch/powerpc/boot/Makefile.orig 2006-11-24 17:42:40.000000000 +0100
+++ linux-2.6.19-rc6/arch/powerpc/boot/Makefile 2006-11-24 17:45:45.000000000 +0100
@@ -176,3 +176,23 @@
clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip.gz)
clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.bin.gz)
+
+#-----------------------------------------------------------
+# install mkvmlinuz support files
+#-----------------------------------------------------------
+quiet_cmd_mkvmlinuz = INSTALL mkvmlinuz support files
+ cmd_mkvmlinuz = cp -f $? $(INSTALL_MKVMLINUZ)
+
+mkvmlinuz-obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/mkvmlinuz-kernel-%.o, $(section)))
+mkvmlinuz-src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/mkvmlinuz-kernel-%.c, $(section)))
+
+$(call mkvmlinuz-src-sec, $(required) $(initrd)): $(obj)/mkvmlinuz-kernel-%.c:
+ @touch $@
+$(call mkvmlinuz-obj-sec, $(required) $(initrd)): $(obj)/mkvmlinuz-kernel-%.o: $(obj)/mkvmlinuz-kernel-%.c
+ $(call if_changed_dep,bootcc)
+
+$(obj)/mkvmlinuz_support_install: $(obj)/addRamDisk $(obj)/addnote $(obj-boot) $(call mkvmlinuz-obj-sec, $(required) $(initrd)) $(srctree)/$(src)/zImage.lds
+ mkdir -p $(INSTALL_MKVMLINUZ)
+ $(call cmd,mkvmlinuz)
+targets += mkvmlinuz_support_install
+