Commit 6feb0f3
committed
2025-09-16 installer and menu improvements - master branch
Changes to `install.sh`:
1. Bumps version number to 2025v01.
2. Rather than defaulting to `~/IOTstack` or requiring the `IOTSTACK`
environment variable to point to the correct directory, now gives
precedence to the directory where `install.sh` is running. Maintains
backwards compatibility with earlier methods.
3. Adds `dialout` to groups list. This is needed for `deconz` and should
probably always have been present. Equivalent PiBuilder change made.
4. Adds `version_json()` function which returns JSON structure with:
- version number (as above)
- commit ID of `install.sh`
- exit code of installer script
5. Adds `should_run_installer()` which can be invoked via:
```
$ ./install.sh should_run_installer
```
returning either "false" or "true". In essence, if `install.sh` is
updated, its commit-ID will change and that will cause
`should_run_installer` to return "true". The condition will
persist until the installer is run to completion successfully and
updates `~/IOTstack/.new_install` with the matching commit-ID.
6. Also supports:
```
$ ./install.sh version
```
which displays a JSON string containing the version (eg `2025v01'`),
commit-ID of the current file, plus a return code of zero.
7. `handle_exit()` now writes above JSON structure to `.new_install`
rather than either the exit code (current) or touching the file
(older). The menu only senses the presence/absence of `.new_install`
so it doesn't care about the contents.
8. Trixie has removed `/etc/timezone` so it is no longer possible to
initialise `TZ` in `~/IOTstack.env` from that source. Now invokes:
```
timedatectl show --value --property=Timezone
```
This is backwards-compatible (tested on Bullseye and Bookworm).
9. Adds `pwgen` to dependencies (needed for a separate project I'm
working on).
Changes to `menu.sh` (new menu):
1. Removes duplicate-named but different implementations of
`user_in_group()` functions. Functionality replaced with
`do_required_groups_checks()` which checks for `dialout` membership
as well as `docker` and `bluetooth` (as now).
2. `do_required_groups_checks()` called wherever older code did explicit
checks for `docker` and `bluetooth`.
3. Adds do_installer_checks() which queries `install.sh` to see if it
should be re-run. If yes, presents a dialog asking for permission
to proceed.
Signed-off-by: Phill Kelley <[email protected]>1 parent 863b613 commit 6feb0f3
2 files changed
+185
-96
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 4 | + | |
15 | 5 | | |
16 | 6 | | |
17 | 7 | | |
| |||
24 | 14 | | |
25 | 15 | | |
26 | 16 | | |
27 | | - | |
28 | | - | |
| 17 | + | |
| 18 | + | |
29 | 19 | | |
30 | | - | |
31 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
| |||
53 | 47 | | |
54 | 48 | | |
55 | 49 | | |
56 | | - | |
| 50 | + | |
57 | 51 | | |
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
61 | 55 | | |
62 | 56 | | |
63 | 57 | | |
64 | | - | |
| 58 | + | |
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
70 | 183 | | |
71 | 184 | | |
72 | 185 | | |
| |||
107 | 220 | | |
108 | 221 | | |
109 | 222 | | |
110 | | - | |
| 223 | + | |
111 | 224 | | |
112 | 225 | | |
113 | 226 | | |
| |||
351 | 464 | | |
352 | 465 | | |
353 | 466 | | |
| 467 | + | |
354 | 468 | | |
355 | | - | |
| 469 | + | |
356 | 470 | | |
357 | 471 | | |
358 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 23 | | |
36 | 24 | | |
37 | 25 | | |
| |||
104 | 92 | | |
105 | 93 | | |
106 | 94 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 95 | | |
121 | 96 | | |
122 | 97 | | |
| |||
134 | 109 | | |
135 | 110 | | |
136 | 111 | | |
| 112 | + | |
137 | 113 | | |
138 | 114 | | |
139 | 115 | | |
| |||
190 | 166 | | |
191 | 167 | | |
192 | 168 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
201 | 178 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
207 | 193 | | |
208 | 194 | | |
209 | 195 | | |
| |||
256 | 242 | | |
257 | 243 | | |
258 | 244 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 245 | + | |
272 | 246 | | |
273 | 247 | | |
274 | 248 | | |
| |||
296 | 270 | | |
297 | 271 | | |
298 | 272 | | |
299 | | - | |
300 | | - | |
301 | 273 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 274 | + | |
306 | 275 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
311 | 298 | | |
312 | | - | |
313 | | - | |
314 | 299 | | |
| 300 | + | |
315 | 301 | | |
316 | 302 | | |
317 | 303 | | |
| |||
322 | 308 | | |
323 | 309 | | |
324 | 310 | | |
325 | | - | |
| 311 | + | |
326 | 312 | | |
327 | 313 | | |
328 | 314 | | |
| 315 | + | |
329 | 316 | | |
330 | 317 | | |
331 | 318 | | |
| |||
348 | 335 | | |
349 | 336 | | |
350 | 337 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 338 | + | |
364 | 339 | | |
365 | 340 | | |
366 | 341 | | |
| |||
0 commit comments