Skip to content

Commit 2103311

Browse files
authored
Try to remove piwiz from desktop images (#535)
* Try to remove piwiz from desktop images * Try to fix bash syntax error * Try to actually run the new setup script * Run `apt autoremove` after purging piwiz * Troubleshoot removal of piwiz * Troubleshoot permissions in previous commit * Provide lightdm config to bypass piwiz
1 parent 00068cd commit 2103311

File tree

3 files changed

+201
-7
lines changed

3 files changed

+201
-7
lines changed

software/distro/setup/planktoscope-app-env/setup.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# Determine the base path for sub-scripts
99

10-
build_scripts_root=$(dirname $(realpath $BASH_SOURCE))
10+
build_scripts_root=$(dirname "$(realpath "$BASH_SOURCE")")
1111

1212
# Get command-line args
1313

@@ -37,46 +37,54 @@ function panic {
3737

3838
# Run sub-scripts
3939

40+
description="disable first-boot wizards"
41+
report_starting "$description"
42+
if "$build_scripts_root/wizards/remove.sh"; then
43+
report_finished "$description"
44+
else
45+
panic "$description"
46+
fi
47+
4048
description="set up Node-RED frontend"
4149
report_starting "$description"
42-
if $build_scripts_root/node-red-frontend/install.sh "$hardware_type" ; then
50+
if "$build_scripts_root/node-red-frontend/install.sh" "$hardware_type"; then
4351
report_finished "$description"
4452
else
4553
panic "$description"
4654
fi
4755

48-
if [ $hardware_type = "segmenter-only" ]; then
56+
if [ "$hardware_type" = "segmenter-only" ]; then
4957
echo "Warning: skipping PlanktoScope hardware-specific setup because hardware type was specified as: $hardware_type"
5058
exit 0
5159
fi
5260

5361
description="set up Python hardware controller"
5462
report_starting "$description"
55-
if $build_scripts_root/python-hardware-controller/install.sh "$hardware_type" ; then
63+
if "$build_scripts_root/python-hardware-controller/install.sh" "$hardware_type"; then
5664
report_finished "$description"
5765
else
5866
panic "$description"
5967
fi
6068

6169
description="configure kernel hardware drivers"
6270
report_starting "$description"
63-
if $build_scripts_root/platform-hardware/config.sh ; then
71+
if "$build_scripts_root/platform-hardware/config.sh"; then
6472
report_finished "$description"
6573
else
6674
panic "$description"
6775
fi
6876

6977
description="set up GPS and clock driver"
7078
report_starting "$description"
71-
if $build_scripts_root/gps/install.sh ; then
79+
if "$build_scripts_root/gps/install.sh"; then
7280
report_finished "$description"
7381
else
7482
panic "$description"
7583
fi
7684

7785
description="enable CPU overclocking"
7886
report_starting "$description"
79-
if $build_scripts_root/overclocking/config.sh ; then
87+
if "$build_scripts_root/overclocking/config.sh"; then
8088
report_finished "$description"
8189
else
8290
panic "$description"
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
#
2+
# General configuration
3+
#
4+
# start-default-seat = True to always start one seat if none are defined in the configuration
5+
# greeter-user = User to run greeter as
6+
# minimum-display-number = Minimum display number to use for X servers
7+
# minimum-vt = First VT to run displays on
8+
# lock-memory = True to prevent memory from being paged to disk
9+
# user-authority-in-system-dir = True if session authority should be in the system location
10+
# guest-account-script = Script to be run to setup guest account
11+
# logind-check-graphical = True to on start seats that are marked as graphical by logind
12+
# log-directory = Directory to log information to
13+
# run-directory = Directory to put running state in
14+
# cache-directory = Directory to cache to
15+
# sessions-directory = Directory to find sessions
16+
# remote-sessions-directory = Directory to find remote sessions
17+
# greeters-directory = Directory to find greeters
18+
# backup-logs = True to move add a .old suffix to old log files when opening new ones
19+
# dbus-service = True if LightDM provides a D-Bus service to control it
20+
#
21+
[LightDM]
22+
#start-default-seat=true
23+
#greeter-user=lightdm
24+
#minimum-display-number=0
25+
#minimum-vt=7
26+
#lock-memory=true
27+
#user-authority-in-system-dir=false
28+
#guest-account-script=guest-account
29+
#logind-check-graphical=false
30+
#log-directory=/var/log/lightdm
31+
#run-directory=/var/run/lightdm
32+
#cache-directory=/var/cache/lightdm
33+
#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions
34+
#remote-sessions-directory=/usr/share/lightdm/remote-sessions
35+
#greeters-directory=$XDG_DATA_DIRS/lightdm/greeters:$XDG_DATA_DIRS/xgreeters
36+
#backup-logs=true
37+
#dbus-service=true
38+
39+
#
40+
# Seat configuration
41+
#
42+
# Seat configuration is matched against the seat name glob in the section, for example:
43+
# [Seat:*] matches all seats and is applied first.
44+
# [Seat:seat0] matches the seat named "seat0".
45+
# [Seat:seat-thin-client*] matches all seats that have names that start with "seat-thin-client".
46+
#
47+
# type = Seat type (local, xremote, unity)
48+
# pam-service = PAM service to use for login
49+
# pam-autologin-service = PAM service to use for autologin
50+
# pam-greeter-service = PAM service to use for greeters
51+
# xserver-backend = X backend to use (mir)
52+
# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
53+
# xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option)
54+
# xserver-config = Config file to pass to X server
55+
# xserver-layout = Layout to pass to X server
56+
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
57+
# xserver-share = True if the X server is shared for both greeter and session
58+
# xserver-hostname = Hostname of X server (only for type=xremote)
59+
# xserver-display-number = Display number of X server (only for type=xremote)
60+
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
61+
# xdmcp-port = XDMCP UDP/IP port to communicate on
62+
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
63+
# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option)
64+
# unity-compositor-timeout = Number of seconds to wait for compositor to start
65+
# greeter-session = Session to load for greeter
66+
# greeter-hide-users = True to hide the user list
67+
# greeter-allow-guest = True if the greeter should show a guest login option
68+
# greeter-show-manual-login = True if the greeter should offer a manual login option
69+
# greeter-show-remote-login = True if the greeter should offer a remote login option
70+
# user-session = Session to load for users
71+
# allow-user-switching = True if allowed to switch users
72+
# allow-guest = True if guest login is allowed
73+
# guest-session = Session to load for guests (overrides user-session)
74+
# session-wrapper = Wrapper script to run session with
75+
# greeter-wrapper = Wrapper script to run greeter with
76+
# guest-wrapper = Wrapper script to run guest sessions with
77+
# display-setup-script = Script to run when starting a greeter session (runs as root)
78+
# display-stopped-script = Script to run after stopping the display server (runs as root)
79+
# greeter-setup-script = Script to run when starting a greeter (runs as root)
80+
# session-setup-script = Script to run when starting a user session (runs as root)
81+
# session-cleanup-script = Script to run when quitting a user session (runs as root)
82+
# autologin-guest = True to log in as guest by default
83+
# autologin-user = User to log in with by default (overrides autologin-guest)
84+
# autologin-user-timeout = Number of seconds to wait before loading default user
85+
# autologin-session = Session to load for automatic login (overrides user-session)
86+
# autologin-in-background = True if autologin session should not be immediately activated
87+
# exit-on-failure = True if the daemon should exit if this seat fails
88+
# fallback-test = Script to run to check if hardware can handle Wayland - should return 1 if so
89+
# fallback-session = Session to launch if fallback-test returns 0
90+
# fallback-greeter = Greeter session to launch if fallback-test returns 0
91+
#
92+
[Seat:*]
93+
#type=local
94+
#pam-service=lightdm
95+
#pam-autologin-service=lightdm-autologin
96+
#pam-greeter-service=lightdm-greeter
97+
#xserver-backend=
98+
#xserver-command=X
99+
#xmir-command=Xmir
100+
#xserver-config=
101+
#xserver-layout=
102+
#xserver-allow-tcp=false
103+
#xserver-share=true
104+
#xserver-hostname=
105+
#xserver-display-number=
106+
#xdmcp-manager=
107+
#xdmcp-port=177
108+
#xdmcp-key=
109+
#unity-compositor-command=unity-system-compositor
110+
#unity-compositor-timeout=60
111+
greeter-session=pi-greeter-labwc
112+
greeter-hide-users=false
113+
#greeter-allow-guest=true
114+
#greeter-show-manual-login=false
115+
#greeter-show-remote-login=true
116+
user-session=LXDE-pi-labwc
117+
#allow-user-switching=true
118+
#allow-guest=true
119+
#guest-session=
120+
#session-wrapper=lightdm-session
121+
#greeter-wrapper=
122+
#guest-wrapper=
123+
display-setup-script=/usr/share/dispsetup.sh
124+
#display-stopped-script=
125+
#greeter-setup-script=
126+
#session-setup-script=
127+
#session-cleanup-script=
128+
#autologin-guest=false
129+
autologin-user=pi
130+
#autologin-user-timeout=0
131+
#autologin-in-background=false
132+
autologin-session=LXDE-pi-labwc
133+
#exit-on-failure=false
134+
#fallback-test=
135+
#fallback-session=
136+
#fallback-greeter=
137+
138+
#
139+
# XDMCP Server configuration
140+
#
141+
# enabled = True if XDMCP connections should be allowed
142+
# port = UDP/IP port to listen for connections on
143+
# listen-address = Host/address to listen for XDMCP connections (use all addresses if not present)
144+
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
145+
# hostname = Hostname to report to XDMCP clients (defaults to system hostname if unset)
146+
#
147+
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn. Alternatively
148+
# it can be a word and the first 7 characters are used as the key.
149+
#
150+
[XDMCPServer]
151+
#enabled=false
152+
#port=177
153+
#listen-address=
154+
#key=
155+
#hostname=
156+
157+
#
158+
# VNC Server configuration
159+
#
160+
# enabled = True if VNC connections should be allowed
161+
# command = Command to run Xvnc server with
162+
# port = TCP/IP port to listen for connections on
163+
# listen-address = Host/address to listen for VNC connections (use all addresses if not present)
164+
# width = Width of display to use
165+
# height = Height of display to use
166+
# depth = Color depth of display to use
167+
#
168+
[VNCServer]
169+
#enabled=false
170+
#command=Xvnc
171+
#port=5900
172+
#listen-address=
173+
#width=1024
174+
#height=768
175+
#depth=8
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -eux
2+
3+
# Determine the base path for copied files
4+
config_files_root="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
5+
6+
# Disable the first-boot graphical wizard
7+
if [ -f /etc/xdg/autostart/piwiz.desktop ]; then
8+
sudo mv /etc/xdg/autostart/piwiz.desktop /etc/xdg/autostart/piwiz.desktop.disabled
9+
file="/etc/lightdm/lightdm.conf"
10+
sudo cp "$config_files_root$file" "$file"
11+
fi

0 commit comments

Comments
 (0)