Skip to content

Commit 5667bb5

Browse files
author
connor rigby
committed
merge upstream nerves.
2 parents a6c5c32 + f88e89d commit 5667bb5

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

README.md

+4-20
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,16 @@ This is the base Nerves System configuration for the Raspberry Pi 3 Model B.
1919
| UART | 1 available - ttyS0 |
2020
| Camera | Yes - via rpi-userland |
2121
| Ethernet | Yes |
22-
| WiFi | Yes - Nerves.InterimWiFi |
23-
| Bluetooth | Not yet |
22+
| WiFi | Yes - Nerves.Network |
23+
| Bluetooth | Not supported yet |
2424

25-
## Installation
26-
27-
If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:
28-
29-
1. Add nerves_system_farmbot_rpi3 to your list of dependencies in `mix.exs`:
30-
31-
def deps do
32-
[{:nerves_system_farmbot_rpi3, "~> 0.11.0"}]
33-
end
34-
35-
2. Ensure nerves_system_farmbot_rpi3 is started before your application:
36-
37-
def application do
38-
[applications: [:nerves_system_farmbot_rpi3]]
39-
end
40-
41-
## Built-in WiFi Firmware
25+
## Supported WiFi devices and firmware
4226

4327
WiFi modules almost always require proprietary firmware to be loaded for them to work. The
4428
Linux kernel handles this and firmware blobs are maintained in the
4529
`linux-firmware` project. The firmware for the built-in WiFi module on the RPi3
4630
hasn't made it to the `linux-firmware` project nor Buildroot, so it is included
47-
here in a `rootfs-additions` overlay directory. The original firmware files came from
31+
here in a `rootfs_overlay` overlay directory. The original firmware files came from
4832
https://github.com/RPi-Distro/firmware-nonfree/blob/master/brcm80211/brcm.
4933

5034
[Image credit](#fritzing): This image is from the [Fritzing](http://fritzing.org/home/) parts library.

fwup.conf

+23-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs")
4444
# +----------------------------+
4545
# | p1*: Rootfs B (squashfs) |
4646
# +----------------------------+
47-
# | p2: Application (ext4) |
47+
# | p2: Application (ext4) |
4848
# +----------------------------+
4949
#
5050
# The p0/p1 partition points to whichever of configurations A or B that is
@@ -231,6 +231,10 @@ task upgrade.a {
231231
# This task upgrades the A partition
232232
require-partition-offset(1, ${ROOTFS_B_PART_OFFSET})
233233

234+
# Verify the expected platform/architecture
235+
require-uboot-variable(uboot-env, "b.nerves_fw_platform", "${NERVES_FW_PLATFORM}")
236+
require-uboot-variable(uboot-env, "b.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}")
237+
234238
on-init {
235239
info("Upgrading the A partition")
236240

@@ -242,6 +246,9 @@ task upgrade.a {
242246
fat_mkfs(${BOOT_A_PART_OFFSET}, ${BOOT_A_PART_COUNT})
243247
fat_setlabel(${BOOT_A_PART_OFFSET}, "BOOT-A")
244248
fat_mkdir(${BOOT_A_PART_OFFSET}, "overlays")
249+
250+
# Indicate that the entire partition can be cleared
251+
trim(${ROOTFS_A_PART_OFFSET}, ${ROOTFS_A_PART_COUNT})
245252
}
246253

247254
# Write the new boot partition files and rootfs. The MBR still points
@@ -284,6 +291,10 @@ task upgrade.b {
284291
# This task upgrades the B partition
285292
require-partition-offset(1, ${ROOTFS_A_PART_OFFSET})
286293

294+
# Verify the expected platform/architecture
295+
require-uboot-variable(uboot-env, "a.nerves_fw_platform", "${NERVES_FW_PLATFORM}")
296+
require-uboot-variable(uboot-env, "a.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}")
297+
287298
on-init {
288299
info("Upgrading the B partition")
289300

@@ -295,6 +306,8 @@ task upgrade.b {
295306
fat_mkfs(${BOOT_B_PART_OFFSET}, ${BOOT_B_PART_COUNT})
296307
fat_setlabel(${BOOT_B_PART_OFFSET}, "BOOT-B")
297308
fat_mkdir(${BOOT_B_PART_OFFSET}, "overlays")
309+
310+
trim(${ROOTFS_B_PART_OFFSET}, ${ROOTFS_B_PART_COUNT})
298311
}
299312

300313
# Write the new boot partition files and rootfs. The MBR still points
@@ -331,10 +344,18 @@ task upgrade.b {
331344

332345
on-error {
333346
}
334-
}
347+
}
335348

336349
task upgrade.unexpected {
350+
require-uboot-variable(uboot-env, "a.nerves_fw_platform", "${NERVES_FW_PLATFORM}")
351+
require-uboot-variable(uboot-env, "a.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}")
337352
on-init {
338353
error("Please check the media being upgraded. It doesn't look like either the A or B partitions are active.")
339354
}
340355
}
356+
357+
task upgrade.wrongplatform {
358+
on-init {
359+
error("Expecting platform=${NERVES_FW_PLATFORM} and architecture=${NERVES_FW_ARCHITECTURE}")
360+
}
361+
}

nerves_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
BR2_arm=y
22
BR2_cortex_a7=y
33
BR2_ARM_FPU_NEON_VFPV4=y
4+
BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_NERVES_PATH}/patches"
45
BR2_TOOLCHAIN_EXTERNAL=y
56
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
67
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y

0 commit comments

Comments
 (0)