[PATCH] Fix booting some PPC32 machines

From: Tom Rini
Date: Mon May 03 2004 - 13:13:31 EST


Hello. The following patch fixes booting on some PPC32 machines with
OpenFirmware, when booted without the aid of an additional bootloader.
The problem is that the linker script for the 'zImage' type targets was
put into the list of dependancies which objcopy would parse as a list of
files to copy into the resulting image. The fix is to make the phony
zImage targets depend on the linker script.

===== arch/ppc/boot/openfirmware/Makefile 1.22 vs edited =====
--- 1.22/arch/ppc/boot/openfirmware/Makefile Thu Apr 1 08:16:57 2004
+++ edited/arch/ppc/boot/openfirmware/Makefile Mon May 3 10:24:35 2004
@@ -104,10 +104,10 @@
$(HACKCOFF) $@ && \
ln -sf $(notdir $@) $(images)/zImage$(initrd).pmac

-$(images)/vmlinux.coff: $(obj)/coffboot $(boot)/ld.script
+$(images)/vmlinux.coff: $(obj)/coffboot
$(call cmd,gen-coff)

-$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd $(boot)/ld.script
+$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd
$(call cmd,gen-coff)

quiet_cmd_gen-elf-pmac = ELF $@
@@ -116,19 +116,19 @@
$(OBJCOPY) $@ $@ --add-section=.note=$(obj)/note \
-R .comment $(del-ramdisk-sec)

-$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) $(obj)/note $(boot)/ld.script
+$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) $(obj)/note
$(call cmd,gen-elf-pmac)
$(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
- $(LIBS) $(obj)/note $(boot)/ld.script
+ $(LIBS) $(obj)/note
$(call cmd,gen-elf-pmac)

quiet_cmd_gen-chrp = CHRP $@
cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $^ && \
$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)

-$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS) $(boot)/ld.script
+$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS)
$(call cmd,gen-chrp)
-$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS) $(boot)/ld.script
+$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS)
$(call cmd,gen-chrp)

quiet_cmd_addnote = ADDNOTE $@
@@ -153,13 +153,15 @@
$(images)/vmlinux.elf-pmac \
$(images)/zImage.chrp \
$(images)/zImage.chrp-rs6k \
- $(images)/miboot.image
+ $(images)/miboot.image \
+ $(boot)/ld.script
@echo ' kernel: $@ is ready ($<)'
zImage.initrd: $(images)/vmlinux.initrd.coff \
$(images)/vmlinux.initrd.elf-pmac \
$(images)/zImage.initrd.chrp \
$(images)/zImage.initrd.chrp-rs6k \
- $(images)/miboot.initrd.image
+ $(images)/miboot.initrd.image \
+ $(boot)/ld.script
@echo ' kernel: $@ is ready ($<)'

TFTPIMAGE := /tftpboot/zImage

--
Tom Rini
http://gate.crashing.org/~trini/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/