Fix the mic chroot failed in openSUSE42.x sandbox/xuwc/devel-riscv-py2
authorwanchao-xu <wanchao.xu@samsung.com>
Mon, 19 Feb 2024 07:38:08 +0000 (15:38 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Mon, 19 Feb 2024 07:38:08 +0000 (15:38 +0800)
  * openSUSE42.x doesn't support mic chroot because old 'file' package can't recognize riscv64 file.

Change-Id: I4c7c05f2d7acc21ea612f722432413fdfadb4d50
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
cases/create/opt_cases/mic_cr_loop_pack-to-zip_riscv64.case

index 1f093b9dd0a26f10c9105e4070d1f44252fad23c..4752afa0b7249007849d2f822e7b857538a2a9df 100755 (executable)
@@ -25,7 +25,13 @@ if [ "$loop_used_before" -ne "$loop_used_after" ];then
 fi
 sudo unzip ./mic-output/handset_blackbay_riscv64*.zip -d ./mic-output
 test -e ./mic-output/platform.img
-sudo mic chroot ./mic-output/platform.img -c ls
+linux_distro=$(python -c 'import platform; print platform.linux_distribution();')
+# openSUSE42.x doesn't support mic chroot because old 'file' package can't recognize riscv64 file
+if [ !`echo $linux_distro |  grep -E "openSUSE.*42.*"` ]; then
+    sudo mic chroot ./mic-output/platform.img -c ls
+else
+    echo 'This is openSUSE42.x platform.'
+fi
 ]]></steps>
   <teardown><![CDATA[
 echo "cleaning..."