Skip to content

Commit d26c626

Browse files
merge upstream
2 parents 12835da + 9decc39 commit d26c626

10 files changed

+343
-151
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exec: &exec
22
name: build-tools/nerves-system-br
3-
version: 1.23.2
4-
elixir: 1.15.2-otp-26
3+
version: 1.27.0
4+
elixir: 1.16.2-otp-26
55

66
version: 2.1
77

CHANGELOG.md

+88
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,94 @@ follows:
1212
releases, and Linux kernel updates. They're also made to fix bugs and add
1313
features to the build infrastructure.
1414

15+
## v1.27.0
16+
17+
This is a major Buildroot update.
18+
19+
Please see the [nerves_system_br v1.27.0 release notes](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.26.0)
20+
for upgrade instructions if you've forked this system.
21+
22+
* Changes
23+
* The `libcamera` and `rpicam_apps` packages have been replaced with the
24+
Raspberry Pi-forked versions for better compatibility. Please see
25+
`nerves_system_br` release notes.
26+
27+
* Updated dependencies
28+
* Linux 6.1.73 (Raspberry Pi 20240124 release)
29+
* [nerves_system_br v1.27.0](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.27.0)
30+
* [Buildroot 2024.02](https://lore.kernel.org/buildroot/[email protected]/)
31+
* [Erlang/OTP 26.2.3](https://erlang.org/download/OTP-26.2.3.README)
32+
33+
## v1.26.0
34+
35+
This is a major Buildroot update.
36+
37+
Please see the [nerves_system_br v1.26.0 release notes](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.26.0)
38+
for upgrade instructions if you've forked this system.
39+
40+
* Updated dependencies
41+
* [Erlang/OTP 26.2.2](https://erlang.org/download/OTP-26.2.2.README)
42+
* [nerves_system_br v1.26.1](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.26.1)
43+
* [Buildroot 2023.11.1](https://lore.kernel.org/buildroot/[email protected]/T/)
44+
45+
## v1.25.2
46+
47+
This is a security/bug fix update.
48+
49+
* Package updates
50+
* [Erlang/OTP 26.2.1](https://erlang.org/download/OTP-26.2.1.README)
51+
* [nerves_heart 2.3.0](https://github.com/nerves-project/nerves_heart/releases/tag/v2.3.0)
52+
53+
## v1.25.1
54+
55+
This fixes an accidental regression in 1.25.0 with the Linux 6.1 update. The
56+
Linux configuration wasn't updated correctly and it didn't work. This release
57+
has the fixed configuration.
58+
59+
## v1.25.0
60+
61+
This is a major Buildroot, toolchain, and Linux kernel update that also adds
62+
support for using Scenic without customizing the system.
63+
64+
Please see [nerves_system_br v1.25.0 release notes](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.25.0)
65+
for upgrade instructions if you've forked this system.
66+
67+
* New features
68+
* Add libcairo for [Scenic](https://github.com/ScenicFramework/scenic) support
69+
70+
* Updated dependencies
71+
* Linux 6.1.63 (Raspberry Pi stable_20231123 release)
72+
* [nerves_system_br v1.25.2](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.25.2)
73+
* [Buildroot 2023.08.4](https://lore.kernel.org/buildroot/[email protected]/T/)
74+
* [Erlang/OTP 26.1.2](https://erlang.org/download/OTP-26.1.2.README)
75+
76+
## v1.24.1
77+
78+
This is a security/bug fix update.
79+
80+
* Package updates
81+
* [nerves_system_br v1.24.1](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.24.1)
82+
* [Erlang/OTP 26.1.1](https://erlang.org/download/OTP-26.1.1.README)
83+
* [Buildroot 2023.05.3](https://lore.kernel.org/buildroot/[email protected]/T/)
84+
85+
## v1.24.0
86+
87+
This is a Buildroot version update that appears to mostly contain bug and
88+
security fixes. It should be a low risk upgrade from v1.23.2.
89+
90+
* New features
91+
* Support factory reset, preventing firmware reverts. See [Nerves.Runtime.FwupOps](https://hexdocs.pm/nerves_runtime/Nerves.Runtime.FwupOps.html)
92+
93+
* Updated dependencies
94+
* [nerves_system_br v1.24.0](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.24.0)
95+
* [Buildroot 2023.05.2](https://lore.kernel.org/buildroot/[email protected]/T/), [2023.05.1](https://lore.kernel.org/buildroot/[email protected]/T/), [2023.05](https://lore.kernel.org/buildroot/[email protected]/T/)
96+
* [Erlang/OTP 26.1](https://erlang.org/download/OTP-26.1.README)
97+
98+
## v1.23.2
99+
100+
* Updated dependencies
101+
* [nerves_system_br v1.23.3](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.23.3)
102+
15103
## v1.23.1
16104

17105
This is a bug and security fix update. It should be a low risk upgrade.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is the base Nerves System configuration for the Raspberry Pi 3 Model B.
1313
| CPU | 1.2 GHz quad-core Cortex-A53 (ARMv8) |
1414
| Memory | 1 GB DRAM |
1515
| Storage | MicroSD |
16-
| Linux kernel | 5.15 w/ Raspberry Pi patches |
16+
| Linux kernel | 6.1 w/ Raspberry Pi patches |
1717
| IEx terminal | HDMI and USB keyboard (can be changed to UART) |
1818
| GPIO, I2C, SPI | Yes - [Elixir Circuits](https://github.com/elixir-circuits) |
1919
| ADC | No |

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.23.1-farmbot.1
1+
1.27.0-farmbot.1

fwup-revert.conf fwup-ops.conf

+95-20
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
# Revert firmware for the Raspberry Pi 3
1+
# Post-installation firmware operations for the Raspberry Pi 3
2+
#
3+
# Tasks include:
4+
#
5+
# * `factory-reset` - Clear out the writable filesystem and any other writable
6+
# areas so that they can be re-initialized on the next boot.
7+
# * `prevent-revert` - Prevent `revert` from working until the next firmware
8+
# * `revert` - Revert to the previous firmware if it's still available
9+
# * `validate` - Mark this firmware as a good update.
10+
# * `status` - Print out which partition is active (`a` or `b`)
211
#
312
# To use:
4-
# 1. Run `fwup -c -f fwup-revert.conf -o revert.fw` and copy revert.fw to
5-
# the device. This is done automatically as part of the Nerves system
6-
# build process. The file is stored in `/usr/share/fwup/revert.fw`.
7-
# 2. On the device, run `fwup -t revert revert.fw -d $NERVES_FW_DEVPATH`. If
8-
# it succeeds, reboot. If not, then it's possible that there isn't a previous
9-
# firmware or the metadata about what's stored where is corrupt or out of
10-
# sync.
13+
#
14+
# 1. Run `fwup -c -f fwup-ops.conf -o ops.fw` and copy ops.fw to
15+
# the device. This is done automatically as part of the Nerves system
16+
# build process. The file is stored in `/usr/share/fwup/ops.fw`.
17+
# 2. On the device, run `fwup -t <task> -d /dev/rootdisk0 --enable-trim /usr/share/fwup/ops.fw`.
18+
# 3. Reboot after running `revert` or `factory-reset`.
1119
#
1220
# It is critical that this is kept in sync with the main fwup.conf.
1321

14-
require-fwup-version="0.19.0"
22+
require-fwup-version="1.0.0"
1523

1624
#
1725
# Firmware metadata
@@ -30,16 +38,8 @@ define(NERVES_FW_PLATFORM, "rpi3")
3038
define(NERVES_FW_ARCHITECTURE, "arm")
3139
define(NERVES_FW_AUTHOR, "The Farmbot Team")
3240

33-
define(NERVES_FW_DEVPATH, "/dev/mmcblk0")
34-
define(NERVES_FW_APPLICATION_PART0_DEVPATH, "/dev/mmcblk0p3") # Linux part number is 1-based
35-
define(NERVES_FW_APPLICATION_PART0_FSTYPE, "ext4")
36-
define(NERVES_FW_APPLICATION_PART0_TARGET, "/root")
37-
38-
# Default paths if not specified via the commandline
39-
define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs")
40-
41-
# This configuration file will create an image that has an MBR and the
42-
# following 3 partitions:
41+
# This configuration file will create an image that
42+
# has an MBR and the following layout:
4343
#
4444
# +----------------------------+
4545
# | MBR |
@@ -150,6 +150,65 @@ uboot-environment uboot-env {
150150
block-count = ${UBOOT_ENV_COUNT}
151151
}
152152

153+
##
154+
# factory-reset
155+
##
156+
task factory-reset {
157+
on-init {
158+
info("Erasing all writable data")
159+
# This requires --enable-trim
160+
# Trim may not work on MicroSD card, so don't rely on it
161+
trim(${APP_PART_OFFSET}, ${APP_PART_COUNT})
162+
raw_memset(${APP_PART_OFFSET}, 256, 0xff)
163+
}
164+
}
165+
166+
##
167+
# prevent-revert
168+
#
169+
# Pass `--enable-trim` to also clear out the partition that no longer should be used.
170+
##
171+
task prevent-revert.a {
172+
# Check that we're running on B
173+
require-partition-offset(0, ${BOOT_B_PART_OFFSET})
174+
require-partition-offset(1, ${ROOTFS_B_PART_OFFSET})
175+
require-uboot-variable(uboot-env, "nerves_fw_active", "b")
176+
177+
on-init {
178+
info("Preventing reverts to partition A")
179+
# Remove U-Boot variables that fwup uses to allow reverting images
180+
uboot_unsetenv(uboot-env, "a.nerves_fw_platform")
181+
uboot_unsetenv(uboot-env, "a.nerves_fw_architecture")
182+
# Clear out the old image using TRIM. This requires --enable-trim
183+
trim(${ROOTFS_A_PART_OFFSET}, ${ROOTFS_A_PART_COUNT})
184+
trim(${BOOT_A_PART_OFFSET}, ${BOOT_A_PART_COUNT})
185+
}
186+
}
187+
task prevent-revert.b {
188+
# Check that we're running on A
189+
require-partition-offset(0, ${BOOT_A_PART_OFFSET})
190+
require-partition-offset(1, ${ROOTFS_A_PART_OFFSET})
191+
require-uboot-variable(uboot-env, "nerves_fw_active", "a")
192+
193+
on-init {
194+
info("Preventing reverts to partition B")
195+
# Remove U-Boot variables that fwup uses to allow reverting images
196+
uboot_unsetenv(uboot-env, "b.nerves_fw_platform")
197+
uboot_unsetenv(uboot-env, "b.nerves_fw_architecture")
198+
# Clear out the image using TRIM. This requires --enable-trim
199+
trim(${ROOTFS_B_PART_OFFSET}, ${ROOTFS_B_PART_COUNT})
200+
trim(${BOOT_B_PART_OFFSET}, ${BOOT_B_PART_COUNT})
201+
}
202+
}
203+
task prevent-revert.fail {
204+
on-init {
205+
error("Error detecting active partition")
206+
}
207+
}
208+
209+
##
210+
# revert
211+
##
153212
task revert.a {
154213
# This task reverts to the A partition, so check that we're running on B
155214
require-partition-offset(0, ${BOOT_B_PART_OFFSET})
@@ -211,7 +270,11 @@ task revert.wrongplatform {
211270
}
212271
}
213272

214-
# Run "fwup /usr/share/fwup/revert.fw -t status -d /dev/mmcblk0 -q -U" to check the status.
273+
##
274+
# status
275+
#
276+
# Run "fwup /usr/share/fwup/ops.fw -t status -d /dev/rootdisk0 -q -U" to check the status.
277+
##
215278
task status.aa {
216279
require-path-at-offset("/", ${ROOTFS_A_PART_OFFSET})
217280
require-uboot-variable(uboot-env, "nerves_fw_active", "a")
@@ -235,3 +298,15 @@ task status.ba {
235298
task status.fail {
236299
on-init { error("fail") }
237300
}
301+
302+
##
303+
# validate
304+
#
305+
# The fwup configuration for this device always validates, so this doesn't do anything.
306+
##
307+
task validate {
308+
on-init {
309+
info("Validate")
310+
uboot_setenv(uboot-env, "nerves_fw_validated", "1")
311+
}
312+
}

0 commit comments

Comments
 (0)