Skip to content

Commit

Permalink
merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Apr 27, 2024
2 parents 09062dd + 540936f commit f0a229c
Show file tree
Hide file tree
Showing 11 changed files with 235 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exec: &exec
name: build-tools/nerves-system-br
version: 1.23.2
elixir: 1.15.2-otp-26
version: 1.27.0
elixir: 1.16.2-otp-26

version: 2.1

Expand Down
88 changes: 88 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,94 @@ follows:
releases, and Linux kernel updates. They're also made to fix bugs and add
features to the build infrastructure.

## v1.27.0

This is a major Buildroot update.

Please see the [nerves_system_br v1.27.0 release notes](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.26.0)
for upgrade instructions if you've forked this system.

* Changes
* The `libcamera` and `rpicam_apps` packages have been replaced with the
Raspberry Pi-forked versions for better compatibility. Please see
`nerves_system_br` release notes.
* Add back `CONFIG_RASPBERRYPI_GPIOMEM` to support the `dht` library.

* Updated dependencies
* [nerves_system_br v1.27.0](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.27.0)
* [Buildroot 2024.02](https://lore.kernel.org/buildroot/[email protected]/)
* [Erlang/OTP 26.2.3](https://erlang.org/download/OTP-26.2.3.README)

## v1.26.0

This is a major Buildroot update.

Please see the [nerves_system_br v1.26.0 release notes](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.26.0)
for upgrade instructions if you've forked this system.

* New features
* Add the imx296 overlays for the Raspberry Pi Global Shutter Camera

* Updated dependencies
* [Erlang/OTP 26.2.2](https://erlang.org/download/OTP-26.2.2.README)
* [nerves_system_br v1.26.1](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.26.1)
* [Buildroot 2023.11.1](https://lore.kernel.org/buildroot/[email protected]/T/)

## v1.25.1

This is a security/bug fix update.

Package updates
* [Erlang/OTP 26.2.1](https://erlang.org/download/OTP-26.2.1.README)
* [nerves_heart 2.3.0](https://github.com/nerves-project/nerves_heart/releases/tag/v2.3.0)

## v1.25.0

This is a major Buildroot and toolchain update that also adds support for using
Scenic without customizing the system.

Please see [nerves_system_br v1.25.0 release notes](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.25.0)
for upgrade instructions if you've forked this system.

* New features
* Add libcairo for [Scenic](https://github.com/ScenicFramework/scenic) support

* Updated dependencies
* [nerves_system_br v1.25.2](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.25.2)
* [Buildroot 2023.08.4](https://lore.kernel.org/buildroot/[email protected]/T/)
* [Erlang/OTP 26.1.2](https://erlang.org/download/OTP-26.1.2.README)

## v1.24.1

This is a security/bug fix update.

* Package updates
* [nerves_system_br v1.24.1](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.24.1)
* [Erlang/OTP 26.1.1](https://erlang.org/download/OTP-26.1.1.README)
* [Buildroot 2023.05.3](https://lore.kernel.org/buildroot/[email protected]/T/)

## v1.24.0

This is a Buildroot version update that appears to mostly contain bug and
security fixes. It should be a low risk upgrade from v1.23.2.

* New features
* Support factory reset, preventing firmware reverts. See [Nerves.Runtime.FwupOps](https://hexdocs.pm/nerves_runtime/Nerves.Runtime.FwupOps.html)

* Updated dependencies
* [nerves_system_br v1.24.0](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.24.0)
* [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/)
* [Erlang/OTP 26.1](https://erlang.org/download/OTP-26.1.README)

## v1.23.2

* Fixes
* This fixes a rare aarch64 Erlang JIT bug that affects NervesKey users. See
`nerves_system_br` notes.

* Updated dependencies
* [nerves_system_br v1.23.3](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.23.3)

## v1.23.1

This is a bug and security fix update. It should be a low risk upgrade.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.23.1-farmbot.1
1.27.0-farmbot.1
4 changes: 4 additions & 0 deletions config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ display_auto_detect=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# Disable compensation for displays with overscan
disable_overscan=1

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

require-fwup-version="0.19.0"
require-fwup-version="1.0.0"

#
# Firmware metadata
Expand All @@ -30,16 +38,8 @@ define(NERVES_FW_PLATFORM, "rpi4")
define(NERVES_FW_ARCHITECTURE, "arm")
define(NERVES_FW_AUTHOR, "The Farmbot Team")

define(NERVES_FW_DEVPATH, "/dev/mmcblk0")
define(NERVES_FW_APPLICATION_PART0_DEVPATH, "/dev/mmcblk0p3") # Linux part number is 1-based
define(NERVES_FW_APPLICATION_PART0_FSTYPE, "f2fs")
define(NERVES_FW_APPLICATION_PART0_TARGET, "/root")

# Default paths if not specified via the commandline
define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs")

# This configuration file will create an image that has an MBR and the
# following 3 partitions:
# This configuration file will create an image that
# has an MBR and the following layout:
#
# +----------------------------+
# | MBR |
Expand Down Expand Up @@ -150,6 +150,65 @@ uboot-environment uboot-env {
block-count = ${UBOOT_ENV_COUNT}
}

##
# factory-reset
##
task factory-reset {
on-init {
info("Erasing all writable data")
# This requires --enable-trim
# Trim may not work on MicroSD card, so don't rely on it
trim(${APP_PART_OFFSET}, ${APP_PART_COUNT})
raw_memset(${APP_PART_OFFSET}, 256, 0xff)
}
}

##
# prevent-revert
#
# Pass `--enable-trim` to also clear out the partition that no longer should be used.
##
task prevent-revert.a {
# Check that we're running on B
require-partition-offset(0, ${BOOT_B_PART_OFFSET})
require-partition-offset(1, ${ROOTFS_B_PART_OFFSET})
require-uboot-variable(uboot-env, "nerves_fw_active", "b")

on-init {
info("Preventing reverts to partition A")
# Remove U-Boot variables that fwup uses to allow reverting images
uboot_unsetenv(uboot-env, "a.nerves_fw_platform")
uboot_unsetenv(uboot-env, "a.nerves_fw_architecture")
# Clear out the old image using TRIM. This requires --enable-trim
trim(${ROOTFS_A_PART_OFFSET}, ${ROOTFS_A_PART_COUNT})
trim(${BOOT_A_PART_OFFSET}, ${BOOT_A_PART_COUNT})
}
}
task prevent-revert.b {
# Check that we're running on A
require-partition-offset(0, ${BOOT_A_PART_OFFSET})
require-partition-offset(1, ${ROOTFS_A_PART_OFFSET})
require-uboot-variable(uboot-env, "nerves_fw_active", "a")

on-init {
info("Preventing reverts to partition B")
# Remove U-Boot variables that fwup uses to allow reverting images
uboot_unsetenv(uboot-env, "b.nerves_fw_platform")
uboot_unsetenv(uboot-env, "b.nerves_fw_architecture")
# Clear out the image using TRIM. This requires --enable-trim
trim(${ROOTFS_B_PART_OFFSET}, ${ROOTFS_B_PART_COUNT})
trim(${BOOT_B_PART_OFFSET}, ${BOOT_B_PART_COUNT})
}
}
task prevent-revert.fail {
on-init {
error("Error detecting active partition")
}
}

##
# revert
##
task revert.a {
# This task reverts to the A partition, so check that we're running on B
require-partition-offset(0, ${BOOT_B_PART_OFFSET})
Expand Down Expand Up @@ -211,7 +270,11 @@ task revert.wrongplatform {
}
}

# Run "fwup /usr/share/fwup/revert.fw -t status -d /dev/mmcblk0 -q -U" to check the status.
##
# status
#
# Run "fwup /usr/share/fwup/ops.fw -t status -d /dev/rootdisk0 -q -U" to check the status.
##
task status.aa {
require-path-at-offset("/", ${ROOTFS_A_PART_OFFSET})
require-uboot-variable(uboot-env, "nerves_fw_active", "a")
Expand All @@ -235,3 +298,15 @@ task status.ba {
task status.fail {
on-init { error("fail") }
}

##
# validate
#
# The fwup configuration for this device always validates, so this doesn't do anything.
##
task validate {
on-init {
info("Validate")
uboot_setenv(uboot-env, "nerves_fw_validated", "1")
}
}
6 changes: 6 additions & 0 deletions fwup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ file-resource ramoops.dtbo {
file-resource imx219.dtbo {
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/overlays/imx219.dtbo"
}
file-resource imx296.dtbo {
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/overlays/imx296.dtbo"
}
file-resource imx477.dtbo {
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/overlays/imx477.dtbo"
}
Expand Down Expand Up @@ -275,6 +278,7 @@ task complete {
on-resource dwc2.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/dwc2.dtbo") }
on-resource ramoops.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/ramoops.dtbo") }
on-resource imx219.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx219.dtbo") }
on-resource imx296.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx296.dtbo") }
on-resource imx477.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx477.dtbo") }
on-resource imx708.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx708.dtbo") }
on-resource ov5647.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/ov5647.dtbo") }
Expand Down Expand Up @@ -351,6 +355,7 @@ task upgrade.a {
on-resource dwc2.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/dwc2.dtbo") }
on-resource ramoops.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/ramoops.dtbo") }
on-resource imx219.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx219.dtbo") }
on-resource imx296.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx296.dtbo") }
on-resource imx477.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx477.dtbo") }
on-resource imx708.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/imx708.dtbo") }
on-resource ov5647.dtbo { fat_write(${BOOT_A_PART_OFFSET}, "overlays/ov5647.dtbo") }
Expand Down Expand Up @@ -435,6 +440,7 @@ task upgrade.b {
on-resource dwc2.dtbo { fat_write(${BOOT_B_PART_OFFSET}, "overlays/dwc2.dtbo") }
on-resource ramoops.dtbo { fat_write(${BOOT_B_PART_OFFSET}, "overlays/ramoops.dtbo") }
on-resource imx219.dtbo { fat_write(${BOOT_B_PART_OFFSET}, "overlays/imx219.dtbo") }
on-resource imx296.dtbo { fat_write(${BOOT_B_PART_OFFSET}, "overlays/imx296.dtbo") }
on-resource imx477.dtbo { fat_write(${BOOT_B_PART_OFFSET}, "overlays/imx477.dtbo") }
on-resource imx708.dtbo { fat_write(${BOOT_B_PART_OFFSET}, "overlays/imx708.dtbo") }
on-resource ov5647.dtbo { fat_write(${BOOT_B_PART_OFFSET}, "overlays/ov5647.dtbo") }
Expand Down
14 changes: 11 additions & 3 deletions linux-6.1.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ CONFIG_TOUCHSCREEN_RASPBERRYPI_FW=m
# CONFIG_SERIO is not set
CONFIG_BRCM_CHAR_DRIVERS=y
CONFIG_BCM_VCIO=y
CONFIG_BCM2835_DEVGPIOMEM=y
CONFIG_RPIVID_MEM=m
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
Expand All @@ -243,6 +242,7 @@ CONFIG_TTY_PRINTK=y
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_ARM_SMCCC_TRNG is not set
# CONFIG_HW_RANDOM_CN10K is not set
CONFIG_RASPBERRYPI_GPIOMEM=m
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=m
Expand Down Expand Up @@ -282,11 +282,12 @@ CONFIG_USB_VIDEO_CLASS=m
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_BCM2835_UNICAM=m
CONFIG_VIDEO_IMX219=m
CONFIG_VIDEO_IMX296=m
CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_OV5647=m
CONFIG_VIDEO_AD5398=m
CONFIG_VIDEO_DW9807_VCM=m
CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_TC358743=m
CONFIG_VIDEO_TC358743_CEC=y
# CONFIG_CXD2880_SPI_DRV is not set
Expand Down Expand Up @@ -327,6 +328,7 @@ CONFIG_VIDEO_TC358743_CEC=y
# CONFIG_MEDIA_TUNER_XC2028 is not set
# CONFIG_MEDIA_TUNER_XC4000 is not set
# CONFIG_MEDIA_TUNER_XC5000 is not set
# CONFIG_DVB_M88DS3103 is not set
# CONFIG_DVB_MXL5XX is not set
# CONFIG_DVB_STB0899 is not set
# CONFIG_DVB_STB6100 is not set
Expand Down Expand Up @@ -366,6 +368,7 @@ CONFIG_VIDEO_TC358743_CEC=y
# CONFIG_DVB_VES1X93 is not set
# CONFIG_DVB_ZL10036 is not set
# CONFIG_DVB_ZL10039 is not set
# CONFIG_DVB_AF9013 is not set
# CONFIG_DVB_CX22700 is not set
# CONFIG_DVB_CX22702 is not set
# CONFIG_DVB_CXD2820R is not set
Expand All @@ -380,7 +383,11 @@ CONFIG_VIDEO_TC358743_CEC=y
# CONFIG_DVB_L64781 is not set
# CONFIG_DVB_MT352 is not set
# CONFIG_DVB_NXT6000 is not set
# CONFIG_DVB_RTL2830 is not set
# CONFIG_DVB_RTL2832 is not set
# CONFIG_DVB_RTL2832_SDR is not set
# CONFIG_DVB_S5H1432 is not set
# CONFIG_DVB_SI2168 is not set
# CONFIG_DVB_SP887X is not set
# CONFIG_DVB_STV0367 is not set
# CONFIG_DVB_TDA10048 is not set
Expand All @@ -397,6 +404,7 @@ CONFIG_VIDEO_TC358743_CEC=y
# CONFIG_DVB_BCM3510 is not set
# CONFIG_DVB_LG2160 is not set
# CONFIG_DVB_LGDT3305 is not set
# CONFIG_DVB_LGDT3306A is not set
# CONFIG_DVB_LGDT330X is not set
# CONFIG_DVB_MXL692 is not set
# CONFIG_DVB_NXT200X is not set
Expand Down Expand Up @@ -441,9 +449,9 @@ CONFIG_DRM_TOSHIBA_TC358762=m
CONFIG_DRM_V3D=m
CONFIG_DRM_VC4=m
CONFIG_DRM_VC4_HDMI_CEC=y
CONFIG_DRM_SIMPLEDRM=m
CONFIG_TINYDRM_REPAPER=m
CONFIG_FB=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_BCM2708=y
CONFIG_FB_RPISENSE=m
CONFIG_BACKLIGHT_CLASS_DEVICE=m
Expand Down
6 changes: 3 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ defmodule FarmbotSystemRpi4.MixProject do
defp deps do
[
{:nerves, "~> 1.5.4 or ~> 1.6.0 or ~> 1.7.15 or ~> 1.8", runtime: false},
{:nerves_system_br, "1.23.2", runtime: false},
{:nerves_toolchain_aarch64_nerves_linux_gnu, "~> 1.8.0", runtime: false},
{:nerves_system_br, "1.27.0", runtime: false},
{:nerves_toolchain_aarch64_nerves_linux_gnu, "~> 13.2.0", runtime: false},
{:nerves_system_linter, "~> 0.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.22", only: :docs, runtime: false}
]
Expand Down Expand Up @@ -104,7 +104,7 @@ defmodule FarmbotSystemRpi4.MixProject do
"CHANGELOG.md",
"cmdline.txt",
"config.txt",
"fwup-revert.conf",
"fwup-ops.conf",
"fwup.conf",
"LICENSE",
"linux-6.1.defconfig",
Expand Down
Loading

0 comments on commit f0a229c

Please sign in to comment.