Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
Update set_macvlan.sh template
Browse files Browse the repository at this point in the history
- Fix the URLs to point to the new repo name
- Add a check to see if the module file exists before trying to load it
  in the loader script
  • Loading branch information
whi-tw committed Feb 21, 2023
1 parent 6f22f07 commit 5ab24f6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/new-firmware-request-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
gh issue close ${{ github.event.issue.number }}
exit 1
fi
- name: Generate email body to request GPL Archive
- name: Comment with GPL Archive Request email body
run: |
COMMENT_BODY="$(python ci/render_request_email_issue_comment.py "${{ steps.issue-fields.outputs.device }}" "${{ steps.issue-fields.outputs.firmware_version }}")"
gh issue comment ${{ github.event.issue.number }} -b "${COMMENT_BODY}"
19 changes: 15 additions & 4 deletions ci/templates/setup_macvlan.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MODULE_FILE_NAME="${DEVICE}-${RUNNING_FIRMWARE_VERSION}_macvlan.ko"

RELEASE_TAG="{{ release_tag }}"

RELEASE_DOWNLOAD_URL_BASE="https://github.com/whi-tw/macvlan-unifi-udr/releases/download/${RELEASE_TAG}"
RELEASE_DOWNLOAD_URL_BASE="https://github.com/whi-tw/macvlan-unifios/releases/download/${RELEASE_TAG}"
RELEASE_DOWNLOAD_URL="${RELEASE_DOWNLOAD_URL_BASE}/${MODULE_FILE_NAME}"

DATA_DIR="/data"
Expand All @@ -21,8 +21,12 @@ curl -Lo "${MODULE_DIR}/${MODULE_FILE_NAME}" "${RELEASE_DOWNLOAD_URL}" || {
echo
echo "****************************************************************************************"
echo "!! Failed to download module file from ${RELEASE_DOWNLOAD_URL}"
echo "!! Please check that your device(${DEVICE}) and firmware version (${RUNNING_FIRMWARE_VERSION}) is supported in release ${RELEASE_TAG}."
echo "!! Release URL: https://github.com/whi-tw/macvlan-unifi-udr/releases/tag/${RELEASE_TAG}"
echo "!! Please check that your device (${DEVICE}) and firmware version"
echo "!! (${RUNNING_FIRMWARE_VERSION}) is supported in release ${RELEASE_TAG}."
echo "!! Release URL: https://github.com/whi-tw/macvlan-unifios/releases/tag/${RELEASE_TAG}"
echo "!!"
echo "!! If your device / firmware version is not supported, please open an issue:"
echo "!! https://github.com/whi-tw/macvlan-unifios/issues/new/choose"
echo "****************************************************************************************"
exit 1
}
Expand All @@ -34,7 +38,14 @@ DEVICE="$(ubnt-device-info model_short)"
RUNNING_FIRMWARE_VERSION="$(ubnt-device-info firmware)"
MODULE_FILE_NAME="${DEVICE}-${RUNNING_FIRMWARE_VERSION}_macvlan.ko"
insmod /data/macvlan-module/${MODULE_FILE_NAME}
MODULE_FILE_PATH="/data/macvlan-module/${MODULE_FILE_NAME}"
if [[ ! -f "${MODULE_FILE_PATH}" ]]; then
echo "Module for ${DEVICE} running f/w ${RUNNING_FIRMWARE_VERSION} not found."
echo "Update from the latest release: https://github.com/whi-tw/macvlan-unifios/releases/latest"
exit 1
fi
insmod "${MODULE_FILE_PATH}"
EOF

chmod +x /data/on_boot.d/01-load-macvlan-module.sh
2 changes: 1 addition & 1 deletion macvlan-unifios-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1

0 comments on commit 5ab24f6

Please sign in to comment.