Skip to content

Commit eb04c38

Browse files
authored
Merge pull request SensorsIot#768 from Paraphraser/20240424-install-script-master
2024-04-24 install script - master branch
2 parents e173b7f + b607203 commit eb04c38

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

docs/Basic_setup/Troubleshooting.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,51 +187,48 @@ If problems persist even when the `dhcpcd` patch is in place, you *may* have an
187187
4. Substitute the values of *«idVendor»* and *«idProduct»* into the following command template:
188188

189189
``` console
190-
sed -i.bak '1s/^/usb-storage.quirks=«idVendor»:«idProduct»:u /' /boot/cmdline.txt
190+
sed -i.bak '1s/^/usb-storage.quirks=«idVendor»:«idProduct»:u /' "$CMDLINE"
191191
```
192192

193193
This is known as a "quirks string". Given the `dmesg` output above, the string would be:
194194

195195
``` console
196-
sed -i.bak '1s/^/usb-storage.quirks=f0a1:f1b2:u /' /boot/cmdline.txt
196+
sed -i.bak '1s/^/usb-storage.quirks=f0a1:f1b2:u /' "$CMDLINE"
197197
```
198198

199199
Make sure that you keep the <kbd>space</kbd> between the `:u` and `/'`. You risk breaking your system if that <kbd>space</kbd> is not there.
200200

201-
5. Run the command you prepared in step 4 using `sudo`:
201+
5. Run these commands - the second line is the one you prepared in step 4 using `sudo`:
202202

203203
``` console
204-
$ sudo sed -i.bak '1s/^/usb-storage.quirks=f0a1:f1b2:u /' /boot/cmdline.txt
204+
$ CMDLINE="/boot/firmware/cmdline.txt" && [ -e "$CMDLINE" ] || CMDLINE="/boot/cmdline.txt"
205+
$ sudo sed -i.bak '1s/^/usb-storage.quirks=f0a1:f1b2:u /' "$CMDLINE"
205206
```
206207

207208
The command:
208209

209-
- makes a backup copy of `/boot/cmdline.txt` as `/boot/cmdline.txt.bak`
210-
- inserts the quirks string at the start of `/boot/cmdline.txt`.
210+
- makes a backup copy of `cmdline.txt` as `cmdline.txt.bak`
211+
- inserts the quirks string at the start of `cmdline.txt`.
211212

212213
You can confirm the result as follows:
213214

214215
* display the original (baseline reference):
215216

216217
```
217-
$ cat /boot/cmdline.txt.bak
218+
$ cat "$CMDLINE.bak"
218219
console=serial0,115200 console=tty1 root=PARTUUID=06c69364-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
219220
```
220221

221222
* display the modified version:
222223

223224
```
224-
$ cat /boot/cmdline.txt
225+
$ cat "$CMDLINE"
225226
usb-storage.quirks=f0a1:f1b2:u console=serial0,115200 console=tty1 root=PARTUUID=06c69364-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
226227
```
227228

228229
6. Shutdown your Pi.
229230
7. Connect your SSD to a USB3 port and apply power.
230231

231-
Note:
232-
233-
* If your Pi fails to boot and you suspect that the quirks string might be the culprit, don't forget that you can always mount the `boot` partition on a support host (Linux, macOS, Windows) where you can undo the change by replacing `cmdline.txt` with `cmdline.txt.bak`.
234-
235232
There is more information about this problem [on the Raspberry Pi forum](https://forums.raspberrypi.com/viewtopic.php?t=245931&sid=66012d5cf824004bbb414cb84874c8a4).
236233

237234
## Getting a clean slate

docs/Basic_setup/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ monitoring of docker resource usage by the telegraf container.
151151
Enable by running (takes effect after reboot):
152152

153153
``` console
154-
$ echo $(cat /boot/cmdline.txt) cgroup_memory=1 cgroup_enable=memory | sudo tee /boot/cmdline.txt
154+
$ CMDLINE="/boot/firmware/cmdline.txt" && [ -e "$CMDLINE" ] || CMDLINE="/boot/cmdline.txt"
155+
$ echo $(cat "$CMDLINE") cgroup_memory=1 cgroup_enable=memory | sudo tee "$CMDLINE"
155156
$ sudo reboot
156157
```
157158

docs/Containers/Telegraf.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,12 @@ $ docker-compose restart telegraf
219219
* `inputs.docker.conf` instructs Telegraf to collect metrics from Docker. Requires kernel control
220220
groups to be enabled to collect memory usage data. If not done during initial installation,
221221
enable by running (reboot required):
222-
``` console
223-
$ echo $(cat /boot/cmdline.txt) cgroup_memory=1 cgroup_enable=memory | sudo tee /boot/cmdline.txt
224-
```
222+
223+
``` console
224+
$ CMDLINE="/boot/firmware/cmdline.txt" && [ -e "$CMDLINE" ] || CMDLINE="/boot/cmdline.txt"
225+
$ echo $(cat "$CMDLINE") cgroup_memory=1 cgroup_enable=memory | sudo tee "$CMDLINE"
226+
```
227+
225228
* `inputs.cpu_temp.conf` collects cpu temperature.
226229

227230
### Applying optional additions { #optionalAdditions }

install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ sudo rm -rf "$IOTSTACK_MENU_VENV_DIR"
403403
#----------------------------------------------------------------------
404404

405405
# set cmdline options (if possible - Raspberry Pi dependency)
406-
TARGET="/boot/cmdline.txt"
406+
TARGET="/boot/firmware/cmdline.txt"
407+
[ -e "$TARGET" ] || TARGET="/boot/cmdline.txt"
407408
if [ -e "$TARGET" ] ; then
408409
echo -e -n "\nChecking Raspberry Pi boot-time options - "
409410
unset APPEND

0 commit comments

Comments
 (0)