From 61f6ec6c8864252f40797870d69574251a3a7c09 Mon Sep 17 00:00:00 2001 From: Chenli Wei Date: Thu, 18 Aug 2022 10:01:07 +0800 Subject: [PATCH] SampleApplication: Update the image create scripts Update the rc.local for User VM, check the echo result and try again if the echo failed. Tracked-On: #7820 Signed-off-by: Chenli Wei --- .../image_builder/create_image.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/misc/sample_application/image_builder/create_image.sh b/misc/sample_application/image_builder/create_image.sh index a83faf134..772e37f39 100755 --- a/misc/sample_application/image_builder/create_image.sh +++ b/misc/sample_application/image_builder/create_image.sh @@ -156,19 +156,26 @@ function create_uio_config() { local temp_file=$(mktemp /tmp/rc.local.XXXX) cat << EOF > ${temp_file} +#!/bin/bash dhclient -q modprobe uio modprobe uio_pci_generic -for i in {0..3} +for i in {0..2} do bash -c 'echo "1af4 1110" > /sys/bus/pci/drivers/uio_pci_generic/new_id' +if [ $? -eq 0 ]; then + echo "uio setting result" $? + break +fi +echo "uio setting result" $? "try again" sleep 1 done EOF - sudo mv ${temp_file} /etc/rc.local && \ - sudo chown root:root /etc/rc.local + sudo mv ${temp_file} $mount_point/etc/rc.local && \ + sudo chown root:root $mount_point/etc/rc.local && \ + sudo chmod 755 $mount_point/etc/rc.local } function setup_hmi_vm_rootfs() {