@dotpi/tools 1.4.0 → 2.3.3

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.
Files changed (150) hide show
  1. package/NOTES.md +41 -1
  2. package/README.md +3 -13
  3. package/dotpi_root/bin/dotpi +1 -0
  4. package/dotpi_root/bin/dotpi_prepare_sd_card +34 -22
  5. package/dotpi_root/bin/dotpi_prepare_system +108 -68
  6. package/dotpi_root/bin/package.json +6 -0
  7. package/dotpi_root/{share/dotpi_avahi_monitor → dist/@dotpi/avahi_monitor}/dotpi_avahi_monitor.service +1 -5
  8. package/dotpi_root/dist/@dotpi/avahi_monitor/dotpi_install +21 -0
  9. package/dotpi_root/dist/@dotpi/avahi_monitor/dotpi_uninstall +17 -0
  10. package/dotpi_root/dist/@dotpi/avahi_monitor/package.json +10 -0
  11. package/dotpi_root/dist/@dotpi/javascript/bash.js +103 -0
  12. package/dotpi_root/dist/@dotpi/javascript/echo.js +13 -0
  13. package/dotpi_root/dist/@dotpi/javascript/filesystem.js +25 -0
  14. package/dotpi_root/dist/@dotpi/javascript/package.json +12 -0
  15. package/dotpi_root/dist/@dotpi/javascript/service.js +49 -0
  16. package/dotpi_root/dist/@dotpi/javascript/system.js +36 -0
  17. package/dotpi_root/dist/@dotpi/javascript/template.js +13 -0
  18. package/dotpi_root/dist/@dotpi/javascript/user.js +32 -0
  19. package/dotpi_root/dist/@dotpi/module/bin/dotpi_module +13 -0
  20. package/dotpi_root/dist/@dotpi/module/dotpi_install +52 -0
  21. package/dotpi_root/dist/@dotpi/module/dotpi_uninstall +50 -0
  22. package/dotpi_root/dist/@dotpi/module/package.json +21 -0
  23. package/dotpi_root/dist/@dotpi/module/src/configuration.js +43 -0
  24. package/dotpi_root/dist/@dotpi/module/src/createConfig.js +108 -0
  25. package/dotpi_root/dist/@dotpi/module/src/definition.js +7 -0
  26. package/dotpi_root/dist/@dotpi/module/src/index.js +0 -0
  27. package/dotpi_root/dist/@dotpi/module/src/install.js +145 -0
  28. package/dotpi_root/dist/@dotpi/module/src/uninstall.js +180 -0
  29. package/dotpi_root/etc/dotpi_environment_default.bash +16 -0
  30. package/dotpi_root/etc/dotpi_init.d/.gitkeep +0 -0
  31. package/dotpi_root/etc/dotpi_modules.json +8 -0
  32. package/dotpi_root/lib/package.json +6 -0
  33. package/dotpi_root/share/dotpi_audio_bluetooth/dotpi_audio_pipewire_relink +7 -6
  34. package/dotpi_root/share/dotpi_audio_bluetooth/package.json +6 -0
  35. package/dotpi_root/share/dotpi_functions/dotpi_functions_audio_device.bash +12 -26
  36. package/dotpi_root/share/dotpi_functions/dotpi_functions_configuration.bash +2 -2
  37. package/dotpi_root/share/dotpi_functions/dotpi_functions_service.bash +6 -2
  38. package/dotpi_root/share/dotpi_functions/dotpi_functions_system.bash +11 -0
  39. package/dotpi_root/share/dotpi_functions/dotpi_functions_user.bash +28 -0
  40. package/dotpi_root/share/dotpi_functions.bash +4 -4
  41. package/dotpi_root/share/dotpi_init.bash +7 -1
  42. package/dotpi_root/share/dotpi_pipewire/bin/dotpi_pipewire_relink +7 -6
  43. package/dotpi_root/share/dotpi_pipewire/dotpi_install +1 -1
  44. package/dotpi_root/share/dotpi_pipewire/package.json +9 -0
  45. package/dotpi_root/share/limits/zzz_dotpi_audio.conf +2 -6
  46. package/dotpi_root/share/wireplumber/wireplumber.conf.d/dotpi-wireplumber-config.conf +8 -0
  47. package/lerna.json +4 -0
  48. package/package.json +12 -2
  49. package/projects/led-test/.dotpi +3 -0
  50. package/projects/led-test/README.md +16 -0
  51. package/projects/led-test/dotpi_project.bash +29 -0
  52. package/projects/qsddsqsd/.dotpi +3 -0
  53. package/projects/qsddsqsd/README.md +16 -0
  54. package/projects/qsddsqsd/dotpi_project.bash +29 -0
  55. package/src/constants.js +4 -4
  56. package/src/create-project.js +124 -56
  57. package/src/templates/dotpi_project.bash +5 -7
  58. package/src/utils.js +2 -2
  59. package/test/create-project.test.js +0 -1
  60. package/PIPEWIRE.md +0 -280
  61. package/dotpi_root/bin/.editorbackup/dotpi_firstrun.bash~ +0 -149
  62. package/dotpi_root/bin/.editorbackup/dotpi_firstrun~ +0 -177
  63. package/dotpi_root/bin/.editorbackup/dotpi_prepare_sd_card.bash~ +0 -425
  64. package/dotpi_root/bin/.editorbackup/dotpi_prepare_sd_card~ +0 -620
  65. package/dotpi_root/bin/.editorbackup/dotpi_prepare_system.bash~ +0 -82
  66. package/dotpi_root/bin/.editorbackup/dotpi_prepare_system~ +0 -100
  67. package/dotpi_root/bin/.editorbackup/dotpi~ +0 -61
  68. package/dotpi_root/bin/.editorbackup/prepare_sd_card.bash~ +0 -252
  69. package/dotpi_root/etc/.editorbackup/dotpi_environment_default.bash~ +0 -49
  70. package/dotpi_root/etc/.editorbackup/dotpi_environment_instance.bash~ +0 -1
  71. package/dotpi_root/etc/.editorbackup/dotpi_environment_project.bash~ +0 -33
  72. package/dotpi_root/etc/.editorbackup/dotpi_tarignore~ +0 -4
  73. package/dotpi_root/share/.editorbackup/coucou~ +0 -1
  74. package/dotpi_root/share/.editorbackup/dotpi_environment.bash~ +0 -9
  75. package/dotpi_root/share/.editorbackup/dotpi_functions.bash~ +0 -11
  76. package/dotpi_root/share/.editorbackup/dotpi_functions_configuration.bash~ +0 -420
  77. package/dotpi_root/share/.editorbackup/dotpi_functions_connection.bash~ +0 -358
  78. package/dotpi_root/share/.editorbackup/dotpi_init.bash~ +0 -18
  79. package/dotpi_root/share/dotpi_audio_alsa/dotpi_audio_alsa.service +0 -15
  80. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth.service~ +0 -24
  81. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_command~ +0 -80
  82. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_start_command~ +0 -26
  83. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_stop_command~ +0 -30
  84. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_bluetooth_audio.service~ +0 -21
  85. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_audio_bluetooth.bash~ +0 -256
  86. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_audio_device.bash~ +0 -287
  87. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_bluetooth_audio.bash~ +0 -7
  88. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_configuration.bash~ +0 -428
  89. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_connection.bash~ +0 -194
  90. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_daemon.bash~ +0 -26
  91. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_soundcard.bash~ +0 -287
  92. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_soundcards.bash~ +0 -12
  93. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_system.bash~ +0 -158
  94. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_utils.bash~ +0 -152
  95. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_bluetooth.bash~ +0 -20
  96. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_command~ +0 -17
  97. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_headphones.bash~ +0 -20
  98. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_hifiberry.bash~ +0 -16
  99. package/dotpi_root/share/jackd/.editorbackup/jackd.conf~ +0 -5
  100. package/dotpi_root/share/jackd/.editorbackup/jackd.service~ +0 -15
  101. package/dotpi_root/share/jackd/.editorbackup/jackd_headphones.conf~ +0 -5
  102. package/dotpi_root/share/jackd/dotpi_jack_simple_client.service +0 -23
  103. package/dotpi_root/share/jackd/dotpi_jackd_bluetooth.bash +0 -18
  104. package/dotpi_root/share/jackd/dotpi_jackd_command +0 -26
  105. package/dotpi_root/share/jackd/dotpi_jackd_headphones.bash +0 -21
  106. package/dotpi_root/share/jackd/dotpi_jackd_hifiberry.bash +0 -17
  107. package/dotpi_root/share/jackd/jackd.service +0 -22
  108. package/dotpi_root/share/wireplumber/.editorbackup/8zzz-dotpi-wireplumber-config.lua~ +0 -1
  109. package/projects/old/dev.bak/.editorbackup/dotpi_environment_instance.bash~ +0 -1
  110. package/projects/old/dev.bak/.editorbackup/dotpi_environment_project.bash~ +0 -33
  111. package/projects/old/dev.bak/.editorbackup/wpa_supplicant.conf~ +0 -37
  112. package/projects/old/dev.bak/dotpi_environment_instance.bash +0 -1
  113. package/projects/old/dev.bak/dotpi_environment_project.bash +0 -46
  114. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/DOTPI-A114.nmconnection~ +0 -24
  115. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/DOTPI.nmconnection~ +0 -24
  116. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/Livebox-97C6_wifi_invite.nmconnection~ +0 -24
  117. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/onze.nmconnection~ +0 -22
  118. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/welcome.nmconnection~ +0 -23
  119. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/DOTPI-A114.nmconnection +0 -23
  120. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/DOTPI.nmconnection +0 -23
  121. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/Livebox-97C6_wifi_invite.nmconnection +0 -24
  122. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/onze.nmconnection +0 -24
  123. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/welcome.nmconnection +0 -23
  124. package/projects/old/dev.bak/network/.editorbackup/DOTPI-A114.nmconnection~ +0 -24
  125. package/projects/old/dev.bak/network/.editorbackup/DOTPI.nmconnection~ +0 -24
  126. package/projects/old/dev.bak/network/.editorbackup/Livebox-97C6_wifi_invite.nmconnection~ +0 -24
  127. package/projects/old/dev.bak/network/.editorbackup/onze.nmconnection~ +0 -22
  128. package/projects/old/dev.bak/network/.editorbackup/welcome.nmconnection~ +0 -23
  129. package/projects/old/dev.bak/network/AccueilCie.nmconnection +0 -24
  130. package/projects/old/dev.bak/network/DOTPI-A114.nmconnection +0 -23
  131. package/projects/old/dev.bak/network/DOTPI.nmconnection +0 -23
  132. package/projects/old/dev.bak/network/Livebox-97C6_wifi_invite.nmconnection +0 -25
  133. package/projects/old/dev.bak/network/onze.nmconnection +0 -24
  134. package/projects/old/dev.bak/network/welcome.nmconnection +0 -23
  135. package/projects/old/dev.bak/network/wifi-access-point.nmconnection +0 -23
  136. package/projects/old/dev.bak/network/wifi-internet.nmconnection +0 -24
  137. package/projects/old/dev.bak/network/wifi-ircam-public.nmconnection +0 -24
  138. package/projects/old/dev.bak/network/wifi-local.nmconnection +0 -22
  139. package/projects/old/dev.bak/network/wifi-welcome.nmconnection +0 -24
  140. package/projects/old/dev.bak/wpa_supplicant.conf +0 -43
  141. package/projects/old/example-complete.bak/.editorbackup/dotpi_environment_instance.bash~ +0 -1
  142. package/projects/old/example-complete.bak/.editorbackup/dotpi_environment_project.bash~ +0 -26
  143. package/projects/old/example-complete.bak/.editorbackup/dotpi_project.bash~ +0 -21
  144. package/projects/old/example-complete.bak/.editorbackup/dotpi_tmp.bash~ +0 -3
  145. package/projects/old/example-complete.bak/.editorbackup/wpa_supplicant.conf~ +0 -37
  146. package/projects/old/example-complete.bak/configuration/.editorbackup/dotpi_project.bash~ +0 -21
  147. package/projects/old/example-complete.bak/configuration/dotpi_project.bash +0 -21
  148. package/projects/old/example-complete.bak/configuration/jackd/.editorbackup/dotpi_jackd.bash~ +0 -14
  149. package/projects/old/example-complete.bak/configuration/jackd/dotpi_jackd.bash +0 -14
  150. /package/dotpi_root/{share/dotpi_avahi_monitor → dist/@dotpi/avahi_monitor}/dotpi_avahi_monitor_command +0 -0
@@ -1,100 +0,0 @@
1
- #!/bin/bash
2
-
3
- set +e
4
-
5
- ############### bootstrap
6
-
7
- # This script MUST be executed by `pi` user
8
- FIRSTUSER="$(getent passwd 1000 | cut -d: -f1)"
9
- if [[ $(whoami) != "${FIRSTUSER}" ]] ; then
10
- dotpi echo_error "This script MUST be executed by pi user (or first user)"
11
- exit 1
12
- fi
13
-
14
- DOTPI_ROOT="${DOTPI_ROOT:-/opt/dotpi}"
15
- source "${DOTPI_ROOT}/share/dotpi_init.bash"
16
-
17
-
18
- ############### system packages via apt
19
-
20
- # in case dpkg was interrupted
21
- sudo dpkg --configure -a
22
-
23
- dotpi echo_info "Uninstall apt packages: ${dotpi_apt_uninstall[@]}"
24
- sudo dotpi apt_get purge "${dotpi_apt_uninstall[@]}"
25
-
26
- sudo dotpi apt_get clean
27
- sudo dotpi apt_get autoremove -y
28
-
29
- dotpi echo_info "Update and dist-upgrade"
30
- sudo dotpi apt_get update
31
- sudo dotpi apt_get dist-upgrade
32
-
33
- dotpi echo_info "Install apt packages: ${dotpi_apt_install[@]}"
34
- sudo dotpi apt_get install "${dotpi_apt_install[@]}"
35
-
36
-
37
- ############### node.js
38
-
39
- dotpi echo_info "Install Node.js"
40
-
41
- word_size="$(dotpi file_word_size "$(which file)" )"
42
- if [[ $word_size == "32" ]] ; then
43
- node_arch=armv7l
44
- else
45
- node_arch=arm64
46
- fi
47
-
48
- (set -o pipefail ; curl -L https://bit.ly/n-install | bash -s -- -y -a "$node_arch" "$dotpi_node_version") && (
49
- cat >> "${HOME}/.bashrc" << EOF
50
-
51
- # dotpi: force the usage of -a for correct architecture
52
- # (n relies on uname, which tells about the kernel, not the executables)
53
-
54
- alias n="n -a ${node_arch}"
55
-
56
- EOF
57
- )
58
-
59
- source="${HOME}/n/bin"
60
- destination="/usr/bin"
61
- executables=(
62
- corepack
63
- node
64
- npm
65
- npx
66
- )
67
- for executable in "${executables[@]}" ; do
68
- sudo ln -s "${source}/${executable}" "${destination}/${executable}"
69
- done
70
-
71
- # source now, to update bash environment
72
- source "${HOME}/.bashrc"
73
-
74
-
75
- ############## jackd2
76
-
77
- dotpi echo_info "Install Jackd daemon"
78
-
79
- sudo dpkg-reconfigure -f noninteractive -p high jackd2
80
-
81
- dotpi echo_warning "You should close all active session windows for jackd high priority"
82
-
83
- sudo dotpi daemon_install "${DOTPI_ROOT}/share/jackd/jackd.service"
84
-
85
-
86
- ############## dotpi-manager
87
-
88
- dotpi echo_info "Install dotpi manager"
89
- destination_path="${DOTPI_ROOT}/share/dotpi-manager/runtime"
90
- sudo mkdir -p "$destination_path"
91
- sudo chown "$FIRSTUSER" -R "$destination_path"
92
- git clone https://github.com/ircam-ismm/dotpi-manager.git "$destination_path"
93
- (
94
- cd -- "$destination_path"
95
- npm install
96
- npm run build
97
- )
98
- sudo dotpi daemon_install "${DOTPI_ROOT}/share/dotpi-manager/dotpi-manager.service"
99
-
100
- dotpi_echo_info "System prepared"
@@ -1,61 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Busy-box like wrapper
4
-
5
- # Main usage is for sudo, to source ${DOTPI_ROOT}/share/dotpi_init.bash before the command
6
-
7
- # installation with a link in the path
8
-
9
- # sudo dotpi echo_info "dotpi root is ${DOTPI_ROOT}"
10
-
11
-
12
- # `readlink -f` is not available for MacOS
13
- # https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
14
- dotpi_readlink_follow() (
15
- target_file="$1"
16
-
17
- cd -- "$(dirname -- "$target_file")" || {
18
- echo ''
19
- return 1
20
- }
21
- target_file="$(basename -- "$target_file")"
22
-
23
- # Iterate down a (possible) chain of symlinks
24
- while [[ -L "$target_file" ]] ; do
25
- target_file="$(readlink -- "$target_file")"
26
- cd -- "$(dirname -- "$target_file")" || {
27
- echo ''
28
- return 1
29
- }
30
- target_file="$(basename -- "$target_file")"
31
- done
32
-
33
- # Compute the canonicalized name by finding the physical path
34
- # for the directory we're in and appending the target file.
35
- target_path="$(pwd -P)"
36
- result="${target_path}/${target_file}"
37
- echo "$result"
38
- )
39
-
40
- local_file="$(dotpi_readlink_follow "$0")"
41
- local_path="$(dirname -- "$local_file")"
42
- local_root="$(cd -- "${local_path}/.." && pwd -P)"
43
-
44
- DOTPI_ROOT="${DOTPI_ROOT:-${local_root}}"
45
-
46
- source "${DOTPI_ROOT}/share/dotpi_init.bash"
47
-
48
- self_command="$(basename -- "$0")"
49
- self_usage() {
50
- echo "Usage: ${self_command} <command> [ <arguments> ]"
51
- }
52
-
53
- if [[ -z "$1" ]] ; then
54
- dotpi_echo_error "Missing command as first argument"
55
- self_usage
56
- exit 1
57
- fi
58
-
59
-
60
- "dotpi_$1" "${@:2}"
61
-
@@ -1,252 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- _dotpi_command="$(basename "$0")"
6
-
7
-
8
- dotpi_echo_error() {
9
- printf '%s\n' "$1" >&2
10
- }
11
-
12
- _dotpi_usage() {
13
- echo "Usage: ${_dopi_command} --project <project>"
14
- }
15
-
16
- _echo_empty_option_error() {
17
- dotpi_echo_error "ERROR: $1 requires a non-empty option argument."
18
- }
19
-
20
-
21
- while true ; do
22
- case $1 in
23
-
24
- -h|-\?|--help)
25
- _dotpi_usage # Display a usage synopsis.
26
- return 0
27
- ;;
28
-
29
- -p|--project) # Takes an option argument; ensure it has been specified.
30
- if [ -z "$2" ] ; then
31
- _dotpi_usage
32
- _echo_empty_option_error "$1"
33
- return 1
34
- else
35
- project="$2"
36
- shift
37
- fi
38
- ;;
39
-
40
- --) # End of all options.
41
- shift
42
- break
43
- ;;
44
-
45
- -?*) # Unknown
46
- _dotpi_usage
47
- dotpi_echo_error "ERROR: Unknown option: $1"
48
- exit 1
49
- ;;
50
-
51
- *) # Default case: No more options, so break out of the loop.
52
- break
53
-
54
- esac
55
-
56
- shift
57
- done
58
-
59
- if [ -z ${project+x} ] ; then
60
- _dotpi_usage
61
- echo "ERROR: missing project option" >&2
62
- exit 1
63
- fi
64
-
65
- echo "$project"
66
-
67
- exit 0
68
-
69
- local_path="$(cd "$(dirname "$0")" && pwd)"
70
-
71
- # script in "bin"
72
- DOTPI_ROOT="${local_path}/.."
73
-
74
- source "${DOTPI_ROOT}/share/dotpi_init.bash"
75
-
76
-
77
- tar_options=()
78
- while read pattern ; do
79
- tar_options+=( '--exclude' "${pattern}*" )
80
- done < "${source_path}/.tarignore"
81
-
82
- if [[ "$(uname)" == "Darwin" ]] ; then
83
- tar_options+=(
84
- '--no-mac-metadata'
85
- '--no-xattrs'
86
- )
87
- fi
88
-
89
- file_system_mirror="/tmp/$(mktemp -d dotpi_file_system.XXXXXX)"
90
-
91
- # copy defaults
92
-
93
-
94
- destination_path="${file_system_mirror}/opt/dotpi"
95
- mkdir -p "$destination_path"
96
- tar c -C "$source_path" '.' | tar xv -C "$destination_path"
97
-
98
-
99
- source_path="${local_path}/file_system"
100
-
101
-
102
-
103
- DOTPI_ROOT="${file_system_mirror}/opt/dotpi"
104
-
105
- source "${DOTPI_ROOT}/share/dotpi_init.bash"
106
-
107
- ######## SD card
108
-
109
- bootfs_name="bootfs"
110
-
111
- if [[ "$(uname)" != "Darwin" ]] ; then
112
- echo ""
113
- echo "############################################################"
114
- echo ""
115
- echo " This script is for MacOS (Darwin) only."
116
- echo " Please adapt it for you environment and send you feedback."
117
- echo ""
118
- echo "############################################################"
119
- echo ""
120
- exit 1
121
- fi
122
-
123
- bootfs_path="/Volumes/${bootfs_name}"
124
- destination_path="${bootfs_path}/dotpi"
125
-
126
- # try to mount if unmounted (but not ejected)
127
- if [ -x $(which diskutil) ] ; then
128
- diskutil mount "$bootfs_name"
129
- fi
130
-
131
- if [ ! -d "$bootfs_path" ] ; then
132
- echo "############################################################"
133
- echo ""
134
- echo " Please mount SD card and try again."
135
- echo ""
136
- echo "############################################################"
137
- echo ""
138
- exit 1
139
- fi
140
-
141
-
142
- ######### config.txt
143
-
144
- config_filename='config.txt'
145
- config_file="${source_path}/boot/${config_filename}"
146
-
147
- if [ -x "${config_file}" ] ; then
148
- echo "using existing file ${config_file}"
149
- else
150
- echo "copy configuration file from imager"
151
- mkdir -p "${source_path}/boot"
152
- cp "${bootfs_path}/${config_filename}" "$(dirname "$config_file")"
153
- fi
154
-
155
- echo "editing file ${config_file}"
156
-
157
- # keep quotes here to keep quotes hereafter
158
- cat >> "${config_file}" << "EOF"
159
-
160
- ############
161
- # dotpi
162
- #
163
-
164
- [all]
165
-
166
- EOF
167
-
168
- word_size="$(file "${bootfs_path}/start.elf" | perl -pe 's/.*(32|64)-bit.*/$1/' )"
169
-
170
- if [[ $word_size == "32" ]] ; then
171
-
172
- file="$config_file"
173
- key="arm_64bits"
174
-
175
- # comment original value
176
- dotpi_configuration_comment --file "$file" --key "$key"
177
- dotpi_configuration_write \
178
- --file "$file" --key "$key" \
179
- --value "0" --prepend-line-if-new '# true 32bit system'
180
- fi
181
-
182
-
183
- ########## copy files
184
-
185
- mkdir -p "$destination_path"
186
-
187
- tar_options=()
188
- while read pattern ; do
189
- tar_options+=( '--exclude' "${pattern}*" )
190
- done < "${source_path}/.tarignore"
191
-
192
- if [[ "$(uname)" == "Darwin" ]] ; then
193
- tar_options+=(
194
- '--no-mac-metadata'
195
- '--no-xattrs'
196
- )
197
- fi
198
-
199
- # create archive for instaling, later
200
- # this overcomes the limitiations of the FAT32 boot volume
201
- tar cvz "${tar_options[@]}" -C "${source_path}" '.' > "${destination_path}/file_system.tgz"
202
-
203
- # install config.txt to /boot to be ready for first run
204
- cp "$config_file" "$bootfs_path"
205
-
206
-
207
- ######### configure first run
208
-
209
- echo '############ firstrun.bash NOT installed ###########'
210
-
211
- # # copy original firstrun.sh
212
- # # dotpi_firstrun.bash will run this first
213
- # file_name="$bootfs_path/firstrun.sh"
214
- # if [ -f "$file_name" ] ; then
215
- # mv "${file_name}" "${destination_path}/imager_firstrun.sh"
216
- # fi
217
-
218
-
219
- # # replace with custom, that will over-ride imager settings
220
- # # run dotpi_firstrun.bash
221
- # cat > "${bootfs_path}/firstrun.sh" << "EOF"
222
- # #!/bin/bash
223
-
224
- # set -e
225
-
226
- # local_path="$(dirname "${BASH_SOURCE[0]}")"
227
-
228
- # tar xvzf -C / "${local_path}/dotpi/file_system.tgz"
229
-
230
- # source_path="${local_path}/dotpi"
231
-
232
- # cd "$source_path" || exit 1
233
- # source "dotpi_firstrun.bash"
234
-
235
- # rm -f /boot/firstrun.sh
236
- # sed -i 's| systemd.run.*||g' /boot/cmdline.txt
237
-
238
- # exit 0
239
-
240
- # EOF
241
-
242
- # echo done copying files
243
-
244
-
245
- # try to mount if unmounted (but not ejected)
246
- if [ -x $(type -P diskutil) ] ; then
247
- diskutil umount "$bootfs_name" || :
248
- fi
249
-
250
- exit 0
251
-
252
-
@@ -1,49 +0,0 @@
1
- #!/bin/bash
2
-
3
- # force 32bit executable
4
- # (and kernel for Raspberry Pi v3, not v4)
5
- # 32 for 32bit system, 64 for 64bit system
6
- dotpi_word_size='32'
7
-
8
- # dot *not* change this
9
- dotpi_hostname_prefix='dotpi'
10
-
11
- dotpi_user='pi'
12
-
13
- # no default password:
14
- # - keep the one set by the imager
15
- # - or over-ride in dotpi_environment_project.bash
16
- dotpi_password_hash6=
17
- # # openssl passwd -6
18
- # dotpi_password_hash6='$6$...'
19
-
20
- # no default key
21
- dotpi_ssh_authorized_keys=()
22
-
23
- dotpi_ssh_allow_password_authentication='yes'
24
-
25
- dotpi_timezone='Europe/Paris'
26
-
27
- dotpi_keymap='fr'
28
-
29
- dotpi_soundcard='default'
30
-
31
- # run /opt/dotpi/bin/dotpi_prepare_system after the first reboot
32
- dotpi_prepare_system_automatic='yes'
33
-
34
- # Let the user choose (lite or not)
35
- dotpi_apt_uninstall=()
36
-
37
- dotpi_apt_install=(
38
- 'ca-certificates'
39
- 'curl'
40
- 'g++'
41
- 'gcc'
42
- 'git'
43
- 'gnupg'
44
- 'make'
45
- 'moreutils' # ts for time-stamp
46
- 'jackd2'
47
- )
48
-
49
- dotpi_node_version='lts'
@@ -1 +0,0 @@
1
- dotpi_instance_number="19"
@@ -1,33 +0,0 @@
1
- #!/bin/bash
2
-
3
- dotpi_hostname_prefix='dotpi-dev-'
4
-
5
- dotpi_user='pi'
6
-
7
- # openssl passwd -5
8
- dotpi_password_hash5='$5$gMXLiV.9.yWicVy8$zZw9IA8VLGHLGQwszcNDL7uZn0pow7FJvhpl8aKzvb5'
9
- # openssl passwd -6
10
- dotpi_password_hash6='$6$q77KHQrWV29rTW7I$kraa4gOTGCCdf9JqzgwXuTMhqtuBH2H7n/nFVdsYTNYZ9wFEjbveCOSVxQfrHol4CzwntrCRL45YCZG3dQ8TS1'
11
-
12
- dotpi_ssh_allow_password_authentication='yes'
13
-
14
- # replace default keys
15
- dotpi_ssh_authorized_keys=(
16
- # dev key
17
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/6aSZgQX9P2cdAwnJ6Ga9Oa8fmZ2/shWNIn4gjlLhIatOnEtitPoUrxiuN4mYzUiXg8jA7O4SHJiprQ95sDQjmwh4IuFrRyUqRTqBt0OGB+Rx2GMUv89eopIInAY1fSbK6KpbYNM5MJLn88Q+hf49wfvkpRZf3kuliSGPDqH9nzz0pqEJkHtY1zTV+uXjnh7jgESJ06ZOwqCzVaVPQ0Sd8rQGUHRihZe/aIKbuQAWPUNmt2/tIPQeZT/A1VJljZT+RtZaxz5qShEmCyoFEtbWuc+UowK4zMFnPjLYPDqN5ruA3gFrenndS9nfH+Q51BSYmtTYs2FI152O3E1WA/r5n/3TVZe9IphwGnoDCiQEBdu7Sw0l0CI2sY/JvGUvs9LWW7sbbFdy16RMnpw8ecD/sSri9uECWYMoMsbE6oQZaA3b2C0ThbO4LeRkTmQ7RSMAe0/gRQOjllaOnvPyp/+ayBdTwF3sFt3643N/0PQwK3A6eO9saRFXt2Vzra9f7mIxhcOq+1Wm84dO8HzbNGDYUyWyKayhR6kPaBvvCD7abOjI6wL/4ZFI7lelAgiahJHNx5ck5NlD5Q59uy+MiF6MmzuFbE3Q/EXwDnj1itBtpoJM0o9SLDqhHyayupB5ISsKIIvxtL/ApKPBahJoI6RnZUO6lDWMcDKuiyQ4eqV0SQ== matuszewski@ISMM-3139-Matuszewski.local'
18
- )
19
-
20
- # add keys
21
- dotpi_ssh_authorized_keys+=(
22
- # the following comment should be written
23
- '# this is the end'
24
- )
25
-
26
- dotpi_timezone='Europe/Paris'
27
-
28
- dotpi_keymap='fr'
29
-
30
- # add packages
31
- dotpi_apt_install+=(
32
- 'nmap' # test network
33
- )
@@ -1,4 +0,0 @@
1
- .DS_Store
2
- .Spotlight-V100
3
-
4
- .editorbackup
@@ -1 +0,0 @@
1
- salut
@@ -1,9 +0,0 @@
1
- #!/bin/bash
2
-
3
- dotpi_source_if_available "${DOTPI_ROOT}/etc/dotpi_environment_default.bash"
4
- dotpi_source_if_available "${DOTPI_ROOT}/etc/dotpi_environment_project.bash"
5
- dotpi_source_if_available "${DOTPI_ROOT}/etc/dotpi_environment_instance.bash"
6
-
7
- if [ -n "$dotpi_hostname_prefix" ] && [ -n "$dotpi_instance_number" ] ; then
8
- dotpi_instance_hostname="${dotpi_hostname_prefix}$(printf %03d ${dotpi_instance_number})"
9
- fi
@@ -1,11 +0,0 @@
1
- #!/bin/bash
2
-
3
- #### default functions
4
-
5
- for file in "${DOTPI_ROOT}/share/dotpi_functions/"* ; do
6
- source "$file"
7
- done
8
-
9
- #### dotpi-manager
10
-
11
- dotpi_source_if_available "${DOTPI_ROOT}/share/dotpi-manager/dotpi_manager.bash"