-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathInstallPackages.sh
More file actions
executable file
·141 lines (105 loc) · 4.18 KB
/
InstallPackages.sh
File metadata and controls
executable file
·141 lines (105 loc) · 4.18 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash -e
# This file is part of PrawnOS (https://www.prawnos.com)
# Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
# PrawnOS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
# PrawnOS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
### SHARED CONST AND VARS
RESOURCES=/etc/prawnos/install/resources
SCRIPTS=/etc/prawnos/install/scripts
# TODO: when these scripts are packaged, place these in a shared script instead of in every file that needs them
device_veyron_speedy="Google Speedy"
device_veyron_minnie="Google Minnie"
device_veyron_mickey="Google Mickey"
device_gru_kevin="Google Kevin"
device_gru_bob="Google Bob"
get_device() {
local device=$(tr -d '\0' < /sys/firmware/devicetree/base/model)
echo $device
}
get_emmc_devname() {
local devname=$(ls /dev/mmcblk* | grep -F boot0 | sed "s/boot0//")
if [ -z "$devname" ]
then
echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
fi
echo $devname
}
get_sd_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk0;;
$device_veyron_minnie) local devname=mmcblk0;;
$device_veyron_mickey) local devname="";;
$device_gru_kevin) local devname=mmcblk0;;
$device_gru_bob) local devname=mmcblk0;;
* ) echo "Unknown device! can't determine sd card devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
esac
echo $devname
}
### END SHARED CONST AND VARS
# Import the package lists
source $SCRIPTS/package_lists.sh
cat $RESOURCES/ascii-icon.txt
echo ""
while true; do
read -r -p "Install (X)fce4, or (G)nome, if unsure choose (X)fce: " XL
case $XL in
[Gg]* ) DE=gnome; break;;
[Xx]* ) DE=xfce; break;;
* ) echo "Please answer (X)fce4, (G)nome";;
esac
done
#Set the timezone
dpkg-reconfigure tzdata
## GENERAL CONFIG
#Install shared packages
DEBIAN_FRONTEND=noninteractive apt install -y ${shared_desktop_debs_download[@]}
DEBIAN_FRONTEND=noninteractive apt install -y ${prawnos_base_debs_prebuilt_download[@]}
DEBIAN_FRONTEND=noninteractive apt install -y prawnos-general-config
## DEVICE SPECIFIC CONFIG
#Copy in acpi, pulse audio, trackpad settings, funtion key settings
device_model=$(get_device)
if [[ $device_model == $device_veyron_speedy ]] || [[ $device_model == $device_veyron_minnie ]]
then
DEBIAN_FRONTEND=noninteractive apt install -y prawnos-veyron-config
fi
if [[ $device_model == $device_gru_kevin ]] || [[ $device_model == $device_gru_bob ]]
then
DEBIAN_FRONTEND=noninteractive apt install -y prawnos-gru-config
fi
# remove some packages that we don't actually want.
#TODO: determine what packages recommends are bringing these in
apt remove -y gnome-software lilyterm
## DE SPECIFIC
if [ "$DE" = "gnome" ]
then
apt install -y ${gnome_debs_download[@]}
apt install -y ${prawnos_gnome_debs_prebuilt_download[@]}
#TODO: debug why rotation is flipped
# work around issue #234
apt remove -y iio-sensor-proxy
fi
if [ "$DE" = "xfce" ]
then
apt install -y ${xfce_debs_download[@]}
apt install -y ${prawnos_xfce_debs_prebuilt_download[@]}
# remove light-locker, as it is broken on this machine. See issue https://github.com/SolidHal/PrawnOS/issues/56#issuecomment-504681175
apt remove -y light-locker
apt purge -y light-locker
#Install packages not in an apt repo
# TODO: likely drop this in favor of just using the upstream
# dpkg -i $DIR/xfce-themes/*
fi
apt clean -y && apt autoremove --purge -y
#reload the CA certificate symlinks
update-ca-certificates --fresh
#enable periodic TRIM
cp /lib/systemd/system/fstrim.{service,timer} /etc/systemd/system
systemctl enable fstrim.timer