So, I need your help collecting (bash) scripts you use after a clean install of LMDE.
It does not have to be fancy, just for me to know what is needed and what is the logic behind it (step-by-step).
The following is important to know:
- What hardware (check with lspci): name, chipset, anything that matters.
- Detailed description of the steps you take to install the drivers.
Nvidia and ATI drivers
Code: Select all
#!/bin/bash
# Install Nvidia/ATI drivers on Debian
# Script date: 21/8/2012 - Schoelje (schoelje@hotmail.nl)
# Be root to run this script
if [ $UID -ne 0 ]; then
echo "Login as root."
su -c "$0 $@"
exit
fi
LINE="=================================================="
# Get the hardware
CARD=`lspci | grep VGA`
CARD=${CARD#*: }
if [[ "$CARD" =~ "NVIDIA" ]]; then
echo $LINE
echo "This script installs the appropriate Nvidia drivers"
echo $LINE
read -e -p "Continue? [y/n] (default=n): " ANSWER
case $ANSWER in
y|Y|yes|YES|Yes)
echo
echo "Found graphics controller: $CARD"
# Install nvidia-detect if it is not installed yet
NVDET=`apt search nvidia-detect | grep ^i`
if [ -z "$NVDET" ]; then
echo
echo "Install nvidia-detect to detect the needed drivers"
apt-get -y install nvidia-detect
fi
# Get the right drivers for the card
NVDRV=`nvidia-detect | grep nvidia- | tr -d ' '`
if [ -z "$NVDRV" ]; then
echo
echo "Error: Cannot detect the needed driver."
exit
fi
# Install drivers
case $NVDRV in
nvidia-glx)
DRVINST=`apt search ^nvidia-glx | grep ^i`
if [ -n "$DRVINST" ]; then
echo "Removing old Nvidia drivers..."
echo $LINE
apt-get remove nvidia-kernel-dkms nvidia-glx
echo
fi
echo "Installing Nvidia drivers..."
echo $LINE
apt-get install nvidia-kernel-dkms nvidia-glx build-essential nvidia-settings nvidia-xconfig
;;
nvidia-glx-legacy-96xx)
DRVINST=`apt search ^nvidia-glx-legacy-96xx | grep ^i`
if [ -n "$DRVINST" ]; then
echo "Removing old Nvidia legacy-96xx drivers..."
echo $LINE
apt-get remove nvidia-kernel-legacy-96xx-dkms nvidia-glx-legacy-96xx
echo
fi
echo "Installing Nvidia legacy-96xx drivers..."
echo $LINE
apt-get install nvidia-kernel-legacy-96xx-dkms nvidia-glx-legacy-96xx build-essential nvidia-settings nvidia-xconfig
;;
nvidia-glx-legacy-173xx)
DRVINST=`apt search ^nvidia-glx-legacy-173xx | grep ^i`
if [ -n "$DRVINST" ]; then
echo "Removing old Nvidia legacy-173xx drivers..."
echo $LINE
apt-get remove nvidia-kernel-legacy-173xx-dkms nvidia-glx-legacy-173xx
echo
fi
echo "Installing Nvidia legacy-173xx drivers..."
echo $LINE
apt-get install nvidia-kernel-legacy-173xx-dkms nvidia-glx-legacy-173xx build-essential nvidia-settings nvidia-xconfig
;;
*)
echo "Your Nvidia card driver cannot be determined."
echo "Press ENTER to exit"
read
exit
esac
echo
echo $LINE
echo "Configure Nvidia and blacklist Nouveau"
echo $LINE
nvidia-xconfig
echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nouveau.conf
;;
*)
echo "User abort"
esac
elif [[ "$CARD" =~ "ATI" ]]; then
# The series 2000, 3000 and 4000 are not supported anymore
# Users affected by this should switch to the free radeon driver: xserver-xorg-video-radeon
STARTSERIE=5000
# Split the card string into separate words and check for the Radeon series
IFS=" "
set $CARD
i=0
for ITEM
do
# Is it a number?
if [[ "$ITEM" == ?(+|-)+([0-9]) ]]; then
# Is the number between 1000 and STARTSERIE?
if [ $ITEM -gt 1000 ] && [ $ITEM -lt $STARTSERIE ]; then
echo $LINE
echo "Your card with chip set $ITEM is not supported anymore"
echo $LINE
# Install xserver-xorg-video-radeon if it is not installed yet (it should be)
RAD=`apt search xserver-xorg-video-radeon | grep ^i`
if [ -z "$RAD" ]; then
echo
echo "Installing default Radeon driver xserver-xorg-video-radeon"
echo $LINE
apt-get -y install xserver-xorg-video-radeon
fi
exit
fi
fi
((i++))
done
echo $LINE
echo "This script installs the appropriate ATI drivers"
echo $LINE
read -e -p "Continue? [y/n] (default=n): " ANSWER
case $ANSWER in
y|Y|yes|YES|Yes)
echo
echo $LINE
echo "Get fglrx from sid repositories (not available in wheezy)"
echo $LINE
echo "deb http://ftp.us.debian.org/debian sid main contrib non-free" > /etc/apt/sources.list.d/debsid.list
apt-get update
apt-get install build-essential module-assistant fglrx-control fglrx-driver --reinstall
rm /etc/apt/sources.list.d/debsid.list
apt-get update
echo
echo $LINE
echo "Create xorg.conf"
echo $LINE
aticonfig --initial
;;
*)
echo "User abort"
esac
fi
Code: Select all
#!/bin/bash
# Install Broadcom STA drivers
# Script date: 21/8/2012 - Schoelje (schoelje@hotmail.nl)
# Be root to run this script
if [ $UID -ne 0 ]; then
echo "Login as root."
su -c "$0 $@"
exit
fi
# Fill an array with chip sets to check
CHIPS=( 4311 4312 4313 4321 4322 43224 43225 )
LINE="=================================================="
# Get the hardware
CARD=`lspci | grep Wireless`
CARD=${CARD#*: }
# Check if it's Braodcom
if [[ "$CARD" =~ "Broadcom" ]]; then
# Check for all chip sets in the array
FOUND=0
for CHIP in "${CHIPS[@]}"
do
if [[ "$CARD" =~ "$CHIP" ]]; then
# Install drivers
echo $LINE
echo "This script installs the Broadcom STA drivers for chipset $CHIP"
echo $LINE
read -e -p "Continue? [y/n] (default=n): " ANSWER
case $ANSWER in
y|Y|yes|YES|Yes)
apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
modprobe -r b44 b43 b43legacy ssb brcmsmac
modprobe wl
iwconfig
FOUND=1
;;
*)
echo "User abort"
;;
esac
fi
done
if [ ! $FOUND ]; then
echo "Your Broadcom chipset is not supported by this script"
fi
fi