From 501c417cfaa25c157825fec88695e01c565503e9 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 19 Aug 2024 11:17:28 +0200 Subject: [PATCH] Add exception to handle rk35xx upgrade --- dut-run/action.yml | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/dut-run/action.yml b/dut-run/action.yml index 130a93e..1be2bd8 100644 --- a/dut-run/action.yml +++ b/dut-run/action.yml @@ -46,7 +46,16 @@ runs: echo "REPOSITORY=stable" >> $GITHUB_ENV fi - + - name: "Handling exceptions" + if: ${{ inputs.STATUS == '' }} + shell: bash + run: | + + if [ "${{ inputs.LINUXFAMILY }}" == "rk35xx" ] && [ "${{ inputs.BRANCH }}" != "vendor" ] ; then + echo "LINUXFAMILY=rockchip64" >> $GITHUB_ENV + else + echo "LINUXFAMILY=${{ inputs.LINUXFAMILY }}" >> $GITHUB_ENV + fi - name: "Check if kernel package exists" if: ${{ inputs.STATUS == '' }} @@ -54,61 +63,61 @@ runs: run: | # check if kernel install is possible - if ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt search linux-image-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" 2>/dev/null | grep linux-image-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}; then + if ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt search linux-image-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" 2>/dev/null | grep linux-image-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}; then # download new - ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y --download-only linux-image-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" + ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y --download-only linux-image-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" # purge previously installed ones ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get -y purge '^linux-image-*'" || true # install new - ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y linux-image-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" + ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y linux-image-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" - echo "Install: linux-image-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" >> $GITHUB_STEP_SUMMARY + echo "Install: linux-image-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" >> $GITHUB_STEP_SUMMARY else echo "STATUS=notfound" >> $GITHUB_ENV - echo "Kernel for ${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }} does not exists" >> $GITHUB_STEP_SUMMARY + echo "Kernel for ${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }} does not exists" >> $GITHUB_STEP_SUMMARY fi # check if DTB install is possible - if ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt search linux-dtb-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" 2>/dev/null | grep linux-dtb-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}; then + if ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt search linux-dtb-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" 2>/dev/null | grep linux-dtb-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}; then # download new - ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y --download-only linux-dtb-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" + ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y --download-only linux-dtb-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" # purge previously installed ones ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get -y purge '^linux-dtb-*'" || true # install new - ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y linux-dtb-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" + ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y linux-dtb-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" - echo "Install: linux-dtb-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" >> $GITHUB_STEP_SUMMARY + echo "Install: linux-dtb-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" >> $GITHUB_STEP_SUMMARY else # If DTB does not exists we don't set as some kernels don't have it # #echo "STATUS=notfound" >> $GITHUB_ENV # # - echo "DTB for ${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }} does not exists" >> $GITHUB_STEP_SUMMARY + echo "DTB for ${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }} does not exists" >> $GITHUB_STEP_SUMMARY fi # check if headers install is possible - if ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt search linux-headers-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" 2>/dev/null | grep linux-headers-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}; then + if ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt search linux-headers-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" 2>/dev/null | grep linux-headers-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}; then # download new - ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y --download-only linux-headers-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" + ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y --download-only linux-headers-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" # purge previously installed ones ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get -y purge '^linux-headers-*'" || true # install new - ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y linux-headers-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" + ssh -o StrictHostKeyChecking=no ${{ inputs.DUT_USER }}@${{ inputs.DUT_IP }} "apt-get reinstall -y linux-headers-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" - echo "Install: linux-headers-${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }}" >> $GITHUB_STEP_SUMMARY + echo "Install: linux-headers-${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }}" >> $GITHUB_STEP_SUMMARY else echo "STATUS=notfound" >> $GITHUB_ENV - echo "Headers for ${{ inputs.BRANCH }}-${{ inputs.LINUXFAMILY }} does not exists" >> $GITHUB_STEP_SUMMARY + echo "Headers for ${{ inputs.BRANCH }}-${{ env.LINUXFAMILY }} does not exists" >> $GITHUB_STEP_SUMMARY fi # list other files