Skip to content

tools/kexec: Introduce utility to build zboot image with bpf section

Pingfan Liu bpf kexec 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tools/kexec: Introduce a bpf-prog to parse zboot image formattools/kexec/Makefile tools/kexec/pe.h tools/kexec/zboot_parser_bpf.c+415 -00 replies
2/2tools/kexec: Add a zboot image building tooltools/kexec/Makefile tools/kexec/zboot_image_builder.c+288 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/2] tools/kexec: Introduce utility to build zboot image with bpf section

The series '[PATCHv3 0/9] kexec: Use BPF lskel to enable kexec to load PE format boot image' [1] makes the kernel ready to load PE files with .bpf sections. These two patches integrate the zboot-bpf image builder into the kernel source tree, so users can conveniently generate the final image with the command:
make -C tools/kexec zboot
Later, the infrastructure for UKI can also be organized here.

To facilitate the review, I have pushed the whole series, including the kernel part, to GitHub [2]. There is a slight difference from [PATCHv3 8/9]
"kexec: Integrate bpf light skeleton to load zboot image" in [1]. This difference is made in the function get_symbol_from_elf() to accommodate clang's behavior, which combines the section header string table and normal string table into one.

[1]: https://lore.kernel.org/bpf/[email protected]/
[2]: https://github.com/pfliu/linux/tree/kexec_bpf_v3%2B

Pingfan Liu (2):
tools/kexec: Introduce a bpf-prog to parse zboot image format tools/kexec: Add a zboot image building tool

 tools/kexec/Makefile              |  89 ++++++++++
 tools/kexec/pe.h                  | 177 +++++++++++++++++++
 tools/kexec/zboot_image_builder.c | 279 ++++++++++++++++++++++++++++++
 tools/kexec/zboot_parser_bpf.c    | 157 +++++++++++++++++
 4 files changed, 702 insertions(+)
 create mode 100644 tools/kexec/Makefile
 create mode 100644 tools/kexec/pe.h
 create mode 100644 tools/kexec/zboot_image_builder.c
 create mode 100644 tools/kexec/zboot_parser_bpf.c
Signature · 1 line
2.49.0