forked from neurobionics/neurobionicspi
-
Notifications
You must be signed in to change notification settings - Fork 48
/
main.Pifile
91 lines (55 loc) · 2.22 KB
/
main.Pifile
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
FROM https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-11-08/2021-10-30-raspios-bullseye-armhf-lite.zip
PUMP 1024M
RUN touch /boot/ssh
source .env
hostname="${HOSTNAME:-neurobionics}"
user="${USER:-pi}"
password="${USERPASSWORD:-neurobionics}"
email="${EMAIL:-ejrouse@umich.edu}"
mwpsk="${PASSWORD:-password}"
wifissid="${WIFI_SSID:-network}"
wifipsk="${WIFI_PASSPHRASE:-password}"
apssid="${AP_SSID:-NeurobionicsRPi}"
appsk="${AP_PASSPHRASE:-neurobionics}"
countrycode="${WIFI_CC:-US}"
##################################
# Modifying hostname and password
RUN sed -i "s/raspberrypi/${hostname}/g" /etc/hostname
RUN sed -i "s/raspberrypi/${hostname}/g" /etc/hosts
RUN bash -c "echo ${user}:${password} | chpasswd"
##################################
# Changing default timezone and keyboard layout
RUN bash -c "echo America/New_York > /etc/timezone"
RUN sed -i "s/gb/us/g" /etc/default/keyboard
##################################
RUN apt-get update
# Upgrade takes considerably more memory and time to build the image.
# RUN apt-get upgrade -y
##################################
# Configuring wpa_supplicant with systemd-networkd
RUN apt-get install -y wpasupplicant
source ./wpa_supplicant.Pifile
##################################
# Installing essential packages
source ./packages.Pifile
##################################
# Installing automagic-ap
RUN bash -c "git clone https://github.com/imsenthur/automagic-ap.git /etc/automagic-ap"
RUN bash -c "sudo chown -R ${user} /etc/automagic-ap"
##################################
# Installing webmin
RUN bash -c 'echo "deb https://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list'
RUN bash -c "wget http://www.webmin.com/jcameron-key.asc"
RUN apt-key add jcameron-key.asc
RUN apt update
RUN apt install -y webmin
##################################
# Configuring message of the day (motd)
RUN bash -c "sudo rm -rf /etc/motd"
RUN bash -c "curl -L https://raw.githubusercontent.com/neurobionics/rob311pi/main/motd -o /home/${user}/.bash_profile"
##################################
# Setting up startup_mailer and rc.local
source ./startup_mailer.Pifile
source ./rc_local.Pifile
##################################
echo "DONE!"