cmake: implementing bootable CD-ROM image generation with GRUB

This commit is contained in:
2026-02-21 23:24:03 +00:00
parent 2c41f1a77a
commit b62052f619
2 changed files with 18 additions and 0 deletions

View File

@@ -1 +1,2 @@
include(System-Disk)
include(QEMU) include(QEMU)

View File

@@ -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 ()