2025-04-18 12:39:26 +02:00
2025-04-18 12:39:26 +02:00
2025-04-17 13:21:38 +02:00
2025-04-17 13:21:38 +02:00
2025-04-17 13:21:38 +02:00
2025-04-17 13:21:38 +02:00
2025-04-17 13:21:38 +02:00
2025-04-18 12:39:26 +02:00
2025-04-17 13:21:38 +02:00

Auracaster System - Buildroot with SWUpdate A/B System

This project implements a Buildroot-based system for Raspberry Pi 3 with SWUpdate A/B partitioning for robust over-the-air updates.

Overview

The Auracaster System provides a complete solution for creating a robust embedded Linux system with A/B partition updates using the SWUpdate framework. This allows for safe, reliable updates with automatic rollback capability if an update fails.

Key Features

  • A/B Partition System: Two rootfs partitions (A and B) for failsafe updates
  • SWUpdate Integration: Web interface for uploading and applying updates
  • Automatic Fallback: If an update fails to boot, the system reverts to the previous partition
  • Raspberry Pi 3 Support: Optimized for Raspberry Pi 3 hardware
  • BR2_EXTERNAL Structure: Follows Buildroot's recommended external tree pattern

Directory Structure

auracaster-system/
├── Config.in                     # Main config file for BR2_EXTERNAL
├── external.desc                 # BR2_EXTERNAL description file
├── configs/                      # Custom defconfigs
│   └── raspberrypi3_swupdate_defconfig
├── board/                        # Board-specific files
│   └── raspberrypi3_swupdate/    # Configuration for RPi3 with SWUpdate
├── package/                      # Custom packages
│   └── swupdate-scripts/         # Custom scripts for SWUpdate
├── example/                      # Example update package
│   └── create-update-package.sh  # Script to create a sample update
└── flash_sdcard.sh              # Script to flash SD card

Building the System

Prerequisites

  • Buildroot checkout (in ../buildroot relative to this repository)
  • Build dependencies for Buildroot (see Buildroot documentation)
  • At least 10GB of free disk space
  • Root/sudo access (for SD card flashing)

Build Steps

  1. Configure Buildroot to use this external tree:
cd ../buildroot
make BR2_EXTERNAL=../auracaster-system raspberrypi3_swupdate_defconfig
  1. Build the system:
make

The build process will take some time (30-60 minutes depending on your system). Once complete, the output images will be in ../buildroot/output/images/.

Flashing to SD Card

Use the provided script to flash the image to your SD card:

sudo ./flash_sdcard.sh

Follow the on-screen prompts to select the correct device and confirm the flashing operation.

Partition Layout

The system uses the following partition layout on the SD card:

  1. Boot Partition (64MB): Contains bootloader, kernel, and boot configuration
  2. RootFS A (512MB): First root filesystem partition
  3. RootFS B (512MB): Second root filesystem partition
  4. Data Partition (Remaining Space): For persistent data storage

Update Process

Creating an Update Package

Use the provided example script to create an update package:

cd example
./create-update-package.sh

This creates an auracaster-update.swu file that can be applied through the web interface.

Applying an Update via Web Interface

  1. Boot the Raspberry Pi with the flashed SD card
  2. Connect to the same network as the Raspberry Pi
  3. Access the web interface at http://<raspberry-pi-ip>:8080
  4. Upload the .swu file through the web interface
  5. Once the update is complete, reboot the device
  6. The system will boot from the updated partition

Update Verification

The system will track boot attempts. If the updated system fails to boot properly (as determined by the boot counter mechanism), it will automatically fall back to the previous working partition.

U-Boot Environment

The U-Boot environment manages the A/B boot selection. Key variables include:

  • active_part: Current active partition (A or B)
  • inactive_part: Partition that will receive updates
  • bootcount: Number of boot attempts for the current partition
  • bootlimit: Maximum allowed boot attempts before fallback

Troubleshooting

System Won't Boot

If the system fails to boot completely:

  1. Connect a monitor to the Raspberry Pi to view boot messages
  2. If the system is falling back to the previous partition, check the logs for errors
  3. You can manually force a boot from a specific partition by editing the U-Boot environment

Update Fails

If an update fails to apply:

  1. Check network connectivity
  2. Verify the SWUpdate web server is running (port 8080)
  3. Examine the update package format and contents

License

This project is distributed under the terms of the GPL v2 license.

Description
No description provided
Readme 84 KiB
Languages
Shell 71.5%
JavaScript 18.2%
CSS 6.5%
Makefile 3.8%