diff options
author | Jeremy Linton <jeremy.linton@arm.com> | 2023-08-03 10:41:50 +0800 |
---|---|---|
committer | Simon Horman <horms@kernel.org> | 2023-08-11 09:25:12 +0200 |
commit | f41c4182b0c403ea93cf47dcdc96437f5d6c53da (patch) | |
tree | 3e60f781578bb7992ad2388c62d51172507cd841 /include | |
parent | 1572b91da7c4512d111a340185914c34acb0a139 (diff) | |
download | kexec-tools-f41c4182b0c403ea93cf47dcdc96437f5d6c53da.tar.gz |
kexec/zboot: Add arch independent zboot support
The linux kernel CONFIG_ZBOOT option creates
self decompressing PE kernel images. So this means
that kexec should have a generic understanding of
the format which may be used by multiple arches.
So lets add an arch independent validation
and decompression routine.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
[Modified by Pingfan to export kernel fd]
Signed-off-by: Pingfan Liu <piliu@redhat.com>
[Corrected indentation]
Signed-off-by: Simon Horman <horms@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile | 1 | ||||
-rw-r--r-- | include/kexec-pe-zboot.h | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/Makefile b/include/Makefile index 621ce9f9..cd88a26b 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,6 +1,7 @@ dist += include/Makefile \ include/config.h \ include/config.h.in \ + include/kexec-pe-zboot.h \ include/kexec-uImage.h \ include/x86/x86-linux.h \ include/x86/mb_info.h \ diff --git a/include/kexec-pe-zboot.h b/include/kexec-pe-zboot.h new file mode 100644 index 00000000..e2e0448a --- /dev/null +++ b/include/kexec-pe-zboot.h @@ -0,0 +1,15 @@ +#ifndef __KEXEC_PE_ZBOOT_H__ +#define __KEXEC_PE_ZBOOT_H__ + +/* see drivers/firmware/efi/libstub/zboot-header.S */ +struct linux_pe_zboot_header { + uint32_t mz_magic; + uint32_t image_type; + uint32_t payload_offset; + uint32_t payload_size; + uint32_t reserved[2]; + uint32_t compress_type; +}; + +int pez_prepare(const char *crude_buf, off_t buf_sz, int *kernel_fd); +#endif |