@dotpi/tools 2.9.5 → 2.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dotpi_root/bin/dotpi_firstrun +9 -1
- package/dotpi_root/bin/dotpi_prepare_system +15 -1
- package/dotpi_root/share/dotpi_functions/dotpi_functions_audio_device.bash +3 -0
- package/dotpi_root/share/dotpi_functions/dotpi_functions_connection.bash +7 -11
- package/dotpi_root/share/wireplumber/wireplumber.conf.d/8zzz-dotpi-wireplumber-bluetooth.conf +7 -0
- package/package.json +2 -2
|
@@ -48,10 +48,18 @@ echo "$bashrc_append" >> "${FIRSTUSERHOME}/.bashrc"
|
|
|
48
48
|
substitution="# dotpi: source even if non-interactive"
|
|
49
49
|
dotpi configuration_replace_region 'case $- in' 'esac' "$substitution" "${FIRSTUSERHOME}/.bashrc"
|
|
50
50
|
|
|
51
|
+
####### disable Raspberry Pi imager configuration
|
|
52
|
+
# otherwise it will apply again at next boot
|
|
53
|
+
|
|
54
|
+
user_data_file="/boot/firmware/user-data"
|
|
55
|
+
if [ -f "$user_data_file" ] ; then
|
|
56
|
+
dotpi echo_info "Disable Raspberry Pi imager configuration"
|
|
57
|
+
mv "$user_data_file" "${user_data_file}.disabled"
|
|
58
|
+
fi
|
|
59
|
+
|
|
51
60
|
####### hostname
|
|
52
61
|
|
|
53
62
|
dotpi echo_info "Set hostname to ${dotpi_instance_hostname}"
|
|
54
|
-
|
|
55
63
|
dotpi system_set_hostname "$dotpi_instance_hostname"
|
|
56
64
|
|
|
57
65
|
####### ssh
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
set +e
|
|
4
4
|
|
|
5
|
+
# duplicate log to SD card
|
|
6
|
+
log_path='/boot/firmware'
|
|
7
|
+
log_file="${1:-${log_path}/dotpi_prepare_system-$(date +"%Y%m%d-%H%M%S").log}"
|
|
8
|
+
# Self log
|
|
9
|
+
exec &> >(sudo tee -a "$log_file")
|
|
10
|
+
|
|
5
11
|
error_exit() {
|
|
6
12
|
error_code="${1:-255}"
|
|
7
13
|
error_context="${2:-dotpi_prepare_system}"
|
|
@@ -28,6 +34,9 @@ source "${DOTPI_ROOT}/share/dotpi_init.bash" || {
|
|
|
28
34
|
error_exit $? "source dotpi_init.bash" $error_exit_code_init
|
|
29
35
|
}
|
|
30
36
|
|
|
37
|
+
####### wifi
|
|
38
|
+
dotpi echo_info "Configure wifi"
|
|
39
|
+
|
|
31
40
|
# set wifi country code
|
|
32
41
|
#
|
|
33
42
|
# This is also done earlier by `dotpi_firstrun` but doing this
|
|
@@ -37,16 +46,21 @@ sudo raspi-config nonint do_wifi_country "${dotpi_wifi_country_code}" || {
|
|
|
37
46
|
error_exit $? "set wifi country code" $error_exit_code_init
|
|
38
47
|
}
|
|
39
48
|
|
|
49
|
+
dotpi echo_info "Update network configurations"
|
|
50
|
+
sudo dotpi connections_update
|
|
51
|
+
nmcli connection show
|
|
52
|
+
|
|
40
53
|
# unblock wifi in any case
|
|
41
54
|
sudo nmcli radio wifi on
|
|
42
55
|
sudo rfkill unblock wifi
|
|
43
56
|
|
|
44
57
|
# wait for system time update to be able to verify certificates needed by apt
|
|
45
58
|
dotpi echo_info "Wait for the system clock to update from network"
|
|
46
|
-
while [[ $(timedatectl
|
|
59
|
+
while [[ $(timedatectl --property NTPSynchronized --value | grep yes | wc -l) == 0 ]] ; do
|
|
47
60
|
date
|
|
48
61
|
sleep 5
|
|
49
62
|
done
|
|
63
|
+
timedatectl status
|
|
50
64
|
date
|
|
51
65
|
|
|
52
66
|
############### system packages via apt
|
|
@@ -359,6 +359,9 @@ _dotpi_audio_device_select_headphones() (
|
|
|
359
359
|
|
|
360
360
|
_dotpi_audio_device_select_bluetooth() (
|
|
361
361
|
_dotpi_audio_device_disable_all bluetooth
|
|
362
|
+
bluetoothctl power off
|
|
363
|
+
rfkill unblock all
|
|
364
|
+
sudo bluetoothctl power on
|
|
362
365
|
)
|
|
363
366
|
|
|
364
367
|
_dotpi_audio_device_select_raspberry_pi() (
|
|
@@ -233,6 +233,13 @@ dotpi_connections_update() (
|
|
|
233
233
|
# NetworkManager requires secure permissions
|
|
234
234
|
chmod 'u=rw,go=' "${destination_path}"/*
|
|
235
235
|
chown -R root:root "${destination_path}"
|
|
236
|
+
|
|
237
|
+
systemctl restart NetworkManager.service || {
|
|
238
|
+
return_code=$?
|
|
239
|
+
dotpi echo_error "error while restarting NetworkManager.service: ${return_code}"
|
|
240
|
+
return "${return_code}"
|
|
241
|
+
}
|
|
242
|
+
|
|
236
243
|
)
|
|
237
244
|
|
|
238
245
|
dotpi_connection_ap_id_get() (
|
|
@@ -365,11 +372,6 @@ dotpi_connection_ap_activate() (
|
|
|
365
372
|
done < <(find "${connections_path}" -name '*.nmconnection*' -print0)
|
|
366
373
|
|
|
367
374
|
dotpi_connections_update
|
|
368
|
-
systemctl restart NetworkManager.service || {
|
|
369
|
-
return_code=$?
|
|
370
|
-
dotpi echo_error "error while restarting NetworkManager.service: ${return_code}"
|
|
371
|
-
return "${return_code}"
|
|
372
|
-
}
|
|
373
375
|
)
|
|
374
376
|
|
|
375
377
|
|
|
@@ -434,10 +436,4 @@ dotpi_connection_ap_deactivate() (
|
|
|
434
436
|
done < <(find "${connections_path}" -name '*.nmconnection*' -print0)
|
|
435
437
|
|
|
436
438
|
dotpi_connections_update
|
|
437
|
-
systemctl restart NetworkManager.service || {
|
|
438
|
-
return_code=$?
|
|
439
|
-
dotpi echo_error "error while restarting NetworkManager.service: ${return_code}"
|
|
440
|
-
return "${return_code}"
|
|
441
|
-
}
|
|
442
|
-
|
|
443
439
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/tools",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.7",
|
|
4
4
|
"description": "Set of scripts for managing dotpi fleets of Raspberry Pi",
|
|
5
5
|
"author": "Jean-Philippe Lambert",
|
|
6
6
|
"contributors": [
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"lerna": "^8.2.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "4a302d365f76441e33f76ec552939e341a620e41"
|
|
50
50
|
}
|