linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: linuxppc-dev@ozlabs.org
Cc: Paul Mackerras <paulus@samba.org>, david@gibson.dropbear.id.au
Subject: [PATCH 8/8] boot: use a common zImage rule
Date: Wed, 21 Mar 2007 09:03:23 -0600 (CST)	[thread overview]
Message-ID: <boot-2-08.miltonm@bga.com> (raw)
In-Reply-To: <boot-2-00.miltonm@bga.com>

Before the plethora of platforms gets any worse, establish a common
rule to invoke the wrapper for any platform.  Add arguments to
the rule for initrd, dts, dtb, etc.   Show example usage with initrd.

Create default rules for zImage, and zImage.initrd.  initrd targets
depend on the ramdisk file.

Don't consider targets for zImage.initrd that are targets for zImage.
This means uImage is no longer considered a target for zImage.initrd.

Signed-off-by: Milton Miller <miltonm@bga.com>
--- 
Rebased after boot-add-FORCE.   Removed the explicit call of the rule,
and fixed the zImage.initrd vs zImage rule selection by making both
rules have the same requirements.

Index: kernel/arch/powerpc/boot/Makefile
===================================================================
--- kernel.orig/arch/powerpc/boot/Makefile	2007-03-21 03:27:37.000000000 -0500
+++ kernel/arch/powerpc/boot/Makefile	2007-03-21 03:37:32.000000000 -0500
@@ -116,50 +116,10 @@ CROSSWRAP := -C "$(CROSS_COMPILE)"
 endif
 endif
 
+# args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
 quiet_cmd_wrap	= WRAP    $@
-      cmd_wrap	=$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux
-quiet_cmd_wrap_initrd = WRAP    $@
-      cmd_wrap_initrd =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
-				-i $(obj)/ramdisk.image.gz vmlinux
-
-$(obj)/zImage.chrp: vmlinux $(wrapperbits)
-	$(call if_changed,wrap,chrp)
-
-$(obj)/zImage.initrd.chrp: vmlinux $(wrapperbits)
-	$(call if_changed,wrap_initrd,chrp)
-
-$(obj)/zImage.pseries:	vmlinux $(wrapperbits)
-	$(call if_changed,wrap,pseries)
-
-$(obj)/zImage.initrd.pseries: vmlinux $(wrapperbits)
-	$(call if_changed,wrap_initrd,pseries)
-
-$(obj)/zImage.pmac: vmlinux $(wrapperbits)
-	$(call if_changed,wrap,pmac)
-
-$(obj)/zImage.initrd.pmac: vmlinux $(wrapperbits)
-	$(call if_changed,wrap_initrd,pmac)
-
-$(obj)/zImage.coff: vmlinux $(wrapperbits)
-	$(call if_changed,wrap,pmaccoff)
-
-$(obj)/zImage.initrd.coff: vmlinux $(wrapperbits)
-	$(call if_changed,wrap_initrd,pmaccoff)
-
-$(obj)/zImage.miboot: vmlinux $(wrapperbits)
-	$(call if_changed,wrap,miboot)
-
-$(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits)
-	$(call if_changed,wrap_initrd,miboot)
-
-$(obj)/zImage.ps3: vmlinux
-	$(STRIP) -s -R .comment $< -o $@
-
-$(obj)/zImage.initrd.ps3: vmlinux
-	@echo "  WARNING zImage.initrd.ps3 not supported (yet)"
-
-$(obj)/uImage: vmlinux $(wrapperbits)
-	$(call if_changed,wrap,uboot)
+      cmd_wrap	=$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
+      		$(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) vmlinux
 
 image-$(CONFIG_PPC_PSERIES)		+= zImage.pseries
 image-$(CONFIG_PPC_MAPLE)		+= zImage.pseries
@@ -179,8 +139,29 @@ endif
 
 initrd-  := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-))
 initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y))
+initrd-y := $(filter-out $(image-y), $(initrd-y))
 targets	+= $(image-y) $(initrd-y)
 
+$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
+
+# Don't put the ramdisk on the pattern rule; when its missing make will try
+# the pattern rule with less dependencies that also matches (even with the
+# hard dependency listed).
+$(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
+	$(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
+
+$(obj)/zImage.%: vmlinux $(wrapperbits)
+	$(call if_changed,wrap,$*)
+
+$(obj)/zImage.ps3: vmlinux
+	$(STRIP) -s -R .comment $< -o $@
+
+$(obj)/zImage.initrd.ps3: vmlinux
+	@echo "  WARNING zImage.initrd.ps3 not supported (yet)"
+
+$(obj)/uImage: vmlinux $(wrapperbits)
+	$(call if_changed,wrap,uboot)
+
 $(obj)/zImage:		$(addprefix $(obj)/, $(image-y))
 	@rm -f $@; ln $< $@
 $(obj)/zImage.initrd:	$(addprefix $(obj)/, $(initrd-y))

  parent reply	other threads:[~2007-03-21 15:03 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 20:55 [PATCH 0/7] boot: cleanup and prep for more platforms Milton Miller
2007-03-19 20:58 ` [PATCH 3/7] boot: use FORCE Milton Miller
2007-03-20 15:52   ` Segher Boessenkool
2007-03-19 20:58 ` [PATCH 4/7] bootwrapper: add a fatal error helper Milton Miller
2007-03-20  0:38   ` David Gibson
2007-03-20 13:38     ` Milton Miller
2007-03-21  0:01       ` David Gibson
2007-03-19 20:58 ` [PATCH 2/7] boot: rebuild when wrapper changes Milton Miller
2007-03-20  0:36   ` David Gibson
2007-03-20 15:50   ` Segher Boessenkool
2007-03-19 20:58 ` [PATCH 6/7] bootwrapper: allow platforms to call library zImage_start Milton Miller
2007-03-20  4:55   ` David Gibson
2007-03-19 20:58 ` [PATCH 5/7] bootwrapper: missing relocation in crt0.S Milton Miller
2007-03-20  0:39   ` David Gibson
2007-03-20 20:09   ` Mark A. Greer
2007-03-19 20:58 ` [PATCH 7/7] boot: export flush_cache Milton Miller
2007-03-20  4:55   ` David Gibson
2007-03-19 20:58 ` [PATCH 1/7] boot: use a common zImage rule Milton Miller
2007-03-20  3:30   ` David Gibson
2007-03-20 13:47     ` Milton Miller
2007-03-20 17:41       ` Mark A. Greer
2007-03-21  2:46       ` David Gibson
2007-03-21 15:02 ` [PATCH 0/8] boot: cleanup and prep for more platforms Milton Miller
2007-03-21 15:02   ` [PATCH 6/8] boot: use FORCE Milton Miller
2007-03-21 15:02   ` [PATCH 1/8] bootwrapper: add a fatal error helper Milton Miller
2007-03-21 15:02   ` [PATCH 5/8] boot: rebuild when wrapper changes Milton Miller
2007-03-21 15:02   ` [PATCH 3/8] bootwrapper: allow platforms to call library zImage_start Milton Miller
2007-03-21 15:02   ` [PATCH 2/8] bootwrapper: missing relocation in crt0.S Milton Miller
2007-03-23  5:25     ` Paul Mackerras
2007-03-28  8:21       ` [PATCH 1/4] " Milton Miller
2007-03-21 15:03   ` [PATCH 4/8] boot: export flush_cache Milton Miller
2007-03-21 15:03   ` [PATCH 7/8] boot: clean rule fixes Milton Miller
2007-03-21 15:03   ` Milton Miller [this message]
2007-03-22  3:46     ` [PATCH 8/8] boot: use a common zImage rule David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2007-03-28  8:21 [PATCH 0/4] boot: cleanup and prep for more platforms Milton Miller
2007-03-28  8:21 ` [RFC] bootwrapper: allow vmlinuz to be an external payload Milton Miller
2007-03-28  8:21 ` [PATCH 2/4] bootwrapper: remove unused variable Milton Miller
2007-03-28  8:34   ` David Gibson
2007-03-28 16:04     ` Milton Miller
2007-03-28  8:21 ` Patch: [PATCH 3/4] bootwrapper: no gzip fixes Milton Miller
2007-03-28 20:03   ` Scott Wood
2007-03-28  8:21 ` [PATCH 4/4] bootwrapper: decompress less, check more Milton Miller
2007-03-29 13:31   ` Milton Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=boot-2-08.miltonm@bga.com \
    --to=miltonm@bga.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).