Page MenuHomePhabricator

nvapeek-lookup.sh
ActivePublic

Authored by pmoreau on Sep 2 2015, 2:37 AM.
if [[ -z "${CARD}" ]]; then
CARD='0'
fi
chipset=$(nvalist | head -$((${CARD} + 1)) | tail -1 | cut -d\ -f3)
nvapeek -c"${CARD}" $1 $2 | while read line; do
reg=$(echo $line | cut -d: -f1)
if [ ! "$reg" == "..." ]; then
for i in {2..5}; do
value=$(echo $line | cut -d\ -f$i)
if [ ! "$value" == "00000000" ]; then
reg_new=$(python -c print\(hex\(0x$reg+0x4*\($i-2\)\)\))
printf "$reg $value "
lookup -a"${chipset}" $reg_new $value
fi
done
fi
done

Event Timeline

pmoreau changed the title of this paste from untitled to nvapeek-lookup.
pmoreau updated the paste's language from autodetect to autodetect.
pmoreau changed the visibility from "All Users" to "Public (No Login Required)".
pmoreau changed the edit policy from "All Users" to "Nouveau (Project)".
pmoreau added a project: Nouveau.
pmoreau changed the title of this paste from nvapeek-lookup to nvapeek-lookup.sh.
pmoreau updated the paste's language from autodetect to bash.