-
Notifications
You must be signed in to change notification settings - Fork 11
/
postinst.sh
39 lines (28 loc) · 1.54 KB
/
postinst.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
#!/usr/bin/env bash
# TODO: make this quit if run on host machine. oops!
# TODO: install packages elsewhere
apt-get install rpi-stock-kernel-firmware sudo alsa-utils rt-tests psmisc cpufrequtils console-common fake-hwclock ntp xserver-xorg xserver-xorg-video-fbdev xserver-xorg-input-libinput dbus-x11 policykit-1 lxde-core lightdm lxterminal jackd2 ffmpeg mpg123 id3v2 flac vorbis-tools xwax pideck usbmount whois --yes
# create user
USERNAME="pi"
ENCRYPTED_PASSWORD=`mkpasswd -m sha-512 "deck"`
adduser --gecos $USERNAME --add_extra_groups --disabled-password $USERNAME
chown $USERNAME:$USERNAME /home/$USERNAME
usermod -aG audio $USERNAME
usermod -aG sudo $USERNAME
usermod -p "${ENCRYPTED_PASSWORD}" $USERNAME
# kernel cmdline
echo "dwc_otg.lpm_enable=0 net.ifnames=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait logo.nologo" > /boot/cmdline.txt
# autologin
sed -i "s/^#autologin-user=/autologin-user=$USERNAME/" /etc/lightdm/lightdm.conf
# no cursor & no screensaver
sed -i "s/^#xserver-command=X/xserver-command=X -s 0 -dpms -nocursor/" /etc/lightdm/lightdm.conf
# remove the rainbow splash screen at bootup
echo "disable_splash=1" >> /boot/config.txt
# remove the console login that flashes before X starts
systemctl disable getty@tty1
# add the soundcard module
echo "dtoverlay=audioinjector-wm8731-audio" >> /boot/config.txt
# set CPUs to no throttling
sed -i 's/^GOVERNOR=.*/GOVERNOR="performance"/' /etc/init.d/cpufrequtils
# disable bluetooth
echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt