From d92967406a43777dabb9aeccd10e58f0b0711e02 Mon Sep 17 00:00:00 2001 From: James Mintram Date: Wed, 13 Oct 2021 22:43:02 +0100 Subject: [PATCH] Kernel: Add post build step to generate kernel8.img Add a postbuild step which creates a raw binary file called kernel8.img from the Prekernel elf file. --- Kernel/Prekernel/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Kernel/Prekernel/CMakeLists.txt b/Kernel/Prekernel/CMakeLists.txt index d4f015aaa9..e370e2ad59 100644 --- a/Kernel/Prekernel/CMakeLists.txt +++ b/Kernel/Prekernel/CMakeLists.txt @@ -61,6 +61,14 @@ if ("${SERENITY_ARCH}" STREQUAL "i686" OR "${SERENITY_ARCH}" STREQUAL "x86_64") ) endif() +if ("${SERENITY_ARCH}" STREQUAL "aarch64") + add_custom_command( + TARGET Prekernel POST_BUILD + COMMAND ${CMAKE_OBJCOPY} -O binary Prekernel kernel8.img + BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/kernel8.img + ) +endif() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Prekernel" DESTINATION boot) # Remove options which the Prekernel environment doesn't support.