From 237d07b9bde3284effa048b298d3078d9aa41fab Mon Sep 17 00:00:00 2001 From: Liu Long Date: Mon, 15 Aug 2022 10:40:59 +0800 Subject: [PATCH] ACRN:SampleApplication: Copy RT kernel scripts Add the copy RT kernel for the create image scripts. Tracked-On: #7820 Signed-off-by: Liu Long --- .../image_builder/create_image.sh | 16 ++++++++++++++-- .../image_builder/setup_rt_vm.sh | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/misc/sample_application/image_builder/create_image.sh b/misc/sample_application/image_builder/create_image.sh index c311221b8..9ecc9951b 100755 --- a/misc/sample_application/image_builder/create_image.sh +++ b/misc/sample_application/image_builder/create_image.sh @@ -52,10 +52,19 @@ source logger.sh # Actions defined as functions ######################################## +function copy_rt_kernel() { + for file in ~/acrn-work/*rtvm*.deb + do + if [[ ${file} != *"dbg"* ]]; then + cp ${file} ${build_dir} + fi + done +} + function check_rt_kernel() { for file in ${rt_kernel[@]} do - ls *.deb | grep ${file} + ls ${build_dir}/*.deb | grep ${file} if [ $? -eq 1 ]; then echo "RT VM kernel package ${file} is not found." exit @@ -166,7 +175,8 @@ function setup_rt_vm_rootfs() { sudo cp configRTcores.sh ${mount_point}/root/scripts/ && \ sudo cp setup_rt_vm.sh logger.sh ${mount_point}/ && \ sudo schroot -c acrn-guest bash /setup_rt_vm.sh && \ - sudo rm ${mount_point}/setup_rt_vm.sh ${mount_point}/logger.sh + sudo rm ${mount_point}/setup_rt_vm.sh ${mount_point}/logger.sh && \ + sudo rm bashrc proxy.conf } function cleanup() { @@ -175,6 +185,7 @@ function cleanup() { sudo umount ${mount_point} sudo rmdir ${mount_point} + echo ${mount_point} sudo kpartx -vd /dev/${loop_dev} sudo losetup -vd /dev/${loop_dev} true @@ -198,6 +209,7 @@ fi try_step "Download Ubuntu Focal cloud image" download_image ${cloud_image} ${cloud_image_url} if [[ ${vm_type} == "rt-vm" ]]; then + try_step "Copy the RT kernel to build directory" copy_rt_kernel try_step "Check availability of RT kernel image" check_rt_kernel fi try_step "Creating an enlarged copy of ${cloud_image}" copy_and_enlarge_image ${cloud_image} ${target_image} ${size_modifier} diff --git a/misc/sample_application/image_builder/setup_rt_vm.sh b/misc/sample_application/image_builder/setup_rt_vm.sh index 040a62d97..fdfeb2ab7 100644 --- a/misc/sample_application/image_builder/setup_rt_vm.sh +++ b/misc/sample_application/image_builder/setup_rt_vm.sh @@ -35,7 +35,7 @@ function install_rt_kernel() { search_dir=$1 for file in $(ls -r ${search_dir}/*acrn-kernel-*.deb) do - apt install ${file} + sudo apt install ${file} done }