From c6b7940bf92a0e7b96e34f9ad3b9e5535c3bd9ea Mon Sep 17 00:00:00 2001 From: Jiangbo Wu Date: Thu, 6 Sep 2018 13:29:38 +0800 Subject: [PATCH] samples: Add AliOS as guest launch option Add sample script launch option to launch AliOS as a guest. And it reuse launch android function due to the same configurations. Tracked-On: projectacrn/acrn-hypervisor#1173 Signed-off-by: Jiangbo Wu Reviewed-by: Binbin Wu Acked-by: Anthony Xu Signed-off-by: Jiangbo Wu --- devicemodel/samples/apl-mrb/acrn_guest.service | 2 +- devicemodel/samples/apl-mrb/launch_uos.sh | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/devicemodel/samples/apl-mrb/acrn_guest.service b/devicemodel/samples/apl-mrb/acrn_guest.service index ea25f4c57..502b6ca02 100644 --- a/devicemodel/samples/apl-mrb/acrn_guest.service +++ b/devicemodel/samples/apl-mrb/acrn_guest.service @@ -10,7 +10,7 @@ ConditionPathExists=/dev/acrn_vhm [Service] Type=simple RemainAfterExit=false -ExecStart=/bin/sh /usr/share/acrn/samples/apl-mrb/launch_uos.sh -V 5 +ExecStart=/bin/sh /usr/share/acrn/samples/apl-mrb/launch_uos.sh -V 6 [Install] WantedBy=multi-user.target diff --git a/devicemodel/samples/apl-mrb/launch_uos.sh b/devicemodel/samples/apl-mrb/launch_uos.sh index 0014d1bd6..81fc1fd5e 100755 --- a/devicemodel/samples/apl-mrb/launch_uos.sh +++ b/devicemodel/samples/apl-mrb/launch_uos.sh @@ -316,6 +316,13 @@ fi -B "$kernel_cmdline" $vm_name } +function launch_alios() +{ +#AliOS is not Android, only has same configuration currently, reuse launch function + +launch_android "$@" +} + function help() { echo "Use luanch_uos.sh like that ./launch_uos.sh -V <#>" @@ -324,7 +331,8 @@ echo "-V 1 means just launching 1 clearlinux UOS" echo "-V 2 means just launching 1 android UOS" echo "-V 3 means launching 1 clearlinux UOS + 1 android UOS" echo "-V 4 means launching 2 clearlinux UOSs" -echo "-V 5 means auto check android/linux UOS; if exist, launch it" +echo "-V 5 means just launching 1 alios UOS" +echo "-V 6 means auto check android/linux/alios UOS; if exist, launch it" } launch_type=1 @@ -356,9 +364,11 @@ fi mkdir -p /data mount /dev/mmcblk1p3 /data -if [ $launch_type == 5 ]; then +if [ $launch_type == 6 ]; then if [ -f "/data/android/android.img" ]; then launch_type=2; + elif [ -f "/data/alios/alios.img" ]; then + launch_type=5; else launch_type=1; fi @@ -392,6 +402,9 @@ case $launch_type in sleep 5 launch_clearlinux 2 1 "64 448 4" 0x070F00 clearlinux_dup "L2aaG" $debug ;; + 5) echo "Launch alios UOS" + launch_alios 1 3 "64 448 8" 0x070F00 alios "AliaaG" $debug + ;; esac umount /data