Skip to content

Commit 743b5d7

Browse files
author
Alasdair Allan
authored
Merge pull request raspberrypi#2701 from raspberrypi/develop
Push to production
2 parents 7a650c9 + 323bb77 commit 743b5d7

File tree

3 files changed

+53
-20
lines changed

3 files changed

+53
-20
lines changed

documentation/asciidoc/accessories/audio/getting_started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Ctrl X, Y and Enter to save, then reboot your device.
125125

126126
The final step is to ensure that everything is operating as expected. Press the button and release it when you hear the burp. The recording will now begin for a period of five seconds. Once you have released the button, press it briefly again to hear the recording. Repeat this process as many times as you wish, and your sounds will be played at random. You can delete all recordings by pressing and holding the button, keeping the button pressed during the first burp and recording process, and releasing it after at least 20 seconds, at which point you will hear another burp sound confirming that the recordings have been deleted.
127127

128-
video::aUD_rcpc08I[youtube]
128+
video::BjXERzu8nS0[youtube]
129129

130130
=== Next steps
131131

documentation/asciidoc/computers/config_txt/autoboot.adoc

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,50 @@ Set this property to `1` to load the normal `config.txt` and `boot.img` files in
2424
This enables the `tryboot` switch to be made at the partition level rather than the file-level without having to modify configuration files in the A/B partitions.
2525

2626

27-
=== A/B boot example
28-
In the following example partition `3` would be contain the pending OS upgrade and would be tested by rebooting in `tryboot` mode (`sudo reboot "0 tryboot"`).
29-
If the OS determines that the upgrade was successful then it would replace `autoboot.txt` swapping the partition numbers.
30-
Otherwise, if the system is reboot (e.g. watchdog or cold boot) then system would boot from partition `2` as usual.
27+
=== Example update flow for A/B booting
3128

32-
Since the `autoboot.txt` file is a single sector it will normally be possible to update this with a single sector update to the SD/EMMC.
29+
The following pseudo code shows how an hypothetical OS `Update Service` could use `tryboot` + `autoboot.txt` to perform an fail-safe OS upgrade.
3330

34-
`autoboot.txt`
31+
Initial `autoboot.txt`
3532
----
3633
[all]
3734
tryboot_a_b=1
3835
boot_partition=2
3936
[tryboot]
4037
boot_partition=3
4138
----
39+
40+
**Installing the update**
41+
42+
* System is powered on and boots to partition 2 by default.
43+
* An `Update Service` downloads the next version of the OS to partition 3.
44+
* The update is tested by rebooting to `tryboot` mode `reboot "0 tryboot"` where `0` means the default partition.
45+
46+
**Committing or cancelling the update**
47+
48+
* System boots from partition 3 because the `[tryboot]` filter evaluates to true in `tryboot mode`.
49+
* If tryboot is active (`/proc/device-tree/chosen/bootloader/tryboot == 1`)
50+
** If the current boot partition (`/proc/device-tree/chosen/bootloader/partition`) matches the `boot_partition` in the `[tryboot]` section of `autoboot.txt`
51+
*** The `Update Service` validates the system to verify that the update was successful.
52+
*** If the update was successful
53+
**** Replace `autoboot.txt` swapping the `boot_partition` configuration.
54+
**** Normal reboot - partition 3 is now the default boot partition.
55+
*** Else
56+
**** `Update Service` marks the update as failed e.g. it removes the update files.
57+
**** Normal reboot - partition 2 is still the default boot partition because the `tryboot` flag is automatically cleared.
58+
*** End if
59+
** End If
60+
* End If
61+
62+
Updated `autoboot.txt`
63+
----
64+
[all]
65+
tryboot_a_b=1
66+
boot_partition=3
67+
[tryboot]
68+
boot_partition=2
69+
----
70+
71+
**Notes**
72+
* It's not mandatory to reboot after updating `autoboot.txt`. However, the `Update Service` must be careful to avoid overwriting the current partition since `autoboot.txt` has already been modified to commit the last update..
73+
* See also: xref:configuration.adoc#device-trees-overlays-and-parameters[Device-tree parameters].

documentation/asciidoc/computers/configuration/device-tree.adoc

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,6 @@ As it is too time-consuming to document the individual overlays here, please ref
801801
=== Firmware parameters
802802
The firmware uses the special https://www.kernel.org/doc/html/latest/devicetree/usage-model.html#runtime-configuration[/chosen] node to pass parameters between the bootloader and/or firmware and the operating system.
803803

804-
`boot-mode` - 32-bit integer
805-
806-
The boot-mode used to load the kernel. See xref:raspberry-pi.adoc#BOOT_ORDER[BOOT_ORDER].
807-
808804
`overlay_prefix` - string
809805

810806
The xref:config_txt.adoc#overlay_prefix[overlay_prefix] string selected by `config.txt`.
@@ -813,14 +809,6 @@ The xref:config_txt.adoc#overlay_prefix[overlay_prefix] string selected by `conf
813809

814810
The xref:config_txt.adoc#os_prefix[os_prefix] string selected by `config.txt`.
815811

816-
`partition` - 32-bit integer
817-
818-
The partition number used during boot. If a `boot.img` ramdisk is loaded then this refers to partition that the ramdisk was loaded from rather than the partition number within the ramdisk.
819-
820-
`pm_rsts` - 32-bit integer
821-
822-
The value of the `PM_RSTS` register during boot.
823-
824812
`rpi-boardrev-ext` - 32-bit integer
825813

826814
The extended board revision code from xref:raspberry-pi.adoc#otp-register-and-bit-definitions[OTP row 33].
@@ -829,11 +817,24 @@ The extended board revision code from xref:raspberry-pi.adoc#otp-register-and-bi
829817

830818
The country code used used by https://github.com/raspberrypi-ui/piwiz[PiWiz] - Pi400 only.
831819

820+
==== Common bootloader properties `/chosen/bootloader`
821+
`boot-mode` - 32-bit integer
822+
823+
The boot-mode used to load the kernel. See xref:raspberry-pi.adoc#BOOT_ORDER[BOOT_ORDER].
824+
825+
`partition` - 32-bit integer
826+
827+
The partition number used during boot. If a `boot.img` ramdisk is loaded then this refers to partition that the ramdisk was loaded from rather than the partition number within the ramdisk.
828+
829+
`pm_rsts` - 32-bit integer
830+
831+
The value of the `PM_RSTS` register during boot.
832+
832833
`tryboot` - 32-bit integer
833834

834835
Set to `1` if the `tryboot` flag was set at boot.
835836

836-
==== BCM2711 bootloader properties `/chosen/bootloader`
837+
==== BCM2711 specific bootloader properties `/chosen/bootloader`
837838
The following properties are specific to BCM2711 SPI EEPROM bootloader.
838839

839840
`build_timestamp` - 32-bit integer

0 commit comments

Comments
 (0)