tools: intel_gpu_abrt "get" function

A function to make it easy to collect any file or directory needed later.
This commit is contained in:
Rodrigo Vivi 2012-12-13 14:11:21 -02:00 committed by Daniel Vetter
parent a2452d68a0
commit 7150a04124

View File

@ -1,5 +1,13 @@
#!/bin/sh #!/bin/sh
get(){
if [ ! -e $tardir/${@:$#} ] ; then
mkdir -p $tardir/${@:$#}
fi
if [ -e $1 ] ; then
cp -a ${@:1:$#-1} $tardir/${@:$#} 2>/dev/null
fi
}
if [ -d /debug/dri ] ; then if [ -d /debug/dri ] ; then
debugfs_path=/debug_dri debugfs_path=/debug_dri
fi fi
@ -25,15 +33,15 @@ tmpdir=`mktemp -d`
tardir=$tmpdir/intel_gpu_abrt tardir=$tmpdir/intel_gpu_abrt
mkdir $tardir mkdir $tardir
mkdir $tardir/debugfs get $i915_debugfs/* debugfs
cp $i915_debugfs/* $tardir/debugfs
mkdir $tardir/mod_opts get /sys/module/i915/parameters/* mod_opts
cp /sys/module/i915/parameters/* $tardir/mod_opts
mkdir $tardir/X mkdir $tardir/X
cp /var/log/Xorg.*.log $tardir/X get /var/log/Xorg.0.log X
cp /etc/X11/xorg.conf $tardir/X get /var/log/Xorg.0.log.old X
get /etc/X11/xorg.conf X
get /etc/X11/xorg.conf.d/ X
dmesg > $tardir/dmesg dmesg > $tardir/dmesg
lspci -nn > $tardir/lspci lspci -nn > $tardir/lspci