diff --git a/3rdparty/mmu_man/scripts/HardwareChecker.sh b/3rdparty/mmu_man/scripts/HardwareChecker.sh new file mode 100755 index 0000000000..895594c339 --- /dev/null +++ b/3rdparty/mmu_man/scripts/HardwareChecker.sh @@ -0,0 +1,270 @@ +#!/bin/sh +# HardwareChecker.sh for Haiku +# +# Copyright 2011, François Revol . +# +# Distributed under the MIT License +# +# Created: 2011-10-25 +# + + +netcat=netcat +report_site=haikuware.con +report_cgi=http://haikuware.com/hwreport.php + +start_fake_httpd () +{ + report_port=8989 + report_file="$(finddir B_DESKTOP_DIRECTORY)/hwchecker_report_$$.txt" + report_ack="

OK

" + report_cgi=http://127.0.0.1:$report_port/hwreport + ( + echo "listening on port $report_port" + # + (echo -e "HTTP/1.1 100 Continue\r\n\r\n"; echo -e "HTTP/1.1 200 OK\r\nDate: $(date)\r\nContent-Type: text/html\r\nContent-Length: ${#report_ack}\r\n\r\n$report_ack") | $netcat -q 1 -l -p $report_port > "$report_file" + + open "$report_file" + sleep 1 + alert "A file named $(basename $report_file) has been created on your desktop. You can copy this file to an external drive to submit it with another operating system." "Ok" + ) & +} + +detect_network () +{ + ping -c 1 "$report_site" + if [ "$?" -gt 0 ]; then + alert --stop "Cannot contact the hardware report site ($report_site). +You can continue anyway and generate a local file to submit later on, or try to configure networking." "Cancel" "Configure Network" "Continue" + case "$?" in + 0) + exit 0 + ;; + 1) + /system/preferences/Network + detect_network + ;; + 2) + start_fake_httpd + ;; + *) + exit 1 + ;; + esac + fi +} + +check_pci () +{ + echo "

PCI devices

" + echo "
List ot detected PCI devices. This does not indicate that every probed device is supported by a driver.

" + devn=0 + bus="pci" + vendor='' + device='' + true; + listdev | while read line; do + + case "$line" in + device*) + case "$vendor" in + "") + desc="${line/device /}" + echo "
$desc
" + ;; + *) + devicestr=${line#*:} + device="${line%:*}" + device="${device#device }" + echo "
" + echo "
$vendor:$device $vendorstr:$devicestr
" + descline="$vendor:$device \"$vendorstr\" \"$devicestr\" $desc" + echo "Identification: " + + echo "
" + echo "Status: " + echo "" + echo "" + echo "" + echo "
" + + echo "
" + echo "Is it an add-in card (not part of the motherboard) ? " + echo "" + echo "
" + + echo "
" + echo "Comment: " + echo "" + echo "
" + + echo "
" + + vendor='' + devn=$(($devn+1)) + ;; + esac + ;; + vendor*) + vendorstr=${line#*:} + vendor="${line%:*}" + vendor="${vendor#vendor }" + ;; + *) + ;; + esac + done +} + +check_usb () +{ + echo "

USB devices

" + echo "
List ot detected USB devices. This does not indicate that every probed device is supported by a driver.

" + devn=0 + bus="usb" + listusb | while read vpid dev desc; do + echo "
$desc
" + echo "Identification: " + echo "
" + if [ "$vpid" != "0000:0000" ]; then + enabled=1 + id="" + echo "
" + echo "Status: " + echo "" + echo "" + echo "" + echo "
" + + echo "
" + echo "Is it an external device (not part of the motherboard) ? " + echo "" + echo "
" + + echo "
" + echo "Comment: " + echo "" + echo "
" + + else + echo "(virtual device)" + fi + echo "
" + devn=$(($devn+1)) + done + echo "
" +} + +check_machine () +{ + echo "

Machine

" + echo "Vendor: " + echo "
" + echo "Model: " + echo "
" + echo "Specification page: " + echo "
" + echo "Comments:
" + echo "" + echo "
" +} + +check_haiku () +{ + echo "

Haiku

" + uname_r="$(uname -r)" + uname_v="$(uname -v)" + echo "Release: " + echo "
" + echo "Version: " + echo "
" + echo "Comments:
" + echo "" + echo "
" +} + +check_utils () +{ + echo "

Utilities output

" + echo "The output of some system utilities gives precious informations on the processor model and other stuff..." + + echo "

sysinfo

" + echo "(system info)
" + echo "" + + echo "

listimage 1

" + echo "(list of loaded kernel drivers)
" + echo "" + + echo "

ifconfig

" + echo "(list of network interfaces)
" + echo "" + + echo "

installoptionalpackage -l

" + echo "(list of installed packaged)
" + echo "" + + echo "
" +} + +check_syslog () +{ + echo "

System log

" + echo "
Part of the system boot log that could help developer understand why some devices are not recognized...
" + echo "" + +} + +check_sender () +{ + echo "

Sender info (optional)

" + echo "Name: " + echo "
" + echo "Mail: " + echo "
" + echo "Other comments:
" + echo "" + echo "
" +} + +check_all () +{ + echo "" + echo "Hardware report" + echo "" + echo "
" + + check_pci + check_usb + check_haiku + check_utils + check_syslog + check_sender + + echo "
Note: this form will only send data that is visible on this page.
" + + echo "" + + echo "
" + echo "" + echo "" +} + +tf=/tmp/hw_checker_$$.html + +detect_network + +check_all > "$tf" + +open "$tf" +