@dotpi/tools 2.9.6 → 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.
@@ -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}"
@@ -23,13 +29,14 @@ if [[ $(whoami) != "${FIRSTUSER}" ]] ; then
23
29
  error_exit 255 "This script MUST be executed by pi user (or first user)" $error_exit_code_init
24
30
  fi
25
31
 
26
- dotpi echo_info "Configure wifi"
27
-
28
32
  DOTPI_ROOT="${DOTPI_ROOT:-/opt/dotpi}"
29
33
  source "${DOTPI_ROOT}/share/dotpi_init.bash" || {
30
34
  error_exit $? "source dotpi_init.bash" $error_exit_code_init
31
35
  }
32
36
 
37
+ ####### wifi
38
+ dotpi echo_info "Configure wifi"
39
+
33
40
  # set wifi country code
34
41
  #
35
42
  # This is also done earlier by `dotpi_firstrun` but doing this
@@ -39,19 +46,21 @@ sudo raspi-config nonint do_wifi_country "${dotpi_wifi_country_code}" || {
39
46
  error_exit $? "set wifi country code" $error_exit_code_init
40
47
  }
41
48
 
49
+ dotpi echo_info "Update network configurations"
50
+ sudo dotpi connections_update
51
+ nmcli connection show
52
+
42
53
  # unblock wifi in any case
43
54
  sudo nmcli radio wifi on
44
55
  sudo rfkill unblock wifi
45
56
 
46
- dotpi echo_info "Update network configurations"
47
- sudo dotpi connections_update
48
-
49
57
  # wait for system time update to be able to verify certificates needed by apt
50
58
  dotpi echo_info "Wait for the system clock to update from network"
51
- while [[ $(timedatectl show --property NTPSynchronized --value | grep yes | wc -l) == 0 ]] ; do
59
+ while [[ $(timedatectl --property NTPSynchronized --value | grep yes | wc -l) == 0 ]] ; do
52
60
  date
53
61
  sleep 5
54
62
  done
63
+ timedatectl status
55
64
  date
56
65
 
57
66
  ############### system packages via apt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/tools",
3
- "version": "2.9.6",
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": "1932fccf5d1302b69e18b7ff416f9bff60efd0d9"
49
+ "gitHead": "4a302d365f76441e33f76ec552939e341a620e41"
50
50
  }