diff --git a/apps/Arm/odroid_vm/CMakeLists.txt b/apps/Arm/odroid_vm/CMakeLists.txt index 553674fa..1f43a52a 100644 --- a/apps/Arm/odroid_vm/CMakeLists.txt +++ b/apps/Arm/odroid_vm/CMakeLists.txt @@ -32,8 +32,6 @@ add_subdirectory(components/spi) add_subdirectory(components/clk) add_subdirectory(components/timer) -set(linux_binary_name "${CAMKES_ARM_LINUX_DIR}/linux") - # Different device tree if compiling with VmVUSB if(VmVUSB) set(device_tree_src "linux-secure-vusb-dtb") @@ -51,10 +49,14 @@ add_custom_command( # Create custom target for setting the dtb add_custom_target(set_dtb DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb") -# Add Linux VM images into file server -AddToFileServer("linux" "${linux_binary_name}") -AddToFileServer("linux-dtb" "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb" DEPENDS set_dtb) -DefineCAmkESVMFileServer() +# Create file server with Add Linux VM images +DefineCAmkESVMFileServer( + FILES + "linux:${CAMKES_ARM_LINUX_DIR}/linux" + "linux-dtb:${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb" + DEPENDS + set_dtb +) # Declare odroid root server DeclareCAmkESRootserver( diff --git a/apps/Arm/vm_cross_connector/CMakeLists.txt b/apps/Arm/vm_cross_connector/CMakeLists.txt index 64697289..4c7146fa 100644 --- a/apps/Arm/vm_cross_connector/CMakeLists.txt +++ b/apps/Arm/vm_cross_connector/CMakeLists.txt @@ -37,8 +37,6 @@ elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt") endif() endif() -AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux") - if(BUILD_CROSSVM) set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/rootfs.cpio.gz") # Checkout and configure linux to build crossvm module @@ -205,7 +203,6 @@ AddOverlayDirToRootfs( rootfs_target GZIP ) -AddToFileServer("linux-initrd" ${output_overlayed_rootfs_location} DEPENDS rootfs_target) AddCamkesCPPFlag( cpp_flags @@ -218,7 +215,13 @@ AddCamkesCPPFlag( VmVirtioNetVirtqueue ) -DefineCAmkESVMFileServer() +DefineCAmkESVMFileServer( + FILES + "linux:${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux" + "linux-initrd:${output_overlayed_rootfs_location}" + DEPENDS + rootfs_target +) CAmkESAddImportPath(${KernelARMPlatform}) diff --git a/apps/Arm/vm_introspect/CMakeLists.txt b/apps/Arm/vm_introspect/CMakeLists.txt index 8db76bbf..a92dbc3f 100644 --- a/apps/Arm/vm_introspect/CMakeLists.txt +++ b/apps/Arm/vm_introspect/CMakeLists.txt @@ -54,8 +54,6 @@ elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt") endif() -AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux") - set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/rootfs_crossvm.cpio.gz") ExternalProject_Add( @@ -108,8 +106,6 @@ AddOverlayDirToRootfs( GZIP ) -AddToFileServer("linux-initrd" ${output_overlayed_rootfs_location} DEPENDS rootfs_target) - AddCamkesCPPFlag( cpp_flags CONFIG_VARS @@ -121,7 +117,13 @@ AddCamkesCPPFlag( VmVirtioNetVirtqueue ) -DefineCAmkESVMFileServer() +DefineCAmkESVMFileServer( + FILES + "linux:${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux" + "linux-initrd:${output_overlayed_rootfs_location}" + DEPENDS + rootfs_target +) CAmkESAddImportPath(${KernelARMPlatform}) diff --git a/apps/Arm/vm_minimal/CMakeLists.txt b/apps/Arm/vm_minimal/CMakeLists.txt index b5d62b1d..21ac94fe 100644 --- a/apps/Arm/vm_minimal/CMakeLists.txt +++ b/apps/Arm/vm_minimal/CMakeLists.txt @@ -10,6 +10,10 @@ project(camkes-arm-tk1-vm C) include(${CAMKES_ARM_VM_HELPERS_PATH}) +# On some platforms, there is no dedicated rootfs, because it's part of the +# Linux kernel image. +set(rootfs_file "") + # Create our CPP Flags based on ARM VM config variables if("${KernelARMPlatform}" STREQUAL "tk1") set(cpp_flags "-DKERNELARMPLATFORM_TK1") @@ -21,10 +25,11 @@ if("${KernelARMPlatform}" STREQUAL "tk1") set(device_tree_src "${CAMKES_ARM_LINUX_DIR}/linux-tk1-secure.dts") endif() + # kernel image contains rootfs if(VmTk1InitrdRootfs) - set(linux_binary_name "${CAMKES_ARM_LINUX_DIR}/linux-tk1-initrd") + set(linux_image "${CAMKES_ARM_LINUX_DIR}/linux-tk1-initrd") else() - set(linux_binary_name "${CAMKES_ARM_LINUX_DIR}/linux-tk1-debian") + set(linux_image "${CAMKES_ARM_LINUX_DIR}/linux-tk1-debian") endif() set(output_dtb_location "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb") @@ -35,27 +40,28 @@ if("${KernelARMPlatform}" STREQUAL "tk1") DEPENDS ${device_tree_src} ) # Create custom target for setting the dtb - add_custom_target(set_dtb DEPENDS "${output_dtb_location}") - - # Add Linux VM images into file server - AddToFileServer("linux" "${linux_binary_name}") - AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS set_dtb) + add_custom_target(dtb_gen_target DEPENDS "${linux-dtb}") elseif("${KernelARMPlatform}" STREQUAL "tx1") set(cpp_flags "-DKERNELARMPLATFORM_TX1") - AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/tx1/linux") - AddToFileServer("linux-dtb" "${CAMKES_VM_IMAGES_DIR}/tx1/linux-dtb") + # kernel image contains rootfs + set(linux_image "${CAMKES_VM_IMAGES_DIR}/tx1/linux") + + # There is no need to generate or modify a DTB, so we just have a dummy + # target here. The target is depends on the (existing) DTB file, so we get a + # nice error here in case it is missing. + set(output_dtb_location "${CAMKES_VM_IMAGES_DIR}/tx1/linux-dtb") + add_custom_target(dtb_gen_target DEPENDS "${output_dtb_location}") elseif("${KernelARMPlatform}" STREQUAL "exynos5422") find_package(camkes-vm-linux REQUIRED) include(${CAMKES_VM_LINUX_HELPERS_PATH}) set(cpp_flags "-DKERNELARMPLATFORM_EXYNOS5422") - AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/exynos5422/linux") + set(linux_image "${CAMKES_VM_IMAGES_DIR}/exynos5422/linux") # Generate overlayed rootfs set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/exynos5422/rootfs.cpio.gz") - AddToFileServer("linux-initrd" ${rootfs_file}) # Updated dtb based on initrd UpdateDtbFromInitrd( "${CAMKES_VM_IMAGES_DIR}/exynos5422/linux-dtb" @@ -64,16 +70,14 @@ elseif("${KernelARMPlatform}" STREQUAL "exynos5422") dtb_gen_target output_dtb_location ) - AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target) elseif("${KernelARMPlatform}" STREQUAL "tx2") find_package(camkes-vm-linux REQUIRED) include(${CAMKES_VM_LINUX_HELPERS_PATH}) set(cpp_flags "-DKERNELARMPLATFORM_TX2") - AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/tx2/linux") + set(linux_image "${CAMKES_VM_IMAGES_DIR}/tx2/linux") set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/tx2/rootfs.cpio.gz") - AddToFileServer("linux-initrd" ${rootfs_file}) # Updated dtb based on initrd UpdateDtbFromInitrd( "${CAMKES_VM_IMAGES_DIR}/tx2/linux-dtb" @@ -82,16 +86,14 @@ elseif("${KernelARMPlatform}" STREQUAL "tx2") dtb_gen_target output_dtb_location ) - AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target) elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt") find_package(camkes-vm-linux REQUIRED) include(${CAMKES_VM_LINUX_HELPERS_PATH}) set(cpp_flags "-DKERNELARMPLATFORM_QEMU-ARM-VIRT") - AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/qemu-arm-virt/linux") + set(linux_image "${CAMKES_VM_IMAGES_DIR}/qemu-arm-virt/linux") set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/qemu-arm-virt/rootfs.cpio.gz") - AddToFileServer("linux-initrd" ${rootfs_file}) # Updated dtb based on initrd UpdateDtbFromInitrd( "${CAMKES_VM_IMAGES_DIR}/qemu-arm-virt/linux-dtb" @@ -100,7 +102,6 @@ elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt") dtb_gen_target output_dtb_location ) - AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target) include(simulation) set(SIMULATION ON CACHE BOOL "Generate simulation script to run qemu with the proper arguments") if(SIMULATION) @@ -116,9 +117,8 @@ elseif("${KernelARMPlatform}" STREQUAL "odroidc2") CAMKES_ROOT_DTB_FILE_PATH "${CAMKES_VM_IMAGES_DIR}/odroidc2/camkes-linux-dtb" CACHE STRING "" ) - AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/odroidc2/linux") + set(linux_image "${CAMKES_VM_IMAGES_DIR}/odroidc2/linux") set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/odroidc2/rootfs.cpio.gz") - AddToFileServer("linux-initrd" ${rootfs_file}) # Updated dtb based on initrd UpdateDtbFromInitrd( "${CAMKES_VM_IMAGES_DIR}/odroidc2/linux-dtb" @@ -127,12 +127,16 @@ elseif("${KernelARMPlatform}" STREQUAL "odroidc2") dtb_gen_target output_dtb_location ) - AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target) endif() AddCamkesCPPFlag(cpp_flags CONFIG_VARS VmEmmc2NoDMA VmVUSB Tk1DeviceFwd Tk1Insecure) -DefineCAmkESVMFileServer() +set(cpio_files "linux:${linux_image}" "linux-dtb:${output_dtb_location}") +if(rootfs_file) + list(APPEND cpio_files "linux-initrd:${rootfs_file}") +endif() + +DefineCAmkESVMFileServer(FILES ${cpio_files} DEPENDS dtb_gen_target) CAmkESAddImportPath(${KernelARMPlatform}) diff --git a/apps/Arm/vm_multi/CMakeLists.txt b/apps/Arm/vm_multi/CMakeLists.txt index 26456ece..ad853d34 100644 --- a/apps/Arm/vm_multi/CMakeLists.txt +++ b/apps/Arm/vm_multi/CMakeLists.txt @@ -73,25 +73,18 @@ AddOverlayDirToRootfs( GZIP ) -AddToFileServer( - "linux-initrd-vm0" - "${vm0_output_overlayed_rootfs_location}" +AddCamkesCPPFlag(cpp_flags CONFIG_VARS VmEmmc2NoDMA VmVUSB VmVchan Tk1DeviceFwd Tk1Insecure) + +DefineCAmkESVMFileServer( + FILES + "linux-initrd-vm0:${vm0_output_overlayed_rootfs_location}" + "linux-initrd-vm-client:${client_output_overlayed_rootfs_location}" + "linux:${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux" DEPENDS rootfs_target_vm0 -) -AddToFileServer( - "linux-initrd-vm-client" - "${client_output_overlayed_rootfs_location}" - DEPENDS rootfs_target_client_vm ) -AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux") - -AddCamkesCPPFlag(cpp_flags CONFIG_VARS VmEmmc2NoDMA VmVUSB VmVchan Tk1DeviceFwd Tk1Insecure) - -DefineCAmkESVMFileServer() - CAmkESAddImportPath(${KernelARMPlatform}) # Declare root server diff --git a/apps/Arm/vm_serial_server/CMakeLists.txt b/apps/Arm/vm_serial_server/CMakeLists.txt index 1547aef0..8e8a9e6a 100644 --- a/apps/Arm/vm_serial_server/CMakeLists.txt +++ b/apps/Arm/vm_serial_server/CMakeLists.txt @@ -16,7 +16,6 @@ include(${CAMKES_VM_LINUX_HELPERS_PATH}) # Create our CPP Flags based on ARM VM config variables set(cpp_flags "-DKERNELARMPLATFORM_EXYNOS5422") -AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/exynos5422/linux") # Generate overlayed rootfs set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/exynos5422/rootfs.cpio.gz") AddFileToOverlayDir( @@ -35,7 +34,7 @@ AddOverlayDirToRootfs( rootfs_target GZIP ) -AddToFileServer("linux-initrd" ${output_overlayed_rootfs_location} DEPENDS rootfs_target) + # Updated dtb based on generated initrd UpdateDtbFromInitrd( "${CAMKES_VM_IMAGES_DIR}/exynos5422/linux-dtb-virtcon" @@ -46,11 +45,18 @@ UpdateDtbFromInitrd( DEPENDS rootfs_target ) -AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target) AddCamkesCPPFlag(cpp_flags CONFIG_VARS VmEmmc2NoDMA VmVUSB Tk1DeviceFwd Tk1Insecure) -DefineCAmkESVMFileServer() +DefineCAmkESVMFileServer( + FILES + "linux:${CAMKES_VM_IMAGES_DIR}/exynos5422/linux" + "linux-initrd:${output_overlayed_rootfs_location}" + "linux-dtb:${output_dtb_location}" + DEPENDS + rootfs_target + dtb_gen_target +) CAmkESAddImportPath(exynos5422) diff --git a/apps/Arm/vm_virtio_net/CMakeLists.txt b/apps/Arm/vm_virtio_net/CMakeLists.txt index 77fca436..7b699c29 100644 --- a/apps/Arm/vm_virtio_net/CMakeLists.txt +++ b/apps/Arm/vm_virtio_net/CMakeLists.txt @@ -73,10 +73,6 @@ UpdateDtbFromInitrd( rootfs_target ) -AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target) -AddToFileServer("linux-initrd" ${output_overlayed_rootfs_location} DEPENDS rootfs_target) -AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux") - AddCamkesCPPFlag( cpp_flags CONFIG_VARS @@ -87,7 +83,15 @@ AddCamkesCPPFlag( VmVirtioNetVirtqueue ) -DefineCAmkESVMFileServer() +DefineCAmkESVMFileServer( + FILES + "linux:${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux" + "linux-initrd:${output_overlayed_rootfs_location}" + "linux-dtb:${output_dtb_location}" + DEPENDS + rootfs_target + dtb_gen_target +) CAmkESAddImportPath(${KernelARMPlatform}) diff --git a/apps/x86/cma34cr_centos/CMakeLists.txt b/apps/x86/cma34cr_centos/CMakeLists.txt index 4c389037..a6e75eec 100644 --- a/apps/x86/cma34cr_centos/CMakeLists.txt +++ b/apps/x86/cma34cr_centos/CMakeLists.txt @@ -20,19 +20,29 @@ DeclareCAmkESVM(Init0 EXTRA_SOURCES ${init0_extra} EXTRA_LIBS ethdrivers) DecompressLinuxKernel( decompress_linux decompressed_kernel ${CMAKE_CURRENT_SOURCE_DIR}/centos_linux/bzimage ) -AddToFileServer("bzimage" ${decompressed_kernel} DEPENDS decompress_linux) - -# Declare C162 Rootfs -AddToFileServer("rootfs.cpio" ${CMAKE_CURRENT_SOURCE_DIR}/centos_linux/rootfs.cpio) # Provided by find_package(util_libs) include(${LWIP_HELPERS}) # Declare lwipopts.h include AddLWIPConfiguration(${CMAKE_CURRENT_SOURCE_DIR}/lwip_include) -# Initialise CAmkES Root Server with addition CPP includes -DeclareCAmkESVMRootServer( - cma34cr_centos.camkes +# Add Linux VM images into file server +# This implicitly depends on all input files. Since ${decompressed_kernel} is +# generated by some recipe set up in DecompressLinuxKernel(), there should be no +# need to add the explicit dependency on 'extract_linux_kernel' here also if +# dependencies are set up properly. But this function might do other things +# also, so we play safe and add the explicit dependency. +DefineCAmkESVMFileServer( + FILES + "bzimage:${decompressed_kernel}" + "rootfs.cpio:${CMAKE_CURRENT_SOURCE_DIR}/centos_linux/rootfs.cpio" + DEPENDS + extract_linux_kernel +) + +# Declare CAmkES Root Server +DeclareCAmkESRootserver( + "cma34cr_centos.camkes" CPP_INCLUDES ${CAMKES_VM_DIR}/components/StringReverse/include ${CAMKES_VM_DIR}/components/Ethdriver/include diff --git a/apps/x86/cma34cr_ubuntu/CMakeLists.txt b/apps/x86/cma34cr_ubuntu/CMakeLists.txt index 84855785..3b57fe4d 100644 --- a/apps/x86/cma34cr_ubuntu/CMakeLists.txt +++ b/apps/x86/cma34cr_ubuntu/CMakeLists.txt @@ -21,10 +21,20 @@ DeclareCAmkESVM(Init0) # Declare C162 Kernel GetArchSpecificLinuxKernelFile("32" kernel_file) DecompressLinuxKernel(extract_linux_kernel decompressed_kernel ${kernel_file}) -AddToFileServer("bzimage" ${decompressed_kernel} DEPENDS extract_linux_kernel) -# Declare C162 Rootfs -AddToFileServer("rootfs.cpio" ${CMAKE_CURRENT_SOURCE_DIR}/ubuntu_linux/rootfs.cpio) - -# Initialise CAmkES Root Server with addition CPP includes -DeclareCAmkESVMRootServer(cma34cr_ubuntu.camkes) +# Add Linux VM images into file server +# This implicitly depends on all input files. Since ${decompressed_kernel} is +# generated by some recipe set up in DecompressLinuxKernel(), there should be no +# need to add the explicit dependency on 'extract_linux_kernel' here also if +# dependencies are set up properly. But this function might do other things +# also, so we play safe and add the explicit dependency. +DefineCAmkESVMFileServer( + FILES + "bzimage:${decompressed_kernel}" + "rootfs.cpio:${CMAKE_CURRENT_SOURCE_DIR}/ubuntu_linux/rootfs.cpio" + DEPENDS + extract_linux_kernel +) + +# Declare CAmkES Root Server +DeclareCAmkESRootserver("cma34cr_centos.camkes") diff --git a/apps/x86/minimal/CMakeLists.txt b/apps/x86/minimal/CMakeLists.txt index 6888adc4..38a24925 100644 --- a/apps/x86/minimal/CMakeLists.txt +++ b/apps/x86/minimal/CMakeLists.txt @@ -25,13 +25,23 @@ GetDefaultLinuxRootfsFile(rootfs_file) # Decompress Linux Kernel image and add to file server DecompressLinuxKernel(extract_linux_kernel decompressed_kernel ${kernel_file}) -AddToFileServer("bzimage" ${decompressed_kernel} DEPENDS extract_linux_kernel) -# Add rootfs images into file server -AddToFileServer("rootfs.cpio" ${rootfs_file}) - -# Initialise CAmkES Root Server with addition CPP includes -DeclareCAmkESVMRootServer(minimal.camkes) +# Add Linux VM images into file server +# This implicitly depends on all input files. Since ${decompressed_kernel} is +# generated by some recipe set up in DecompressLinuxKernel(), there should be no +# need to add the explicit dependency on 'extract_linux_kernel' here also if +# dependencies are set up properly. But this function might do other things +# also, so we play safe and add the explicit dependency. +DefineCAmkESVMFileServer( + FILES + "bzimage:${decompressed_kernel}" + "rootfs.cpio:${rootfs_file}" + DEPENDS + extract_linux_kernel +) + +# Declare CAmkES Root Server +DeclareCAmkESRootserver("minimal.camkes" CPP_INCLUDES "${VM_PROJECT_DIR}/components/VM") if(SIMULATION) include(simulation) diff --git a/apps/x86/optiplex9020/CMakeLists.txt b/apps/x86/optiplex9020/CMakeLists.txt index 8ae43a20..ba0832fc 100644 --- a/apps/x86/optiplex9020/CMakeLists.txt +++ b/apps/x86/optiplex9020/CMakeLists.txt @@ -28,10 +28,23 @@ GetArchDefaultLinuxRootfsFile("32" rootfs_file) DecompressLinuxKernel(extract_linux_kernel decompressed_kernel ${kernel_file}) # Add Linux VM images into file server -AddToFileServer("bzimage" ${decompressed_kernel} DEPENDS extract_linux_kernel) -AddToFileServer("rootfs.cpio" ${rootfs_file}) +# This implicitly depends on all input files. Since ${decompressed_kernel} is +# generated by some recipe set up in DecompressLinuxKernel(), there should be no +# need to add the explicit dependency on 'extract_linux_kernel' here also if +# dependencies are set up properly. But this function might do other things +# also, so we play safe and add the explicit dependency. +DefineCAmkESVMFileServer( + FILES + "bzimage:${decompressed_kernel}" + "rootfs.cpio:${rootfs_file}" + DEPENDS + extract_linux_kernel +) -# Initialise CAmkES Root Server with additional CPP includes -DeclareCAmkESVMRootServer( - optiplex9020.camkes CPP_INCLUDES ${CAMKES_VM_DIR}/components/StringReverse/include +# Declare CAmkES Root Server +DeclareCAmkESRootserver( + "optiplex9020.camkes" + CPP_INCLUDES + "${VM_PROJECT_DIR}/components/VM" + "${CAMKES_VM_DIR}/components/StringReverse/include" ) diff --git a/apps/x86/virtio_blk_sample/CMakeLists.txt b/apps/x86/virtio_blk_sample/CMakeLists.txt index e6160dcd..20e8da4b 100644 --- a/apps/x86/virtio_blk_sample/CMakeLists.txt +++ b/apps/x86/virtio_blk_sample/CMakeLists.txt @@ -22,11 +22,23 @@ GetDefaultLinuxRootfsFile(rootfs_file) # Decompress Linux Kernel image and add to file server DecompressLinuxKernel(extract_linux_kernel decompressed_kernel ${kernel_file}) -AddToFileServer("bzimage" ${decompressed_kernel} DEPENDS extract_linux_kernel) -AddToFileServer("rootfs.cpio" ${rootfs_file}) - -DeclareCAmkESVMRootServer(virtio_blk_sample.camkes) +# Add Linux VM images into file server +# This implicitly depends on all input files. Since ${decompressed_kernel} is +# generated by some recipe set up in DecompressLinuxKernel(), there should be no +# need to add the explicit dependency on 'extract_linux_kernel' here also if +# dependencies are set up properly. But this function might do other things +# also, so we play safe and add the explicit dependency. +DefineCAmkESVMFileServer( + FILES + "bzimage:${decompressed_kernel}" + "rootfs.cpio:${rootfs_file}" + DEPENDS + extract_linux_kernel +) + +# Declare CAmkES Root Server +DeclareCAmkESRootserver("virtio_blk_sample.camkes") if(SIMULATION) include(simulation) diff --git a/apps/x86/zmq_samples/CMakeLists.txt b/apps/x86/zmq_samples/CMakeLists.txt index f8d80204..02db9c15 100644 --- a/apps/x86/zmq_samples/CMakeLists.txt +++ b/apps/x86/zmq_samples/CMakeLists.txt @@ -135,6 +135,9 @@ AddZMQBinary(worker) AddZMQBinary(pub) AddZMQBinary(sub) +set(rootfs_images "") +set(rootfs_deps "") + foreach(i RANGE ${NumberVMsLess1}) set(overlay_target "overlay_vm${i}") set(rootfs_target "rootfs_target_vm${i}") @@ -155,12 +158,30 @@ foreach(i RANGE ${NumberVMsLess1}) rootfs_img "${rootfs_target}" ) - AddToFileServer("vm${i}_rootfs.cpio" "${rootfs_img}" DEPENDS "${rootfs_target}") + list(APPEND rootfs_images "vm${i}_rootfs.cpio:${rootfs_img}") + list(APPEND rootfs_deps "${rootfs_target}") endforeach() # Decompress Linux Kernel image and add to file server DecompressLinuxKernel(extract_linux_kernel decompressed_kernel ${kernel_file}) -AddToFileServer("bzimage" ${decompressed_kernel} DEPENDS extract_linux_kernel) + +# Add Linux VM images into file server. +# This implicitly depends on all input files. Since ${decompressed_kernel} is +# generated by some recipe set up in DecompressLinuxKernel(), there should be no +# need to add the explicit dependency on 'extract_linux_kernel' here also if +# dependencies are set up properly. But this function might do other things +# also, so we play safe and add the explicit dependency. +# For 'rootfs_deps' it is similar, AddOverlayDirToRootfs() should have created a +# recipe for the output with proper dependencies, so there should not be a need +# that we explicitly depend on everything from 'rootfs_deps' here. +DefineCAmkESVMFileServer( + FILES + "bzimage:${decompressed_kernel}" + "${rootfs_images}" + DEPENDS + extract_linux_kernel + "${rootfs_deps}" +) # Initialise CAmkES Root Server with addition CPP includes -DeclareCAmkESVMRootServer("${zmq_camkes}") +DeclareCAmkESRootserver("${zmq_camkes}" CPP_INCLUDES "${VM_PROJECT_DIR}/components/VM")