#!/bin/bash

dir=$(date "+%Y%m%d%T")
path=/root/pcie-test

mkdir $path/$dir
if [[ $? != 0 ]]; then echo "mkdir $path/$dir failed" ; exit 1 ; fi
cd $path/$dir
prtconf -dD >& prtconf.txt
cfgadm -alv >& cfgadm.txt
/usr/lib/fm/fmd/fmtopo -V >& fmtopo.txt
/usr/lib/pci/pcieadm show-devs >& show-devs.txt
mkdir $path/$dir/cfgspace
/usr/lib/pci/pcieadm save-cfgspace -a $path/$dir/cfgspace
