Skip to content

boot: create zImage.kexec #2

Milton Miller linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5boot: prepare for zImage.kexecarch/powerpc/boot/main.c arch/powerpc/boot/prom.c arch/powerpc/boot/prom.h+31 -141 reply
2/5boot: Add kexec callable zImage wrapperarch/powerpc/boot/crt0_kexec.S arch/powerpc/boot/dt.h arch/powerpc/boot/kexec.c+678 -00 replies
3/5boot: use more Kbuild rulesarch/powerpc/boot/Makefile+59 -400 replies
4/5boot: Makefile and linker scripts for zImage.kexecarch/powerpc/Makefile arch/powerpc/boot/Makefile arch/powerpc/boot/zImage.kexec.lds +1 more+150 -90 replies
5/5boot: generate lds file from lds.Sarch/powerpc/boot/Makefile arch/powerpc/boot/zImage.coff.lds arch/powerpc/boot/zImage.coff.lds.S +4 more+119 -2030 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [0/5][POWERPC] boot: create zImage.kexec #2

What follows is a series of 5 patches that take the existing zImge code from the arch/powerpc/boot directory and add an alternative image that will boot with a device tree struct but not with a prom interface callback.

It searches the flat device tree (read-only) to find the memory size, reserved ranges, and rtas. Messages are sent through rtas to eiher the new for cell put-term-char or display-character interfaces.

Status: I changed more of the makefile to if_changed_dep. I updated the rules to not do if_changed and cmd when changing the same file.

Patches 4 and 5 have been rediffed and __ENTRY__ and __BASE__ are now caps instead of lowercase in patch 5.

Unfornately I could not get my test and build machines talking due to network problems, and thereefore was unable to regression test the output. Therefore the state is still 'it worked before I moved code among the files' and 'display-character untested'.

Without [KBUILD] allow any PHONY in if_changed_dep it causes all the files in boot to be built each time, unless we do some alternative, either make COPYHEADERS a real dummy that we touch if it doesn't exist, or just say rebuild all sources when any .h in the kernel tree changes and collapse the dependency.

Its this fragment:

+$(obj-boot): COPYHEADERS
+COPYHEADERS: $(addprefix $(obj)/,$(linuxheader) $(zlibheader))
+PHONY += COPYHEADERS

[1/5][POWERPC] boot: prepare for zImage.kexec
I tried to keep the changes to main.c and prom.h minimal.

[2/5][POWERPC] boot: Add kexec callable zImage wrapper
The actual code and crt0 for this method.

[3/5][POWERPC] boot: use more Kbuild rules
I had a bit of trouble with rebuilds. This trys to get some rules more right.

It also renames zliblinuxheader to linuxheader as the next patch will add stringify.h to the list, and renames OBJCOPYFLAGS to allow usage of the $(objcopy) rule.

[4/5][POWERPC] boot: Makefile and linker scripts for zImage.kexec
Delta to above and inker scripts for the existing link. zImage.kexec is 32 bit, there is also altnernate link that pretends to be 64 bit which allows kexec-tools to load it without writing ompat code.

[5/5][POWERPC] boot: generate lds file from lds.S
An alterative file ploferations, generate the lds from .S using the Kbuild rule. If you like this patch then I can avoid creating two files that are immediately removed.
milton