From: Jean Guyader Date: Wed, 16 Sep 2009 09:40:38 +0000 (+0100) Subject: [xenclient/skeleton] Rename bugtool to status-report. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1fb2413029b268bf14db4e6a70301911c533a52a;p=xenclient%2Fbuild.git [xenclient/skeleton] Rename bugtool to status-report. --- diff --git a/target/generic/target_xenclient_skeleton/usr/bin/bugtool b/target/generic/target_xenclient_skeleton/usr/bin/bugtool deleted file mode 100755 index a5f16c5..0000000 --- a/target/generic/target_xenclient_skeleton/usr/bin/bugtool +++ /dev/null @@ -1,90 +0,0 @@ -#! /bin/sh -e - -name="`basename $0`" -d="`date "+%Y%m%d%H%M%S"`" - -saved_tarball="/tmp/$name/$name-$d.tar.bz2" -base_path="`dirname "$saved_tarball"`/`basename "$saved_tarball" .tar.bz2`" - -files="" - -welcome() -{ -cat < @: - ftpput - -The logs may contain private information, and if you are at all -worried about that, you should exit now, or you should explicitly -exclude those logs from the archive. - -EOF -} - -archive() -{ - local out="$1" - local files="$2" - - tar -cfO $files | bzip2 -z -c > "$out" -} - -save_file() -{ - local save_path="$1" - local save_file="$2" - local save_out="$3" - - cd "$save_path" - archive "${base_path}/${save_out}.tar.bz2" $save_file > ${base_path}/${name}.log 2>&1 - files="$files ${save_out}.tar.bz2" - cd - > /dev/null -} - -save_out() -{ - local save_out_cmd="$1" - local save_out_out="$2" - - $save_out_cmd > "${base_path}/${save_out_out}.log" 2>&1 - files="$files ${save_out_out}.log" -} - -bugtool_file() -{ - local base="$1" - - cd "${base_path}" - archive "${saved_tarball}" "$files ${name}.log" - cd - > /dev/null - rm -rf "${base_path}" -} - -welcome - -mkdir -p "${base_path}" -save_file "/var/log" "messages*" "syslog" -save_file "/config/vms" "*" "vms" -save_file "/var/log" "xenstored-access*" "xenstored-access" -save_file "/tmp" "xenmgr-xenvm*" "xenmgr-xenvm" -save_out "dmesg" "dmesg" -save_out "xenops dmesg" "xen_dmesg" -save_out "dmidecode" "dmidecode" -save_out "xenops list" "xenops_list" -save_out "brctl show" "brctl_show" -save_out "ifconfig" "ifconfig" -bugtool_file "/tmp/$name/$name-$d" -sync - -echo "Writing tarball ${saved_tarball} successful." diff --git a/target/generic/target_xenclient_skeleton/usr/bin/status-report b/target/generic/target_xenclient_skeleton/usr/bin/status-report deleted file mode 120000 index 216ca54..0000000 --- a/target/generic/target_xenclient_skeleton/usr/bin/status-report +++ /dev/null @@ -1 +0,0 @@ -bugtool \ No newline at end of file diff --git a/target/generic/target_xenclient_skeleton/usr/bin/status-report b/target/generic/target_xenclient_skeleton/usr/bin/status-report new file mode 100755 index 0000000..a5f16c5 --- /dev/null +++ b/target/generic/target_xenclient_skeleton/usr/bin/status-report @@ -0,0 +1,90 @@ +#! /bin/sh -e + +name="`basename $0`" +d="`date "+%Y%m%d%H%M%S"`" + +saved_tarball="/tmp/$name/$name-$d.tar.bz2" +base_path="`dirname "$saved_tarball"`/`basename "$saved_tarball" .tar.bz2`" + +files="" + +welcome() +{ +cat < @: + ftpput + +The logs may contain private information, and if you are at all +worried about that, you should exit now, or you should explicitly +exclude those logs from the archive. + +EOF +} + +archive() +{ + local out="$1" + local files="$2" + + tar -cfO $files | bzip2 -z -c > "$out" +} + +save_file() +{ + local save_path="$1" + local save_file="$2" + local save_out="$3" + + cd "$save_path" + archive "${base_path}/${save_out}.tar.bz2" $save_file > ${base_path}/${name}.log 2>&1 + files="$files ${save_out}.tar.bz2" + cd - > /dev/null +} + +save_out() +{ + local save_out_cmd="$1" + local save_out_out="$2" + + $save_out_cmd > "${base_path}/${save_out_out}.log" 2>&1 + files="$files ${save_out_out}.log" +} + +bugtool_file() +{ + local base="$1" + + cd "${base_path}" + archive "${saved_tarball}" "$files ${name}.log" + cd - > /dev/null + rm -rf "${base_path}" +} + +welcome + +mkdir -p "${base_path}" +save_file "/var/log" "messages*" "syslog" +save_file "/config/vms" "*" "vms" +save_file "/var/log" "xenstored-access*" "xenstored-access" +save_file "/tmp" "xenmgr-xenvm*" "xenmgr-xenvm" +save_out "dmesg" "dmesg" +save_out "xenops dmesg" "xen_dmesg" +save_out "dmidecode" "dmidecode" +save_out "xenops list" "xenops_list" +save_out "brctl show" "brctl_show" +save_out "ifconfig" "ifconfig" +bugtool_file "/tmp/$name/$name-$d" +sync + +echo "Writing tarball ${saved_tarball} successful."