1
0

Modified intel-gpu-info to not require lspci

Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
James Ketrenos 2019-11-11 10:54:31 -08:00
parent 82aba14ec6
commit 8a9be3721e
3 changed files with 18 additions and 14 deletions

View File

@ -73,13 +73,10 @@ RUN apt-get -q update \
#
# NOTE: We use DEBIAN_FRONTEND=noninteractive to prevent krb5-user from
# trying to prompt for configuration details during install.
#
# pciutils is needed for lspci used by assets/intel-gpu-info
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -q \
locales \
software-properties-common \
pciutils
software-properties-common
# Set up locales
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8

View File

@ -265,14 +265,24 @@ devices+=(0x4551 "ehl_4x4" "Intel(R) HD Graphics (Elkhart Lake 4x4)")
devices+=(0x4541 "ehl_2x4" "Intel(R) HD Graphics (Elkhart Lake 2x4)")
count=${#devices[*]}
found=0
for id in $(lspci -n | sed -nE 's,^.*8086:([a-f0-9]*).*$,0x\U\1,pg'); do
device=0
while (( ${device} < ${count} )); do
(( "${devices[$device]}" == "$id" )) && {
echo "${devices[$((device+2))]}"
intel_devices=($({
find -L /sys/bus/pci/devices -maxdepth 2 -name vendor |
while read vendor; do
[[ "$(cat ${vendor})" == "0x8086" ]] && {
device=$(cat ${vendor/vendor/device})
echo "${device}"
}
done
} | sort -u))
for device in ${intel_devices[@]}; do
index=0
while (( ${index} < ${count} )); do
(( "${devices[${index}]}" == "${device}" )) && {
echo "${devices[$((index+2))]}"
found=1
}
device=$((device+3))
index=$((index+3))
done
done

View File

@ -4,13 +4,10 @@
#
# NOTE: We use DEBIAN_FRONTEND=noninteractive to prevent krb5-user from
# trying to prompt for configuration details during install.
#
# pciutils is needed for lspci used by assets/intel-gpu-info
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -q \
locales \
software-properties-common \
pciutils
software-properties-common
# Set up locales
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8