Fix usb ports on cubox-m
This commit is contained in:
9
ansible-5/roles/common/files/fix_usb/fix_usb.service
Normal file
9
ansible-5/roles/common/files/fix_usb/fix_usb.service
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Additional config to start USB ports
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/sh -c "echo 7 > /sys/class/gpio/export;echo out > /sys/class/gpio/gpio7/direction;echo 1 > /sys/class/gpio/gpio7/value"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
24
ansible-5/roles/common/tasks/fix_usb.yml
Normal file
24
ansible-5/roles/common/tasks/fix_usb.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
#https://community.solid-run.com/t/cubox-m-quad-not-powering-usb-devices/181/6
|
||||||
|
#
|
||||||
|
#- name: debug variables
|
||||||
|
# ansible.builtin.debug:
|
||||||
|
# var: ansible_facts
|
||||||
|
# when: inventory_hostname == "cubox-m"
|
||||||
|
|
||||||
|
|
||||||
|
# create service file
|
||||||
|
- name: add fix_usb service
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "fix_usb/fix_usb.service"
|
||||||
|
dest: /etc/systemd/system/fix_usb.service
|
||||||
|
mode: '0644'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
# start service
|
||||||
|
- name: Enable service httpd and ensure it is not masked
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: fix_usb
|
||||||
|
enabled: yes
|
||||||
|
masked: no
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
cache_valid_time: 3600
|
cache_valid_time: 3600
|
||||||
|
update_cache_retries: 10
|
||||||
|
update_cache_retry_max_delay: 20
|
||||||
|
|
||||||
- name: Install required packages
|
- name: Install required packages
|
||||||
apt:
|
apt:
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
- name: update login screen
|
- name: update login screen
|
||||||
include_tasks: motd.yml
|
include_tasks: motd.yml
|
||||||
|
|
||||||
|
- name: fix usb
|
||||||
|
include_tasks: fix_usb.yml
|
||||||
|
when: inventory_hostname == "cubox-m"
|
||||||
|
|
||||||
- name: update fstab
|
- name: update fstab
|
||||||
include_tasks: update_fstab.yml
|
include_tasks: update_fstab.yml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user