-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoshiba-s50-b131-setup.sh
executable file
·118 lines (98 loc) · 2.62 KB
/
toshiba-s50-b131-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
# encoding: utf-8
source snackk.conf
to_install=4;
##################################################
# TOSHIBA-S50-B131-INSTALLATION #
##################################################
HARDWARE_PKGS='aic94xx-firmware wd719x-firmware'
DISPLAY_DRIVERS='xf86-video-intel xf86-input-libinput'
function install_yaourt
{
ERR=0
# Installing yaourt
print_pretty_header "Installing yaourt"
echo -e $ROOT_PASSWD | sudo -s << EOF
cd /tmp 1>/dev/null || ERR=1
git clone https://aur.archlinux.org/yaourt.git --depth=1 1>/dev/null || ERR=1
cd yaourt/ 1>/dev/null || ERR=1
makepkg -si --noconfirm 1>/dev/null || ERR=1
cd ~ 1>/dev/null || ERR=1
EOF
if [[ $ERR -eq 1 ]]; then
echo "Installing yaourt error."
exit 1
else
let success+=1;
fi
}
function install_yay
{
ERR=0
# Installing yay
print_pretty_header "Installing yay"
echo -e $ROOT_PASSWD | sudo -s << EOF
cd /tmp 1>/dev/null || ERR=1
git clone https://aur.archlinux.org/yay.git --depth=1 1>/dev/null || ERR=1
cd yay/ 1>/dev/null || ERR=1
sudo -i -u $USERN makepkg -si --noconfirm 1>/dev/null || ERR=1
cd ~ 1>/dev/null || ERR=1
EOF
if [[ $ERR -eq 1 ]]; then
echo "Installing yay error."
exit 1
else
let success+=1;
fi
}
function display_drivers
{
ERR=0
# Intalling display drivers
print_pretty_header "Installing${NC} $DISPLAY_DRIVERS"
pacman -S `echo $DISPLAY_DRIVERS` --noconfirm 1>/dev/null || ERR=1
if [[ $ERR -eq 1 ]]; then
echo "Installing display drivers error."
exit 1
else
let success+=1;
fi
}
function blacklist_speaker
{
ERR=0
# Supress anoying beep
print_pretty_header "Blacklisting speaker"
echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf || ERR=1
if [[ $ERR -eq 1 ]]; then
echo "Blacklist error."
exit 1
else
let success+=1;
fi
}
function missing_hardware_dependecies
{
ERR=0
# Downloading Hardware dependencies
print_pretty_header "Installing${NC} $HARDWARE_PKGS"
sudo -i -u $USERN yaourt -S `echo $HARDWARE_PKGS` --noconfirm 1>/dev/null || ERR=1
print_pretty_header "Resetting initial ramdisk"
echo -e $ROOT_PASSWD | sudo -S mkinitcpio -p linux || ERR=1
if [[ $ERR -eq 1 ]]; then
echo "Hardware dependencies error."
exit 1
else
let success+=1;
fi
}
##################################################
# Script #
##################################################
#install_yaourt
install_yay
display_drivers
blacklist_speaker
missing_hardware_dependecies
print_results
print_line