# # 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 # Based on work from: Jens Schmalzing # 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.16/arch/powerpc/Makefile.orig 2006-04-12 16:57:16.000000000 +0000 +++ linux-2.6.16/arch/powerpc/Makefile 2006-04-12 16:58:53.000000000 +0000 @@ -148,7 +148,7 @@ CPPFLAGS_vmlinux.lds := -Upowerpc -BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage +BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage mkvmlinuz_support_install .PHONY: $(BOOT_TARGETS) --- linux-2.6.16/arch/powerpc/boot/Makefile.orig 2006-04-12 16:40:11.000000000 +0000 +++ linux-2.6.16/arch/powerpc/boot/Makefile 2006-04-12 19:23:06.000000000 +0000 @@ -213,3 +213,23 @@ sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)" clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip) + +#----------------------------------------------------------- +# 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 +