Add exception to handle rk35xx upgrade

This commit is contained in:
Igor Pecovnik
2024-08-19 11:17:28 +02:00
parent 464c9209c3
commit 501c417cfa

View File

@@ -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