@dotpi/tools 1.4.0 → 2.3.2
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/NOTES.md +41 -1
- package/README.md +3 -13
- package/dotpi_root/bin/dotpi +1 -0
- package/dotpi_root/bin/dotpi_prepare_sd_card +34 -22
- package/dotpi_root/bin/dotpi_prepare_system +108 -68
- package/dotpi_root/bin/package.json +6 -0
- package/dotpi_root/{share/dotpi_avahi_monitor → dist/@dotpi/avahi_monitor}/dotpi_avahi_monitor.service +1 -5
- package/dotpi_root/dist/@dotpi/avahi_monitor/dotpi_install +21 -0
- package/dotpi_root/dist/@dotpi/avahi_monitor/dotpi_uninstall +17 -0
- package/dotpi_root/dist/@dotpi/avahi_monitor/package.json +10 -0
- package/dotpi_root/dist/@dotpi/javascript/bash.js +103 -0
- package/dotpi_root/dist/@dotpi/javascript/echo.js +13 -0
- package/dotpi_root/dist/@dotpi/javascript/filesystem.js +25 -0
- package/dotpi_root/dist/@dotpi/javascript/package.json +12 -0
- package/dotpi_root/dist/@dotpi/javascript/service.js +49 -0
- package/dotpi_root/dist/@dotpi/javascript/system.js +36 -0
- package/dotpi_root/dist/@dotpi/javascript/template.js +13 -0
- package/dotpi_root/dist/@dotpi/javascript/user.js +32 -0
- package/dotpi_root/dist/@dotpi/module/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/module/bin/dotpi_module +13 -0
- package/dotpi_root/dist/@dotpi/module/dotpi_install +52 -0
- package/dotpi_root/dist/@dotpi/module/dotpi_uninstall +50 -0
- package/dotpi_root/dist/@dotpi/module/package.json +22 -0
- package/dotpi_root/dist/@dotpi/module/src/configuration.js +43 -0
- package/dotpi_root/dist/@dotpi/module/src/createConfig.js +108 -0
- package/dotpi_root/dist/@dotpi/module/src/definition.js +7 -0
- package/dotpi_root/dist/@dotpi/module/src/index.js +0 -0
- package/dotpi_root/dist/@dotpi/module/src/install.js +145 -0
- package/dotpi_root/dist/@dotpi/module/src/uninstall.js +180 -0
- package/dotpi_root/etc/dotpi_environment_default.bash +16 -0
- package/dotpi_root/etc/dotpi_init.d/.gitkeep +0 -0
- package/dotpi_root/etc/dotpi_modules.json +8 -0
- package/dotpi_root/lib/package.json +6 -0
- package/dotpi_root/share/dotpi_audio_bluetooth/dotpi_audio_pipewire_relink +7 -6
- package/dotpi_root/share/dotpi_audio_bluetooth/package.json +6 -0
- package/dotpi_root/share/dotpi_functions/dotpi_functions_audio_device.bash +12 -26
- package/dotpi_root/share/dotpi_functions/dotpi_functions_configuration.bash +2 -2
- package/dotpi_root/share/dotpi_functions/dotpi_functions_service.bash +6 -2
- package/dotpi_root/share/dotpi_functions/dotpi_functions_system.bash +11 -0
- package/dotpi_root/share/dotpi_functions/dotpi_functions_user.bash +28 -0
- package/dotpi_root/share/dotpi_functions.bash +4 -4
- package/dotpi_root/share/dotpi_init.bash +7 -1
- package/dotpi_root/share/dotpi_pipewire/bin/dotpi_pipewire_relink +7 -6
- package/dotpi_root/share/dotpi_pipewire/dotpi_install +1 -1
- package/dotpi_root/share/dotpi_pipewire/package.json +9 -0
- package/dotpi_root/share/limits/zzz_dotpi_audio.conf +2 -6
- package/dotpi_root/share/wireplumber/wireplumber.conf.d/dotpi-wireplumber-config.conf +8 -0
- package/lerna.json +4 -0
- package/package.json +12 -2
- package/projects/led-test/.dotpi +3 -0
- package/projects/led-test/README.md +16 -0
- package/projects/led-test/dotpi_project.bash +29 -0
- package/projects/qsddsqsd/.dotpi +3 -0
- package/projects/qsddsqsd/README.md +16 -0
- package/projects/qsddsqsd/dotpi_project.bash +29 -0
- package/src/constants.js +4 -4
- package/src/create-project.js +124 -56
- package/src/templates/dotpi_project.bash +5 -7
- package/src/utils.js +2 -2
- package/test/create-project.test.js +0 -1
- package/PIPEWIRE.md +0 -280
- package/dotpi_root/bin/.editorbackup/dotpi_firstrun.bash~ +0 -149
- package/dotpi_root/bin/.editorbackup/dotpi_firstrun~ +0 -177
- package/dotpi_root/bin/.editorbackup/dotpi_prepare_sd_card.bash~ +0 -425
- package/dotpi_root/bin/.editorbackup/dotpi_prepare_sd_card~ +0 -620
- package/dotpi_root/bin/.editorbackup/dotpi_prepare_system.bash~ +0 -82
- package/dotpi_root/bin/.editorbackup/dotpi_prepare_system~ +0 -100
- package/dotpi_root/bin/.editorbackup/dotpi~ +0 -61
- package/dotpi_root/bin/.editorbackup/prepare_sd_card.bash~ +0 -252
- package/dotpi_root/etc/.editorbackup/dotpi_environment_default.bash~ +0 -49
- package/dotpi_root/etc/.editorbackup/dotpi_environment_instance.bash~ +0 -1
- package/dotpi_root/etc/.editorbackup/dotpi_environment_project.bash~ +0 -33
- package/dotpi_root/etc/.editorbackup/dotpi_tarignore~ +0 -4
- package/dotpi_root/share/.editorbackup/coucou~ +0 -1
- package/dotpi_root/share/.editorbackup/dotpi_environment.bash~ +0 -9
- package/dotpi_root/share/.editorbackup/dotpi_functions.bash~ +0 -11
- package/dotpi_root/share/.editorbackup/dotpi_functions_configuration.bash~ +0 -420
- package/dotpi_root/share/.editorbackup/dotpi_functions_connection.bash~ +0 -358
- package/dotpi_root/share/.editorbackup/dotpi_init.bash~ +0 -18
- package/dotpi_root/share/dotpi_audio_alsa/dotpi_audio_alsa.service +0 -15
- package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth.service~ +0 -24
- package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_command~ +0 -80
- package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_start_command~ +0 -26
- package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_stop_command~ +0 -30
- package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_bluetooth_audio.service~ +0 -21
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_audio_bluetooth.bash~ +0 -256
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_audio_device.bash~ +0 -287
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_bluetooth_audio.bash~ +0 -7
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_configuration.bash~ +0 -428
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_connection.bash~ +0 -194
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_daemon.bash~ +0 -26
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_soundcard.bash~ +0 -287
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_soundcards.bash~ +0 -12
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_system.bash~ +0 -158
- package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_utils.bash~ +0 -152
- package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_bluetooth.bash~ +0 -20
- package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_command~ +0 -17
- package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_headphones.bash~ +0 -20
- package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_hifiberry.bash~ +0 -16
- package/dotpi_root/share/jackd/.editorbackup/jackd.conf~ +0 -5
- package/dotpi_root/share/jackd/.editorbackup/jackd.service~ +0 -15
- package/dotpi_root/share/jackd/.editorbackup/jackd_headphones.conf~ +0 -5
- package/dotpi_root/share/jackd/dotpi_jack_simple_client.service +0 -23
- package/dotpi_root/share/jackd/dotpi_jackd_bluetooth.bash +0 -18
- package/dotpi_root/share/jackd/dotpi_jackd_command +0 -26
- package/dotpi_root/share/jackd/dotpi_jackd_headphones.bash +0 -21
- package/dotpi_root/share/jackd/dotpi_jackd_hifiberry.bash +0 -17
- package/dotpi_root/share/jackd/jackd.service +0 -22
- package/dotpi_root/share/wireplumber/.editorbackup/8zzz-dotpi-wireplumber-config.lua~ +0 -1
- package/projects/old/dev.bak/.editorbackup/dotpi_environment_instance.bash~ +0 -1
- package/projects/old/dev.bak/.editorbackup/dotpi_environment_project.bash~ +0 -33
- package/projects/old/dev.bak/.editorbackup/wpa_supplicant.conf~ +0 -37
- package/projects/old/dev.bak/dotpi_environment_instance.bash +0 -1
- package/projects/old/dev.bak/dotpi_environment_project.bash +0 -46
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/DOTPI-A114.nmconnection~ +0 -24
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/DOTPI.nmconnection~ +0 -24
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/Livebox-97C6_wifi_invite.nmconnection~ +0 -24
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/onze.nmconnection~ +0 -22
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/welcome.nmconnection~ +0 -23
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/DOTPI-A114.nmconnection +0 -23
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/DOTPI.nmconnection +0 -23
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/Livebox-97C6_wifi_invite.nmconnection +0 -24
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/onze.nmconnection +0 -24
- package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/welcome.nmconnection +0 -23
- package/projects/old/dev.bak/network/.editorbackup/DOTPI-A114.nmconnection~ +0 -24
- package/projects/old/dev.bak/network/.editorbackup/DOTPI.nmconnection~ +0 -24
- package/projects/old/dev.bak/network/.editorbackup/Livebox-97C6_wifi_invite.nmconnection~ +0 -24
- package/projects/old/dev.bak/network/.editorbackup/onze.nmconnection~ +0 -22
- package/projects/old/dev.bak/network/.editorbackup/welcome.nmconnection~ +0 -23
- package/projects/old/dev.bak/network/AccueilCie.nmconnection +0 -24
- package/projects/old/dev.bak/network/DOTPI-A114.nmconnection +0 -23
- package/projects/old/dev.bak/network/DOTPI.nmconnection +0 -23
- package/projects/old/dev.bak/network/Livebox-97C6_wifi_invite.nmconnection +0 -25
- package/projects/old/dev.bak/network/onze.nmconnection +0 -24
- package/projects/old/dev.bak/network/welcome.nmconnection +0 -23
- package/projects/old/dev.bak/network/wifi-access-point.nmconnection +0 -23
- package/projects/old/dev.bak/network/wifi-internet.nmconnection +0 -24
- package/projects/old/dev.bak/network/wifi-ircam-public.nmconnection +0 -24
- package/projects/old/dev.bak/network/wifi-local.nmconnection +0 -22
- package/projects/old/dev.bak/network/wifi-welcome.nmconnection +0 -24
- package/projects/old/dev.bak/wpa_supplicant.conf +0 -43
- package/projects/old/example-complete.bak/.editorbackup/dotpi_environment_instance.bash~ +0 -1
- package/projects/old/example-complete.bak/.editorbackup/dotpi_environment_project.bash~ +0 -26
- package/projects/old/example-complete.bak/.editorbackup/dotpi_project.bash~ +0 -21
- package/projects/old/example-complete.bak/.editorbackup/dotpi_tmp.bash~ +0 -3
- package/projects/old/example-complete.bak/.editorbackup/wpa_supplicant.conf~ +0 -37
- package/projects/old/example-complete.bak/configuration/.editorbackup/dotpi_project.bash~ +0 -21
- package/projects/old/example-complete.bak/configuration/dotpi_project.bash +0 -21
- package/projects/old/example-complete.bak/configuration/jackd/.editorbackup/dotpi_jackd.bash~ +0 -14
- package/projects/old/example-complete.bak/configuration/jackd/dotpi_jackd.bash +0 -14
- /package/dotpi_root/{share/dotpi_avahi_monitor → dist/@dotpi/avahi_monitor}/dotpi_avahi_monitor_command +0 -0
|
@@ -1,620 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
set +e
|
|
4
|
-
|
|
5
|
-
_dotpi_command="$(basename -- "$0")"
|
|
6
|
-
|
|
7
|
-
####### Bootstrap
|
|
8
|
-
|
|
9
|
-
dotpi_echo_error() {
|
|
10
|
-
printf 'ERROR: %s\n' "$1" >&2
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
dotpi_echo_warning() {
|
|
14
|
-
printf 'WARNING: %s\n' "$1" >&2
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
####### Command-line options
|
|
18
|
-
|
|
19
|
-
_dotpi_usage() {
|
|
20
|
-
echo "Usage: ${_dotpi_command} --project <project_path> [--instance-number <integer>] [--bootfs-drive-letter <letter>]"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
_echo_empty_option_error() {
|
|
24
|
-
dotpi_echo_error "$1 requires a non-empty option argument."
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
while true ; do
|
|
28
|
-
case $1 in
|
|
29
|
-
|
|
30
|
-
-h|-\?|--help)
|
|
31
|
-
_dotpi_usage # Display a usage synopsis.
|
|
32
|
-
exit 0
|
|
33
|
-
;;
|
|
34
|
-
|
|
35
|
-
-p|--project) # Takes an option argument; ensure it has been specified.
|
|
36
|
-
if [ -z "$2" ] ; then
|
|
37
|
-
_echo_empty_option_error "$1"
|
|
38
|
-
_dotpi_usage
|
|
39
|
-
exit 1
|
|
40
|
-
else
|
|
41
|
-
project="$2"
|
|
42
|
-
shift
|
|
43
|
-
fi
|
|
44
|
-
;;
|
|
45
|
-
|
|
46
|
-
-i|--instance-number) # Takes an option argument; ensure it has been specified.
|
|
47
|
-
if [ -z "$2" ] ; then
|
|
48
|
-
_echo_empty_option_error "$1"
|
|
49
|
-
_dotpi_usage
|
|
50
|
-
exit 1
|
|
51
|
-
else
|
|
52
|
-
instance_number="$2"
|
|
53
|
-
shift
|
|
54
|
-
fi
|
|
55
|
-
;;
|
|
56
|
-
|
|
57
|
-
-d|--bootfs-drive-letter) # Takes an option argument; ensure it has been specified.
|
|
58
|
-
if [ -z "$2" ] ; then
|
|
59
|
-
_echo_empty_option_error "$1"
|
|
60
|
-
_dotpi_usage
|
|
61
|
-
exit 1
|
|
62
|
-
else
|
|
63
|
-
<<<<<<< ours
|
|
64
|
-
<<<<<<< Updated upstream
|
|
65
|
-
=======
|
|
66
|
-
# convert to lowercase
|
|
67
|
-
>>>>>>> Stashed changes
|
|
68
|
-
=======
|
|
69
|
-
# convert to lowercase
|
|
70
|
-
>>>>>>> theirs
|
|
71
|
-
bootfs_drive_letter="$2"
|
|
72
|
-
shift
|
|
73
|
-
fi
|
|
74
|
-
;;
|
|
75
|
-
|
|
76
|
-
--) # End of all options.
|
|
77
|
-
shift
|
|
78
|
-
break
|
|
79
|
-
;;
|
|
80
|
-
|
|
81
|
-
-?*) # Unknown
|
|
82
|
-
dotpi_echo_error "Unknown option: $1"
|
|
83
|
-
_dotpi_usage
|
|
84
|
-
exit 1
|
|
85
|
-
;;
|
|
86
|
-
|
|
87
|
-
*) # Default case: No more options, so break out of the loop.
|
|
88
|
-
break
|
|
89
|
-
|
|
90
|
-
esac
|
|
91
|
-
|
|
92
|
-
shift
|
|
93
|
-
done
|
|
94
|
-
|
|
95
|
-
if [ -z ${project+x} ] ; then
|
|
96
|
-
dotpi_echo_error "missing project option"
|
|
97
|
-
_dotpi_usage
|
|
98
|
-
exit 1
|
|
99
|
-
fi
|
|
100
|
-
|
|
101
|
-
project_path="$( (cd -- "$project" && pwd) 2> /dev/null || {
|
|
102
|
-
dotpi_echo_error "unable to access project ${project}"
|
|
103
|
-
} )"
|
|
104
|
-
if [ -z "$project_path" ] ; then
|
|
105
|
-
exit 1
|
|
106
|
-
fi
|
|
107
|
-
|
|
108
|
-
local_path="$( (cd -- "$(dirname -- "$0")" && pwd) 2> /dev/null || {
|
|
109
|
-
dotpi_echo_error "unable to access local path $(dirname -- "$0")"
|
|
110
|
-
} )"
|
|
111
|
-
if [ -z "$local_path" ] ; then
|
|
112
|
-
exit 1
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
# script in "bin"
|
|
116
|
-
DOTPI_ROOT="${local_path}/.."
|
|
117
|
-
|
|
118
|
-
source "${DOTPI_ROOT}/share/dotpi_init.bash"
|
|
119
|
-
|
|
120
|
-
tmp_path="${project_path}/tmp"
|
|
121
|
-
mkdir -p -- "$tmp_path"
|
|
122
|
-
|
|
123
|
-
# self log
|
|
124
|
-
log_file="${tmp_path}/${_dotpi_command}_$(date +"%Y%m%d-%H%M%S").log"
|
|
125
|
-
dotpi_echo_info "Log file: ${log_file}"
|
|
126
|
-
exec &> >(dotpi_log "$log_file")
|
|
127
|
-
|
|
128
|
-
file_system_mirror="${tmp_path}/file-system"
|
|
129
|
-
rm -rf "$file_system_mirror"
|
|
130
|
-
mkdir -p -- "$file_system_mirror"
|
|
131
|
-
|
|
132
|
-
dotpi_echo_info "Filesystem mirror: ${file_system_mirror}"
|
|
133
|
-
|
|
134
|
-
tar_options=()
|
|
135
|
-
while read pattern ; do
|
|
136
|
-
|
|
137
|
-
# avoid empty pattern
|
|
138
|
-
if [ -z "$pattern" ] ; then
|
|
139
|
-
continue
|
|
140
|
-
fi
|
|
141
|
-
|
|
142
|
-
tar_options+=( '--exclude' "${pattern}" )
|
|
143
|
-
done < "${DOTPI_ROOT}/etc/dotpi_tarignore"
|
|
144
|
-
|
|
145
|
-
# regular files only
|
|
146
|
-
if [[ "$(uname)" == "Darwin" ]] ; then
|
|
147
|
-
tar_options+=( '--no-mac-metadata' )
|
|
148
|
-
fi
|
|
149
|
-
tar_options+=( '--no-xattrs' )
|
|
150
|
-
|
|
151
|
-
#### copy defaults from dotpi_root
|
|
152
|
-
|
|
153
|
-
source_path="$DOTPI_ROOT"
|
|
154
|
-
destination_path="${file_system_mirror}/opt/dotpi"
|
|
155
|
-
mkdir -p -- "$destination_path"
|
|
156
|
-
(set -o pipefail ; \
|
|
157
|
-
cd -- "$source_path" && tar c "${tar_options[@]}" '.' \
|
|
158
|
-
| tar x -C "$destination_path") || {
|
|
159
|
-
dotpi_echo_error "Error while copying defaults from ${source_path} to ${destination_path}"
|
|
160
|
-
exit 1
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
#### copy project configuration
|
|
164
|
-
|
|
165
|
-
source_path="$project_path"
|
|
166
|
-
destination_path="${file_system_mirror}/opt/dotpi/etc"
|
|
167
|
-
mkdir -p -- "$destination_path"
|
|
168
|
-
source_file_path="${source_path}/dotpi_project.bash"
|
|
169
|
-
destination_file_path="${destination_path}/dotpi_environment_project.bash"
|
|
170
|
-
if [ -r "$source_file_path" ] ; then
|
|
171
|
-
cp -- "$source_file_path" "$destination_file_path"
|
|
172
|
-
fi
|
|
173
|
-
|
|
174
|
-
#### select instance
|
|
175
|
-
|
|
176
|
-
# keep reference of file to increment at the end
|
|
177
|
-
environment_tmp_file="${tmp_path}/dotpi_tmp.bash"
|
|
178
|
-
dotpi_source_if_available "$environment_tmp_file"
|
|
179
|
-
|
|
180
|
-
if [ -n "$instance_number" ] ; then
|
|
181
|
-
# from command-line
|
|
182
|
-
dotpi_instance_number="$instance_number"
|
|
183
|
-
else
|
|
184
|
-
# from environment_tmp
|
|
185
|
-
if [ -z "$dotpi_instance_number" ] ; then
|
|
186
|
-
dotpi_instance_number=1
|
|
187
|
-
fi
|
|
188
|
-
|
|
189
|
-
echo ''
|
|
190
|
-
echo '##########################################################'
|
|
191
|
-
echo ''
|
|
192
|
-
echo " Please type instance number, or type enter for ${dotpi_instance_number}"
|
|
193
|
-
echo -n ' '
|
|
194
|
-
|
|
195
|
-
read -r user_instance_number
|
|
196
|
-
if [ -n "$user_instance_number" ] ; then
|
|
197
|
-
dotpi_instance_number="${user_instance_number}"
|
|
198
|
-
fi
|
|
199
|
-
|
|
200
|
-
echo ''
|
|
201
|
-
echo '##########################################################'
|
|
202
|
-
echo ''
|
|
203
|
-
fi
|
|
204
|
-
|
|
205
|
-
# remove any padding zero to avoid octal interpretation (sic)
|
|
206
|
-
dotpi_instance_number="$((10#${dotpi_instance_number}))"
|
|
207
|
-
|
|
208
|
-
#### copy instance over-rides
|
|
209
|
-
|
|
210
|
-
source_path="$project_path"
|
|
211
|
-
destination_path="${file_system_mirror}/opt/dotpi/etc"
|
|
212
|
-
mkdir -p -- "$destination_path"
|
|
213
|
-
source_file_path="${source_path}/dotpi_instance_$(printf "%03d" "${dotpi_instance_number}").bash"
|
|
214
|
-
destination_file_path="${destination_path}/dotpi_environment_instance.bash"
|
|
215
|
-
if [ -r "$source_file_path" ] ; then
|
|
216
|
-
dotpi_echo_info "Using instance-specific configuration ${source_file_path}"
|
|
217
|
-
cp -- "$source_file_path" "$destination_file_path"
|
|
218
|
-
fi
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
####################################################
|
|
222
|
-
# mirror should be complete, now: switch to mirror #
|
|
223
|
-
####################################################
|
|
224
|
-
|
|
225
|
-
DOTPI_ROOT="${file_system_mirror}/opt/dotpi"
|
|
226
|
-
source "${DOTPI_ROOT}/share/dotpi_init.bash"
|
|
227
|
-
|
|
228
|
-
######## project name
|
|
229
|
-
|
|
230
|
-
destination_path="${DOTPI_ROOT}/etc"
|
|
231
|
-
destination_file_path="${destination_path}/dotpi_environment_project.bash"
|
|
232
|
-
|
|
233
|
-
# default project name is directory of project
|
|
234
|
-
if [[ -z "$dotpi_project_name" ]] ; then
|
|
235
|
-
dotpi_project_name="$(basename "$project_path")"
|
|
236
|
-
dotpi_echo_warning "Project name not found. Using project folder name: ${dotpi_project_name}"
|
|
237
|
-
dotpi_configuration_write --file "$destination_file_path" --key "dotpi_project_name" --value "$dotpi_project_name"
|
|
238
|
-
fi
|
|
239
|
-
|
|
240
|
-
######## read extra files
|
|
241
|
-
|
|
242
|
-
if [ -z "$dotpi_hostname_prefix" ] ; then
|
|
243
|
-
dotpi_echo_error "Bad dotpi_hostname_prefix: ${dotpi_hostname_prefix}"
|
|
244
|
-
echo "Check ${project_path}/dotpi_project.bash"
|
|
245
|
-
exit 1
|
|
246
|
-
fi
|
|
247
|
-
|
|
248
|
-
dotpi_instance_hostname="${dotpi_hostname_prefix}-${dotpi_project_name}-$(printf "%03d" "${dotpi_instance_number}")"
|
|
249
|
-
if (( $? != 0 )) ; then
|
|
250
|
-
dotpi_echo_error "Bad dotpi_instance_number: ${dotpi_instance_number}"
|
|
251
|
-
exit 1
|
|
252
|
-
fi
|
|
253
|
-
dotpi_echo_info "Instance hostname: ${dotpi_instance_hostname}"
|
|
254
|
-
|
|
255
|
-
destination_file="${DOTPI_ROOT}/etc/dotpi_environment_instance.bash"
|
|
256
|
-
dotpi_configuration_write --file "$destination_file" --key 'dotpi_instance_number' --value "$dotpi_instance_number"
|
|
257
|
-
dotpi_configuration_write --file "$destination_file" --key 'dotpi_instance_hostname' --value "$dotpi_instance_hostname"
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
### secrets for password
|
|
261
|
-
|
|
262
|
-
source_file="${project_path}/dotpi_secrets.bash"
|
|
263
|
-
destination_file="${DOTPI_ROOT}/etc/dotpi_environment_project.bash"
|
|
264
|
-
if ! [ -r "$source_file" ] ; then
|
|
265
|
-
dotpi_echo_error "unable to read secrets file ${source_file}"
|
|
266
|
-
exit 1
|
|
267
|
-
else
|
|
268
|
-
source "$source_file"
|
|
269
|
-
|
|
270
|
-
if [ -z "$dotpi_password" ] ; then
|
|
271
|
-
dotpi_echo_error "You must define a password: set dotpi_password in ${source_file} to a non-empty string."
|
|
272
|
-
exit 1
|
|
273
|
-
else
|
|
274
|
-
hash="$(openssl passwd -1 "$dotpi_password")"
|
|
275
|
-
dotpi_configuration_write --file "$destination_file" --key 'dotpi_password_hash' --value "$hash"
|
|
276
|
-
fi
|
|
277
|
-
fi
|
|
278
|
-
|
|
279
|
-
### secrets for ssh public keys
|
|
280
|
-
|
|
281
|
-
source_path="${project_path}/ssh"
|
|
282
|
-
destination_path="${DOTPI_ROOT}/etc/ssh"
|
|
283
|
-
mkdir -p -- "$destination_path"
|
|
284
|
-
if [ -d "$source_path" ] && [ -r "$source_path" ] ; then
|
|
285
|
-
(set -o pipefail ; \
|
|
286
|
-
cd -- "$source_path" && tar c "${tar_options[@]}" *.pub \
|
|
287
|
-
| tar x -C "$destination_path") || {
|
|
288
|
-
dotpi_echo_error "No public key found in ${source_path}"
|
|
289
|
-
exit 1
|
|
290
|
-
}
|
|
291
|
-
fi
|
|
292
|
-
|
|
293
|
-
### secrets for NetworkManager connections from project
|
|
294
|
-
|
|
295
|
-
source_path="${project_path}/network"
|
|
296
|
-
destination_path="${DOTPI_ROOT}/etc/network"
|
|
297
|
-
mkdir -p -- "$destination_path"
|
|
298
|
-
if [ -d "$source_path" ] && [ -r "$source_path" ] ; then
|
|
299
|
-
(set -o pipefail ; \
|
|
300
|
-
cd -- "$source_path" && tar c "${tar_options[@]}" *.nmconnection \
|
|
301
|
-
| tar x -C "$destination_path") || {
|
|
302
|
-
dotpi_echo_error "No network connection found in ${source_path}"
|
|
303
|
-
exit 1
|
|
304
|
-
}
|
|
305
|
-
fi
|
|
306
|
-
|
|
307
|
-
# update connections in DOTPI_ROOT
|
|
308
|
-
|
|
309
|
-
if ! $(wpa_passphrase test 12345678 > /dev/null 2>&1) ; then
|
|
310
|
-
dotpi_echo_warning "Network password won't be salted, 'wpa_passphrase' is needed to salt passwords."
|
|
311
|
-
else
|
|
312
|
-
|
|
313
|
-
for file in "${destination_path}"/*.nmconnection ; do
|
|
314
|
-
key='wifi-security.psk'
|
|
315
|
-
psk="$(dotpi_connection_read --file "$file" --key "$key")"
|
|
316
|
-
|
|
317
|
-
# psk present and not salted
|
|
318
|
-
if (( ${#psk} > 0 && ${#psk} < 64 )) ; then
|
|
319
|
-
key='wifi.ssid'
|
|
320
|
-
ssid="$(dotpi_connection_read --file "$file" --key "$key")"
|
|
321
|
-
passphrase="$(wpa_passphrase "$ssid" "$psk" | dotpi_configuration_read --key 'psk' )"
|
|
322
|
-
key='wifi-security.psk'
|
|
323
|
-
dotpi_connection_write --file "$file" --key "$key" --value "$passphrase"
|
|
324
|
-
fi
|
|
325
|
-
|
|
326
|
-
done
|
|
327
|
-
fi
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
######## SD card
|
|
331
|
-
|
|
332
|
-
bootfs_name="bootfs"
|
|
333
|
-
|
|
334
|
-
if [[ "$(uname)" =~ "Darwin" ]] ; then
|
|
335
|
-
echo ""
|
|
336
|
-
echo "MacOS host detected"
|
|
337
|
-
echo ""
|
|
338
|
-
|
|
339
|
-
# try to mount if unmounted (but not ejected)
|
|
340
|
-
if type -P diskutil ; then
|
|
341
|
-
diskutil mount "$bootfs_name"
|
|
342
|
-
fi
|
|
343
|
-
|
|
344
|
-
# avoid spotlight errors
|
|
345
|
-
bootfs_path="$(find /Volumes -name "$bootfs_name" 2> /dev/null)"
|
|
346
|
-
elif [[ "$(uname -a)" =~ "Microsoft" ]] ; then
|
|
347
|
-
echo ""
|
|
348
|
-
echo "Windows Subsystem for Linux system detected"
|
|
349
|
-
echo ""
|
|
350
|
-
|
|
351
|
-
bootfs_mount_reference=($(findmnt -lo source,target | grep "$bootfs_name"))
|
|
352
|
-
if ! [[ -n "$bootfs_mount_reference" ]] ; then
|
|
353
|
-
# not there, mount
|
|
354
|
-
|
|
355
|
-
bootfs_mount_source="${bootfs_drive_letter^^}:\\"
|
|
356
|
-
bootfs_mount_target="${tmp_path}/${bootfs_name}"
|
|
357
|
-
mkdir -p "$bootfs_mount_target"
|
|
358
|
-
mount -t drvfs "$bootfs_mount_source" "$bootfs_mount_target" || {
|
|
359
|
-
dotpi_echo_error "Unable to mount ${bootfs_mount_source} to ${bootfs_mount_target}"
|
|
360
|
-
}
|
|
361
|
-
fi
|
|
362
|
-
|
|
363
|
-
bootfs_mount_reference=($(findmnt -lo source,target | grep "$bootfs_name"))
|
|
364
|
-
if [[ -n "$bootfs_mount_reference" ]] ; then
|
|
365
|
-
bootfs_mount_source="${bootfs_mount_reference[0]}"
|
|
366
|
-
bootfs_mount_target="${bootfs_mount_reference[1]}"
|
|
367
|
-
bootfs_path="$bootfs_mount_target"
|
|
368
|
-
else
|
|
369
|
-
bootfs_path=""
|
|
370
|
-
rmdir "$bootfs_mount_target"
|
|
371
|
-
fi
|
|
372
|
-
|
|
373
|
-
elif [[ "$(uname)" =~ "Linux" ]] ; then
|
|
374
|
-
echo ""
|
|
375
|
-
echo "Linux system detected"
|
|
376
|
-
echo ""
|
|
377
|
-
|
|
378
|
-
# try to mount if unmounted (but not ejected)
|
|
379
|
-
if type -P udisksctl ; then
|
|
380
|
-
udisksctl mount --block-device "/dev/disk/by-label/${bootfs_name}" 2> /dev/null
|
|
381
|
-
fi
|
|
382
|
-
|
|
383
|
-
bootfs_path="$(lsblk --output MOUNTPOINT | grep "$bootfs_name")"
|
|
384
|
-
else
|
|
385
|
-
echo ""
|
|
386
|
-
echo "Unknown system detected"
|
|
387
|
-
echo ""
|
|
388
|
-
echo
|
|
389
|
-
echo "Please adapt for your environment and send us feedback."
|
|
390
|
-
exit 1
|
|
391
|
-
fi
|
|
392
|
-
|
|
393
|
-
if [ ! -d "$bootfs_path" ] ; then
|
|
394
|
-
echo ""
|
|
395
|
-
echo "############################################################"
|
|
396
|
-
echo ""
|
|
397
|
-
echo " Please mount SD card and try again."
|
|
398
|
-
echo ""
|
|
399
|
-
echo "############################################################"
|
|
400
|
-
echo ""
|
|
401
|
-
exit 1
|
|
402
|
-
fi
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
######### config.txt
|
|
406
|
-
|
|
407
|
-
config_filename='config.txt'
|
|
408
|
-
config_file="${project}/${config_filename}"
|
|
409
|
-
destination_path="${DOTPI_ROOT}/etc"
|
|
410
|
-
|
|
411
|
-
mkdir -p -- "$destination_path"
|
|
412
|
-
|
|
413
|
-
if [ -r "$config_file" ] ; then
|
|
414
|
-
echo "using project config file ${config_file}"
|
|
415
|
-
else
|
|
416
|
-
config_file="${bootfs_path}/${config_filename}"
|
|
417
|
-
echo "# copy config file from imager"
|
|
418
|
-
fi
|
|
419
|
-
|
|
420
|
-
cp -- "$config_file" "$destination_path"
|
|
421
|
-
|
|
422
|
-
config_file="${destination_path}/${config_filename}"
|
|
423
|
-
|
|
424
|
-
echo "# edit ${config_file}"
|
|
425
|
-
|
|
426
|
-
# keep quotes here to keep quotes hereafter
|
|
427
|
-
cat >> "${config_file}" << EOF
|
|
428
|
-
|
|
429
|
-
############
|
|
430
|
-
# dotpi
|
|
431
|
-
#
|
|
432
|
-
|
|
433
|
-
[all]
|
|
434
|
-
|
|
435
|
-
EOF
|
|
436
|
-
|
|
437
|
-
if [[ "$dotpi_word_size" == "32" ]] ; then
|
|
438
|
-
word_size="$(dotpi_file_word_size "${bootfs_path}/start.elf" )"
|
|
439
|
-
if [[ "$word_size" == "32" ]] ; then
|
|
440
|
-
|
|
441
|
-
file="$config_file"
|
|
442
|
-
key="arm_64bits"
|
|
443
|
-
|
|
444
|
-
# comment original value
|
|
445
|
-
dotpi_configuration_comment --file "$file" --key "$key"
|
|
446
|
-
dotpi_configuration_write \
|
|
447
|
-
--file "$file" --key "$key" \
|
|
448
|
-
--value "0" --prepend-line-if-new '# true 32bit system'
|
|
449
|
-
fi
|
|
450
|
-
fi
|
|
451
|
-
|
|
452
|
-
######### audio device
|
|
453
|
-
|
|
454
|
-
# set model before, as it will select jackd configuration
|
|
455
|
-
dotpi_audio_device_select --model "$dotpi_audio_device" --config "$config_file"
|
|
456
|
-
|
|
457
|
-
# copy configuration files from project for over-rides
|
|
458
|
-
source_path="${project_path}/jackd"
|
|
459
|
-
destination_path="${DOTPI_ROOT}/share/jackd"
|
|
460
|
-
mkdir -p -- "$destination_path"
|
|
461
|
-
if [ -d "$source_path" ] && [ -r "$source_path" ] ; then
|
|
462
|
-
(set -o pipefail ; \
|
|
463
|
-
cd -- "$source_path" && tar c "${tar_options[@]}" '.' \
|
|
464
|
-
| tar x -C "$destination_path") || {
|
|
465
|
-
dotpi_echo_error "Unable to install files from ${source_path}"
|
|
466
|
-
exit 1
|
|
467
|
-
}
|
|
468
|
-
fi
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
# back-up imager config
|
|
472
|
-
|
|
473
|
-
destination_filename="imager_${config_filename}"
|
|
474
|
-
|
|
475
|
-
# install config.txt to /boot to be ready for first run
|
|
476
|
-
cp -- "$config_file" "$bootfs_path"
|
|
477
|
-
|
|
478
|
-
######### configure first run
|
|
479
|
-
|
|
480
|
-
echo "# set-up first run"
|
|
481
|
-
|
|
482
|
-
source_file_path="${bootfs_path}/firstrun.sh"
|
|
483
|
-
if [ -f "$source_file_path" ] ; then
|
|
484
|
-
# back-up imager firstrun.sh
|
|
485
|
-
destination_filename='imager_firstrun.sh'
|
|
486
|
-
# keep a copy on bootfs
|
|
487
|
-
destination_path="${bootfs_path}/dotpi"
|
|
488
|
-
|
|
489
|
-
mkdir -p -- "$destination_path"
|
|
490
|
-
|
|
491
|
-
if [ -r "${destination_path}/${destination_filename}" ] ; then
|
|
492
|
-
dotpi_echo_warning "Keep existing imager first-run script: ${destination_path}/${destination_filename}"
|
|
493
|
-
else
|
|
494
|
-
cp -- "$source_file_path" "${destination_path}/${destination_filename}"
|
|
495
|
-
|
|
496
|
-
destination_path="${DOTPI_ROOT}/etc"
|
|
497
|
-
mkdir -p -- "$destination_path"
|
|
498
|
-
cp -- "$source_file_path" "${destination_path}/${destination_filename}"
|
|
499
|
-
fi
|
|
500
|
-
else
|
|
501
|
-
dotpi_echo_warning "firstrun.sh not found"
|
|
502
|
-
fi
|
|
503
|
-
|
|
504
|
-
# configure cmdline.txt for firstun script, if not already here
|
|
505
|
-
source_file_name='cmdline.txt'
|
|
506
|
-
source_file_path="${bootfs_path}/${source_file_name}"
|
|
507
|
-
destination_path="${bootfs_path}/dotpi"
|
|
508
|
-
pattern='systemd.run=/boot/firstrun.sh'
|
|
509
|
-
pattern_escaped="$(dotpi_configuration_escape_string "$pattern")"
|
|
510
|
-
first_run_configured="$(perl -ne 'if (m/'"$pattern_escaped"'/) { print "1"; }' "$source_file_path")"
|
|
511
|
-
if (( first_run_configured != 1 )) ; then
|
|
512
|
-
dotpi_echo_info "Configuring firstrun in ${source_file_path}"
|
|
513
|
-
# keep a copy of originalc command-line
|
|
514
|
-
mkdir -p -- "$destination_path"
|
|
515
|
-
cp -- "$source_file_path" "${destination_path}/imager_${source_file_name}"
|
|
516
|
-
# append:run script and reboot on success
|
|
517
|
-
arguments=(
|
|
518
|
-
'systemd.run=/boot/firstrun.sh'
|
|
519
|
-
'systemd.run_success_action=reboot'
|
|
520
|
-
'systemd.unit=kernel-command-line.target'
|
|
521
|
-
)
|
|
522
|
-
pattern="${arguments[*]}"
|
|
523
|
-
pattern_escaped="$(dotpi_configuration_escape_string "$pattern")"
|
|
524
|
-
# do not append to a new line
|
|
525
|
-
# append a space to separate from previous arguments (extra does not hurt)
|
|
526
|
-
|
|
527
|
-
# windows error: Cannot complete in-place edit of tmp/bootfs/cmdline.txt
|
|
528
|
-
source_file_path_tmp="${tmp_path}/${source_file_name}"
|
|
529
|
-
cp "$source_file_path" "$source_file_path_tmp"
|
|
530
|
-
dotpi_sed 's/$/${1} '"$pattern_escaped"'/' -i -- "$source_file_path_tmp"
|
|
531
|
-
mv "$source_file_path_tmp" "$source_file_path"
|
|
532
|
-
fi
|
|
533
|
-
|
|
534
|
-
# replace first run with custom, that will over-ride imager settings
|
|
535
|
-
# run dotpi_firstrun.bash
|
|
536
|
-
cat > "${bootfs_path}/firstrun.sh" << "EOF"
|
|
537
|
-
#!/bin/bash
|
|
538
|
-
|
|
539
|
-
set +e
|
|
540
|
-
|
|
541
|
-
# since Raspberry Pi OS Bookworm
|
|
542
|
-
local_path='/boot/firmware'
|
|
543
|
-
|
|
544
|
-
if ! [ -d "$local_path" ] ; then
|
|
545
|
-
# for Raspberry Pi OS Bullseye
|
|
546
|
-
local_path='/boot'
|
|
547
|
-
fi
|
|
548
|
-
|
|
549
|
-
# log to boot partition to access it even on errors
|
|
550
|
-
log_file="${local_path}/firstrun-$(date +"%Y%m%d-%H%M%S").log"
|
|
551
|
-
|
|
552
|
-
clean_up() {
|
|
553
|
-
rm -f "${local_path}/firstrun.sh"
|
|
554
|
-
sed -i 's| systemd.run.*||g' "${local_path}/cmdline.txt"
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
(cd -- / && tar xz -m --no-same-owner --no-same-permissions --no-overwrite-dir -f "${local_path}/dotpi/file_system.tgz")
|
|
558
|
-
|
|
559
|
-
source_path="/opt/dotpi"
|
|
560
|
-
cd -- "$source_path" || { clean_up ; exit 1; }
|
|
561
|
-
"bin/dotpi_firstrun" "$log_file"
|
|
562
|
-
|
|
563
|
-
clean_up
|
|
564
|
-
|
|
565
|
-
exit 0
|
|
566
|
-
|
|
567
|
-
EOF
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
########## archive mirror to bootfs
|
|
571
|
-
|
|
572
|
-
echo "# archive mirror"
|
|
573
|
-
|
|
574
|
-
source_path="$file_system_mirror"
|
|
575
|
-
destination_path="${bootfs_path}/dotpi"
|
|
576
|
-
mkdir -p -- "$destination_path"
|
|
577
|
-
|
|
578
|
-
# create archive for installing, later
|
|
579
|
-
# this overcomes the limitiations of the FAT32 boot volume
|
|
580
|
-
tar cz "${tar_options[@]}" -C "${source_path}" '.' > "${destination_path}/file_system.tgz"
|
|
581
|
-
|
|
582
|
-
# un-mount
|
|
583
|
-
if type -P diskutil 2>&1 > /dev/null ; then
|
|
584
|
-
diskutil umount "$bootfs_name" || :
|
|
585
|
-
elif [[ -n "$bootfs_mount_source" ]] && [[ -n "$bootfs_mount_target" ]] ; then
|
|
586
|
-
umount "$bootfs_mount_source"
|
|
587
|
-
rmdir "$bootfs_mount_target"
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
echo ""
|
|
591
|
-
echo "####################################################"
|
|
592
|
-
echo ""
|
|
593
|
-
echo " Please eject SD card from Windows host."
|
|
594
|
-
echo ""
|
|
595
|
-
echo "####################################################"
|
|
596
|
-
echo ""
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
elif type -P udisksctl 2>&1 > /dev/null ; then
|
|
600
|
-
udisksctl unmount -b "/dev/disk/by-label/${bootfs_name}" 2>&1 > /dev/null
|
|
601
|
-
fi
|
|
602
|
-
|
|
603
|
-
dotpi_echo_info "Mirror of file-system is here: ${file_system_mirror}"
|
|
604
|
-
|
|
605
|
-
(( dotpi_instance_number++ ))
|
|
606
|
-
dotpi_configuration_write --file "$environment_tmp_file" --key dotpi_instance_number --value "$dotpi_instance_number"
|
|
607
|
-
|
|
608
|
-
echo ""
|
|
609
|
-
echo "####################################################"
|
|
610
|
-
echo ""
|
|
611
|
-
echo " Please put SD card in Raspberry Pi and power on."
|
|
612
|
-
echo ""
|
|
613
|
-
echo "####################################################"
|
|
614
|
-
echo ""
|
|
615
|
-
|
|
616
|
-
dotpi_echo_info "You can monitor the preparation of the system with the following command"
|
|
617
|
-
dotpi_echo_info "(You will have to wait until the network is ready.)"
|
|
618
|
-
dotpi_echo_info ''
|
|
619
|
-
dotpi_echo_info "ssh ${dotpi_user}@${dotpi_instance_hostname}.local 'tail -f /opt/dotpi/var/log/dotpi_prepare_system_*.log'"
|
|
620
|
-
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
set +e
|
|
4
|
-
|
|
5
|
-
# This script MUST be executed by `pi` user
|
|
6
|
-
FIRSTUSER="$(getent passwd 1000 | cut -d: -f1)"
|
|
7
|
-
if [[ $(whoami) != "${FIRSTUSER}" ]] ; then
|
|
8
|
-
echo "This script MUST be executed by pi user (or first user)"
|
|
9
|
-
exit 1
|
|
10
|
-
fi
|
|
11
|
-
|
|
12
|
-
DOTPI_ROOT="${DOTPI_ROOT:-/opt/dotpi}"
|
|
13
|
-
source "${DOTPI_ROOT}/share/dotpi_init.bash"
|
|
14
|
-
|
|
15
|
-
echo "Uninstall apt packages: ${dotpi_apt_uninstall[@]}"
|
|
16
|
-
dotpi_apt_get purge "${dotpi_apt_uninstall[@]}"
|
|
17
|
-
|
|
18
|
-
dotpi_apt_get clean
|
|
19
|
-
dotpi_apt_get autoremove -y
|
|
20
|
-
|
|
21
|
-
echo "Update and dist-upgrade"
|
|
22
|
-
dotpi_apt_get update
|
|
23
|
-
dotpi_apt_get dist-upgrade
|
|
24
|
-
|
|
25
|
-
echo "Install apt packages: ${dotpi_apt_install[@]}"
|
|
26
|
-
dotpi_apt_get install "${dotpi_apt_install[@]}"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
echo "Install Node.js"
|
|
30
|
-
|
|
31
|
-
word_size="$(dotpi_file_word_size "$(which file)" )"
|
|
32
|
-
if [[ $word_size == "32" ]] ; then
|
|
33
|
-
node_arch=armv7l
|
|
34
|
-
else
|
|
35
|
-
node_arch=arm64
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
(set -o pipefail ; curl -L https://bit.ly/n-install | bash -s -- -y -a "$node_arch" "$dotpi_node_version") && (
|
|
39
|
-
cat >> "${HOME}/.bashrc" << EOF
|
|
40
|
-
|
|
41
|
-
# dotpi: force the usage of -a for correct architecture
|
|
42
|
-
# (n relies on uname, which tells about the kernel, not the executables)
|
|
43
|
-
|
|
44
|
-
alias n="n -a ${node_arch}"
|
|
45
|
-
|
|
46
|
-
EOF
|
|
47
|
-
<<<<<<< HEAD
|
|
48
|
-
=======
|
|
49
|
-
|
|
50
|
-
>>>>>>> origin/main
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
source "${HOME}/.bashrc"
|
|
54
|
-
|
|
55
|
-
echo "Install Jackd daemon"
|
|
56
|
-
|
|
57
|
-
sudo dpkg-reconfigure -f noninteractive -p high jackd2
|
|
58
|
-
|
|
59
|
-
source_file="${DOTPI_ROOT}/share/limits/audio.conf"
|
|
60
|
-
destination_path='/etc/security/limits.d'
|
|
61
|
-
if [ -r "$source_file" ] ; then
|
|
62
|
-
sudo mkdir -p "$destination_path"
|
|
63
|
-
sudo cp "$source_file" "$destination_path"
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
dotpi_echo_warning "You should close all active session windows for jackd high priority"
|
|
67
|
-
|
|
68
|
-
dotpi_daemon_install "${DOTPI_ROOT}/share/jackd/jackd.service"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
echo "Install dotpi manager"
|
|
72
|
-
destination_path="${DOTPI_ROOT}/share/dotpi-manager/runtime"
|
|
73
|
-
sudo mkdir -p "$destination_path"
|
|
74
|
-
sudo chown "$FIRSTUSER" -R "$destination_path"
|
|
75
|
-
git clone https://github.com/ircam-ismm/dotpi-manager.git "$destination_path"
|
|
76
|
-
(
|
|
77
|
-
cd "${DOTPI_ROOT}/share/dotpi-manager/runtime"
|
|
78
|
-
npm install
|
|
79
|
-
npm run build
|
|
80
|
-
)
|
|
81
|
-
dotpi_daemon_install "${DOTPI_ROOT}/share/dotpi-manager/dotpi-manager.service"
|
|
82
|
-
|