Skip to content

Commit

Permalink
Revert "fix: update tier4_hdr_camera_driver tasks"
Browse files Browse the repository at this point in the history
This reverts commit d758113.
  • Loading branch information
tokuda99 committed Jun 13, 2024
1 parent d758113 commit a8b9cac
Showing 1 changed file with 12 additions and 34 deletions.
46 changes: 12 additions & 34 deletions ansible/roles/tier4_hdr_camera_driver/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@
url: "{{ camera_driver_repo }}"
register: github_api_return_info

- name: Check if GitHub API return is valid
fail:
msg: "Failed to fetch data from GitHub API."
when: github_api_return_info.status != 200

- name: Parse download URL for driver
loop: "{{ github_api_return_info.json.assets }}"
ansible.builtin.set_fact:
driver_deb_download_url: "{{ item.browser_download_url }}"
driver_deb_name: "{{ item.name }}"
when: item.name | regex_search('tier4-camera-drivers-for-anvil.tar.gz')

- name: Ensure driver_deb_download_url is defined
fail:
msg: "driver_deb_download_url is not defined. Check the regex or GitHub API response."
when: driver_deb_download_url is not defined
when: item.name | regex_search('tier4-camera-gmsl_(.+)_arm64.deb')

- name: Parse download URL for SDK
loop: "{{ github_api_return_info.json.assets }}"
Expand All @@ -27,33 +17,12 @@
sdk_deb_name: "{{ item.name }}"
when: item.name | regex_search('t4cam_sdk-(.+)-rqx58g.deb')

- name: Download driver tar.gz file from public repo
ansible.builtin.get_url:
- name: Download driver deb file from public repo
ansible.builtin.uri:
url: "{{ driver_deb_download_url }}"
dest: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}"
mode: 0644

- name: Extract driver tar.gz file
ansible.builtin.unarchive:
src: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}"
dest: "{{ camera_driver_download_dir }}"
remote_src: yes

- name: Ensure install.sh has execute permission
ansible.builtin.file:
path: "{{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh"
mode: '0755'
state: file

- name: Fix shebang line in install.sh
ansible.builtin.shell: |
sed -i '1s/^#\/bin\/bash$/#!\/bin\/bash/' {{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh
- name: Run installation script
command: "echo $EUID && c {{ camera_driver_download_dir }}/tier4-camera-drivers-for-anvil/install.sh"
become: true
become_user: root

- name: Download SDK deb file from public repo
ansible.builtin.uri:
url: "{{ sdk_deb_download_url }}"
Expand All @@ -76,12 +45,21 @@
- name: Setup camera driver and SDK
become: true
block:
- name: Install driver from deb file
ansible.builtin.apt:
deb: "{{ camera_driver_download_dir }}/{{ driver_deb_name }}"
state: present
- name: Post process
ansible.builtin.shell:
cmd: |
/opt/nvidia/jetson-io/config-by-hardware.py -n 2="TIERIV ISX021 GMSL2 Camera Device Tree Overlay"
# noqa no-changed-when
# TODO: check dtb file
- name: Install SDK from deb file
ansible.builtin.apt:
deb: "{{ camera_driver_download_dir }}/{{ sdk_deb_name }}"
state: present
when: sdk_deb_download_url is defined

- name: Setup C1 configuration
block:
Expand Down

0 comments on commit a8b9cac

Please sign in to comment.