-
Notifications
You must be signed in to change notification settings - Fork 25
Add support for usbip needed for virtual passkey #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| - name: Install EPEL repository | ||
| dnf: | ||
| state: present | ||
| name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm' | ||
| disable_gpg_check: yes | ||
| when: extended_packageset | ||
|
|
||
| - name: Install packages for usbip needed for virtual passkey testing | ||
| dnf: | ||
| state: present | ||
| name: | ||
| - gcc | ||
| - make | ||
| - automake | ||
| - autoconf | ||
| - systemd-devel | ||
| - libtool | ||
| when: | ||
| - passkey_support | ||
| - "'base_client' in group_names or 'client' in group_names" | ||
|
|
||
| - name: 'Packages are the same as in Fedora' | ||
| include_tasks: 'Fedora.yml' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| test_venv: /opt/test_venv | ||
| #kver: "{{ ansible_kernel | regex_replace('\\.[^.]*$', '') }}" | ||
| kver: "{{ ansible_kernel | regex_replace('\\.' + ansible_architecture + '$', '') }}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| - name: Create temporary build directory | ||
| tempfile: | ||
| state: directory | ||
| suffix: usbip_build | ||
| register: build_dir | ||
|
|
||
| - name: Ensure Koji config directory exists | ||
| file: | ||
| path: "~/.koji/config.d" | ||
| state: directory | ||
| mode: '0755' | ||
|
|
||
| - name: Configure CentOS Stream Koji profile | ||
| copy: | ||
| dest: "~/.koji/config.d/centos-stream.conf" | ||
| content: | | ||
| [centos-stream] | ||
| server = https://kojihub.stream.centos.org/kojihub | ||
| topurl = https://kojihub.stream.centos.org/kojifiles | ||
|
|
||
| - name: Download Kernel Source RPM via Koji | ||
| command: | ||
| cmd: "koji --profile centos-stream download-build --arch=src kernel-{{ kver }}" | ||
| chdir: "{{ build_dir.path }}" | ||
| args: | ||
| creates: "{{ build_dir.path }}/kernel-{{ kver }}.src.rpm" | ||
|
|
||
| - name: Extract Source RPM and Kernel Tarball | ||
| shell: | | ||
| set -ex | ||
| rpm2cpio kernel-{{ kver }}.src.rpm | cpio -id | ||
| xz -dc linux-{{ kver }}.tar.xz | tar xf - | ||
| args: | ||
| chdir: "{{ build_dir.path }}" | ||
| creates: "{{ build_dir.path }}/linux-{{ kver }}/tools/usb/usbip/configure" | ||
|
|
||
| - name: Build and Install USBIP tools | ||
| shell: | | ||
| set -ex | ||
| ./autogen.sh | ||
| ./configure | ||
| make install | ||
| args: | ||
| chdir: "{{ build_dir.path }}/linux-{{ kver }}/tools/usb/usbip/" | ||
| creates: "/usr/local/sbin/usbip" | ||
|
|
||
| - name: Create symlink for usbip | ||
| file: | ||
| src: /usr/local/sbin/usbip | ||
| dest: /usr/sbin/usbip | ||
| state: link |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Placeholder for Fedora specific passkey test deps |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| - name: Create temporary build directory | ||
| tempfile: | ||
| state: directory | ||
| suffix: usbip_build | ||
| register: build_dir | ||
|
|
||
| - name: Ensure Koji config directory exists | ||
| file: | ||
| path: "~/.koji/config.d" | ||
| state: directory | ||
| mode: '0755' | ||
|
|
||
| - name: Configure CentOS Stream Koji profile | ||
| copy: | ||
| dest: "~/.koji/config.d/centos-stream.conf" | ||
| content: | | ||
| [centos-stream] | ||
| server = https://kojihub.stream.centos.org/kojihub | ||
| topurl = https://kojihub.stream.centos.org/kojifiles | ||
|
|
||
| - name: Download Kernel Source RPM via Koji | ||
| command: | ||
| cmd: "koji --profile centos-stream download-build --arch=src kernel-{{ kver }}" | ||
| chdir: "{{ build_dir.path }}" | ||
| args: | ||
| creates: "{{ build_dir.path }}/kernel-{{ kver }}.src.rpm" | ||
|
|
||
| - name: Extract Source RPM and Kernel Tarball | ||
| shell: | | ||
| set -ex | ||
| rpm2cpio kernel-{{ kver }}.src.rpm | cpio -id | ||
| xz -dc linux-{{ kver }}.tar.xz | tar xf - | ||
| args: | ||
| chdir: "{{ build_dir.path }}" | ||
| creates: "{{ build_dir.path }}/linux-{{ kver }}/tools/usb/usbip/configure" | ||
|
|
||
| - name: Build and Install USBIP tools | ||
| shell: | | ||
| set -ex | ||
| ./autogen.sh | ||
| ./configure | ||
| make install | ||
| args: | ||
| chdir: "{{ build_dir.path }}/linux-{{ kver }}/tools/usb/usbip/" | ||
| creates: "/usr/local/sbin/usbip" | ||
|
|
||
| - name: Create symlink for usbip | ||
| file: | ||
| src: /usr/local/sbin/usbip | ||
| dest: /usr/sbin/usbip | ||
| state: link | ||
|
Comment on lines
+1
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The temporary build directory created by - name: Build and install usbip from source
block:
- name: Create temporary build directory
tempfile:
state: directory
suffix: usbip_build
register: build_dir
- name: Ensure Koji config directory exists
file:
path: "~/.koji/config.d"
state: directory
mode: '0755'
- name: Configure CentOS Stream Koji profile
copy:
dest: "~/.koji/config.d/centos-stream.conf"
content: |
[centos-stream]
server = https://kojihub.stream.centos.org/kojihub
topurl = https://kojihub.stream.centos.org/kojifiles
- name: Download Kernel Source RPM via Koji
command:
cmd: "koji --profile centos-stream download-build --arch=src kernel-{{ kver }}"
chdir: "{{ build_dir.path }}"
args:
creates: "{{ build_dir.path }}/kernel-{{ kver }}.src.rpm"
- name: Extract Source RPM and Kernel Tarball
shell: |
set -ex
rpm2cpio kernel-{{ kver }}.src.rpm | cpio -id
xz -dc linux-{{ kver }}.tar.xz | tar xf -
args:
chdir: "{{ build_dir.path }}"
creates: "{{ build_dir.path }}/linux-{{ kver }}/tools/usb/usbip/configure"
- name: Build and Install USBIP tools
shell: |
set -ex
./autogen.sh
./configure
make install
args:
chdir: "{{ build_dir.path }}/linux-{{ kver }}/tools/usb/usbip/"
creates: "/usr/local/sbin/usbip"
- name: Create symlink for usbip
file:
src: /usr/local/sbin/usbip
dest: /usr/sbin/usbip
state: link
always:
- name: Clean up temporary build directory
file:
path: "{{ build_dir.path }}"
state: absent
when: build_dir.path is defined
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it may be better to leave the directory behind for debugging in the event that something fails. I'll be looking for more input on this one though. |
||
Uh oh!
There was an error while loading. Please reload this page.