IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   GNU, Linux ve UNIX (https://www.ircforumlari.net/gnu-linux-ve-unix/)
-   -   pci device bulma betiği .sh (https://www.ircforumlari.net/gnu-linux-ve-unix/500868-pci-device-bulma-betigi-sh.html)

ufukcingay 17 Ağustos 2012 01:09

pci device bulma betiği .sh
 
#!/bin/bash

# Simple PCI module finder
# Checks the system and prints the possible modules for PCI
# devices. It DOES NOT install them

# pci-modules.sh
# Written by Dennis Leeuw
# (c) 2003, 2004, License GPL version 2.0 or later
# Version 1.1.0

# Set all vars
LSPCI="/usr/bin/lspci"
UNAME="/bin/uname"
KERNEL_VERSION=`${UNAME} -r`

PCI_LIST=`$LSPCI -n 2>/dev/null`
IFS=$'\n'

for LINE in ${PCI_LIST}; do
SLOT=${LINE%% Class*}
SLOT=${SLOT#0000:}
SLOT_ENTRY=`$LSPCI -s ${SLOT} 2>/dev/null`
SLOT_ENTRY=${SLOT_ENTRY#*: }

CLASS=${LINE#*Class }
CLASS_NUM=${CLASS%%:*}

PCIMAP_DEVICE=${CLASS##*:}
PCIMAP_DEVICE=${PCIMAP_DEVICE%% *}
PCIMAP_VENDOR=${CLASS%:*}
PCIMAP_VENDOR=${PCIMAP_VENDOR##* }

# Make 8 byte address
for (( I=${#PCIMAP_DEVICE}; $I < 8; I=$(($I+1)) )); do
PCIMAP_DEVICE="0${PCIMAP_DEVICE}"
done
for (( I=${#PCIMAP_VENDOR}; $I < 8; I=$(($I+1)) )); do
PCIMAP_VENDOR="0${PCIMAP_VENDOR}"
done

# Make Hex
PCIMAP_DEVICE="0x${PCIMAP_DEVICE}"
PCIMAP_VENDOR="0x${PCIMAP_VENDOR}"

# Find module
MODULES=`cat /lib/modules/${KERNEL_VERSION}/modules.pcimap | grep ${PCIMAP_VENDOR} | grep ${PCIMAP_DEVICE} | awk '{print $1}'`
if [ "x$MODULES" != "x" ]; then
echo "Setting up $SLOT_ENTRY"

for MODULE in $MODULES; do
echo $MODULE
done
fi
done


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 10:07.

Powered by vBulletin® Version 3.8.8 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2024 IRCForumlari.Net