Adding generated pciids file

Adding static script from netbootxyz/pciids which is updated
and generated weekly
This commit is contained in:
Antony Messerli
2020-01-05 23:04:40 -06:00
parent 8e36dc776c
commit 3ff282fb71
5 changed files with 7 additions and 60 deletions
+1 -2
View File
@@ -36,8 +36,7 @@ generate_checksums: true
checksums_filename: "{{ site_name }}-sha256-checksums.txt"
# pciids
generate_pciids: true
pciids_url: https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids
pciids_url: https://raw.githubusercontent.com/netbootxyz/pciids/master/pciids.ipxe
# bootloader options
generate_disks: true
-26
View File
@@ -1,26 +0,0 @@
#!/bin/bash
# Used for processing pci.ids into ipxe format
# https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids
if [[ ! -n "$1" || ! -n "$2" ]]; then
echo "Please set PCIIDS file location and PCIIDS output file location..."
echo "pciids_gen pci.ids pciids.ipxe"
exit 1
fi
PCIIDS_FILE=$1
PCIIDS_IPXE=$2
awk ' \
BEGIN { \
print "#!ipxe\ngoto ${vendor}${device} || goto ${vendor} || exit" \
} \
/^[0-9a-f]{4}/ { \
vendor=substr($1,1,4); \
printf ":%s\nset ven %s\nexit\n", vendor, substr($0,7) \
} \
/^\t[0-9a-f]{4}/ { \
printf ":%s%s\nset dev %s\ngoto %s\n", \
vendor, substr($0, 2, 4), substr($0, 8), vendor \
} \
' ${PCIIDS_FILE} > ${PCIIDS_IPXE}
+6 -1
View File
@@ -52,4 +52,9 @@
with_filetree: "templates/menu/"
when: item.state == "file"
tags:
- skip_ansible_lint
- skip_ansible_lint
- name: Retrieve pciids.ipxe
get_url:
url: "{{ pciids_url }}"
dest: "{{ netbootxyz_root }}/pciids.ipxe"
@@ -1,27 +0,0 @@
---
- name: Retrieve pci.ids
get_url:
url: "{{ pciids_url }}"
dest: "{{ netbootxyz_root }}/pci.ids"
- name: Copy pciids_gen script to source dir
copy:
src: pciids_gen
dest: "{{ netbootxyz_root }}/pciids_gen"
mode: 0744
- name: Convert pci.ids to pciids.ipxe
shell: |
./pciids_gen pci.ids pciids.ipxe
args:
chdir: "{{ netbootxyz_root }}"
tags:
- skip_ansible_lint
- name: Cleanup of files no longer needed
file:
path: "{{ item }}"
state: absent
with_items:
- "{{ netbootxyz_root }}/pciids_gen"
- "{{ netbootxyz_root }}/pci.ids"
-4
View File
@@ -3,10 +3,6 @@
when:
- generate_menus | default(true) | bool
- include: generate_pciids.yml
when:
- generate_pciids | default(true) | bool
- include: generate_menus_custom.yml
when:
- custom_generate_menus | default(false) | bool