From b62052f619fb6d92dd453577ce1c4633fb55a6f8 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 21 Feb 2026 23:24:03 +0000 Subject: [PATCH] cmake: implementing bootable CD-ROM image generation with GRUB --- arch/x86_64/Arch.cmake | 1 + arch/x86_64/System-Disk.cmake | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 arch/x86_64/System-Disk.cmake diff --git a/arch/x86_64/Arch.cmake b/arch/x86_64/Arch.cmake index 56e9491..c23a48f 100644 --- a/arch/x86_64/Arch.cmake +++ b/arch/x86_64/Arch.cmake @@ -1 +1,2 @@ +include(System-Disk) include(QEMU) diff --git a/arch/x86_64/System-Disk.cmake b/arch/x86_64/System-Disk.cmake new file mode 100644 index 0000000..febecbb --- /dev/null +++ b/arch/x86_64/System-Disk.cmake @@ -0,0 +1,17 @@ +find_program(GRUB_MKRESCUE grub-mkrescue) + +if (GRUB_MKRESCUE) + message(STATUS "GRUB: Found grub-mkrescue. Bootable CD-ROM image creation is enabled") + set(image_cdrom ${CMAKE_CURRENT_BINARY_DIR}/rosetta-system.iso) + + add_custom_target(cdrom + DEPENDS sysroot + COMMAND ${GRUB_MKRESCUE} + -o ${image_cdrom} + ${CMAKE_CURRENT_BINARY_DIR}/sysroot + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Building GRUB CD-ROM image" + ) +else () + message(STATUS "Cannot find grub-mkrescue. Bootable CD-ROM image creation is unavailable") +endif ()