Last active
December 20, 2015 18:19
-
-
Save robinsmidsrod/6175108 to your computer and use it in GitHub Desktop.
Dynamically loading PCI information with iPXE scripting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ipxe | |
set spaces:hex 20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20 | |
clear addr | |
:load pciscan addr || goto load_done | |
set vendor ${pci/${addr}.0.2} | |
set device ${pci/${addr}.2.2} | |
chain -a pci/${vendor}.ipxe || | |
chain -a pci/${vendor}/${device}.ipxe || | |
goto load | |
:load_done | |
clear addr | |
:scan pciscan addr || goto scan_done | |
set vendor ${pci/${addr}.0.2} | |
set device ${pci/${addr}.2.2} | |
echo ${addr:busdevfn}: ${vendor}:${device} ${ven/${vendor}} | |
isset ${dev/${vendor}${device}} && echo ${spaces:string} ${dev/${vendor}${device}} || | |
goto scan | |
:scan_done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment