forked from stockmind/dell-xps-9560-ubuntu-respin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·94 lines (85 loc) · 2.2 KB
/
build.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
#!/bin/bash
ISOFILE=$1
KERNEL=$2
KERNELVERSION=$3
KERNELARGS=" -u "
# Parse ARGS
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-k|--kernel)
echo "Setting kernel version..."
KERNELVERSION="$2"
KERNELARGS=" --kernel $KERNELVERSION "
shift # past argument
shift # past value
;;
-c|--compatibility)
echo "Setting compatibility..."
COMPATIBILITY="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
# End args parsing
# If missing, download latest version of the script that will respin the ISO
if [ ! -f isorespin.sh ]; then
echo "Isorespin script not found. Downloading it..."
wget -O isorespin.sh "https://drive.google.com/uc?export=download&id=0B99O3A0dDe67S053UE8zN3NwM2c"
fi
installpackages=""
# Packages that will be installed:
# Thermal management stuff and packages
installpackages+="thermald "
installpackages+="tlp "
installpackages+="tlp-rdw "
installpackages+="powertop "
# Streaming and codecs for correct video encoding/play
installpackages+="va-driver-all "
installpackages+="vainfo "
if [ -n "$COMPATIBILITY" ]; then
if [ "$COMPATIBILITY" == "bionicbeaver" ]; then
installpackages+="libva2 "
installpackages+="bbswitch-dkms "
installpackages+="pciutils "
installpackages+="lsb-release "
# Nvidia
installpackages+="nvidia-390 "
installpackages+="nvidia-prime "
else
installpackages+="libva1 "
# Nvidia
installpackages+="nvidia-390 "
installpackages+="nvidia-prime "
fi
else
installpackages+="libva1 "
# Nvidia
installpackages+="nvidia-390 "
installpackages+="nvidia-prime "
fi
installpackages+="gstreamer1.0-libav "
installpackages+="gstreamer1.0-vaapi "
# Useful music/video player with large set of codecs
installpackages+="vlc "
# Packages that will be removed:
#removepackages=""
chmod +x isorespin.sh
./isorespin.sh -i $ISOFILE \
$KERNELARGS \
-r "ppa:graphics-drivers/ppa" \
-p "$installpackages" \
-f wrapper-network.sh \
-f wrapper-nvidia.sh \
-c wrapper-network.sh \
-c wrapper-nvidia.sh \
-g "" \
-g "quiet splash acpi_rev_override=1"