this script will have to be run as root.
it will ask the user, if the user is satisfied with linux running on this hardware, can even give a comment, then it tries to detect the model of one’s motherboard, and one new folders and two sub folders in it in the root home directory:
/root/hardware_supported/Gigabyte Technology Co., Ltd./very_well/P35-DS3.txt
(click on link above to see example output)
vim /scripts/hardware_detection.sh
#!/bin/bash # this script basically asks the user, if he is happy with the hardware-support of the currently running linux # it then writes this to a log file in the format of ~/hardware_support/MotherBoardManufacturer/MotherBoardLevel.txt cd ~; mkdir hardware_supported; cd hardware_supported; # create folder for every brand/vendor MOBOMANUFACTURER=$(dmidecode -s "baseboard-manufacturer") mkdir "$MOBOMANUFACTURER"; cd "$MOBOMANUFACTURER"; echo "============ MOBOMANUFACTURER": $MOBOMANUFACTURER; PS3='How well is your hardware supported?' WELLNESS="none"; options=("very_well" "okay" "not_good" "Quit") select opt in "${options[@]}" do case $opt in "very_well") WELLNESS="very_well"; mkdir very_well; cd very_well; break; ;; "okay") WELLNESS="okay"; mkdir okay; cd okay; break; ;; "not_good") WELLNESS="not_good"; mkdir not_good; cd not_good; break; ;; "Quit") break ;; *) echo invalid option;; esac done PS3='Are you happy with the working-speed?' SPEED="none"; options=("very_well" "okay" "not_good" "Quit") select opt in "${options[@]}" do case $opt in "very_well") SPEED="very_well"; break; ;; "okay") SPEED="okay"; break; ;; "not_good") SPEED="not_good"; break; ;; "Quit") break ;; *) echo invalid option;; esac done MOBOMODEL=$(dmidecode -s "baseboard-product-name"); echo "======== MOTHERBOARD MODEL" >> $MOBOMODEL.txt; echo $MOBOMODEL >> $MOBOMODEL.txt; dmidecode | grep -A 3 "baseboard" >> $MOBOMODEL.txt; MOBOMODEL=$MOBOMODEL.txt; echo "======== HAPPYNESS WITH HARDWARE SUPPORT" >> $MOBOMODEL; echo $WELLNESS >> $MOBOMODEL; echo "======== OS VERSION AND KERNEL" >> $MOBOMODEL; echo $(uname -a) >> $MOBOMODEL; cat /etc/debian_version >> $MOBOMODEL; echo "======== WORKING-SPEED" >> $MOBOMODEL; echo $SPEED >> $MOBOMODEL; echo "======== ANY COMMENTS?" >> $MOBOMODEL; read -e -p "======== ANY COMMENTS?" COMMENT; echo $COMMENT >> $MOBOMODEL; DATE=$(date +%Y-%m-%d) echo "======== DATE" $DATE >> $MOBOMODEL; echo "======== lscpu" >> $MOBOMODEL; lscpu >> $MOBOMODEL; echo "======== lspci" >> $MOBOMODEL; lspci >> $MOBOMODEL; echo "======== GET INFO ABOUT RAM MODULES SIZE AND NUMBERS dmidecode -t 17" >> "$MOBOMODEL"; dmidecode -t 17 >> "$MOBOMODEL"; echo "======== dmesg" >> "$MOBOMODEL"; dmesg >> "$MOBOMODEL";
liked this article?
- only together we can create a truly free world
- plz support dwaves to keep it up & running!
- (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
- really really hate advertisement
- contribute: whenever a solution was found, blog about it for others to find!
- talk about, recommend & link to this blog and articles
- thanks to all who contribute!