Skip to content

Commit

Permalink
Update packages before migration to OpenWRT 23.05.3
Browse files Browse the repository at this point in the history
  • Loading branch information
YevheniiOnishchenkoLemberg committed May 20, 2024
1 parent 8d7c7cc commit d700197
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots or terminal output to help explain your problem.

# **Version Info (please complete the following information):**
- Firmware version: [e.g. 22.03.02 b124]
- Firmware version: [e.g. 23.05.3 b124]
- Package name [e.g. omega2-ctrl]
- Package Version [e.g. 22-1]
- Repo branch (if applicable) [e.g. openwrt-22.03]
- Package Version [e.g. 23-1]
- Repo branch (if applicable) [e.g. openwrt-23.05]

# **Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ deployment_bucket = "repo.onioniot.com"
stage_vars = {
"stage_name" = {
branch = "openwrt-22.03"
branch = "openwrt-23.05"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion .terraform/pipeline/buildspec/buildspec-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 0.2

env:
variables:
VERSION: "22.03.2"
VERSION: "23.05.3"
OUTPUT_S3_PATH: "omega2/images"
phases:
install:
Expand Down
2 changes: 1 addition & 1 deletion .terraform/pipeline/buildspec/buildspec-build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version: 0.2
env:
variables:
VERSION: "22.03.2"
VERSION: "23.05.3"
phases:
install:
runtime-versions:
Expand Down
2 changes: 1 addition & 1 deletion .terraform/pipeline/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ buildspec_file_name = "buildspec.yml"

stage_vars = {
"prod" = {
branch = "openwrt-22.03"
branch = "openwrt-23.05"
}
}
110 changes: 108 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,114 @@ Onion Packages for OpenWRT firmware. Intended for the Onion Omega2 & Omega2+ dev

## Where can I find the compiled output of this repo?

The latest compiled packages can be found at: http://repo.onioniot.com/omega2/packages/openwrt-23.05.2/
The latest compiled packages can be found at: http://repo.onioniot.com/omega2/packages/openwrt-23.05.3/

And firmware with these packages can be found at: http://repo.onioniot.com/omega2/images/openwrt-23.05/
/

> Compilation done bour our Continuous Deployment System. More details [below](#continuous-deployment-details)

# Developing with this Repo

See below for information on development of the packages of this repo

## How Can I Compile the Packages in this Repo for the Omega2 Device?

### Compiling the Packages as they are in this repo

> This is useful if you want to test the compilation of packages in this repo
Use the OnionIoT/openwrt-sdk-wrapper:

1. Clone the OnionIoT/openwrt-sdk-wrapper repo: https://github.com/OnionIoT/openwrt-sdk-wrapper and check out the `main` branch
1. Copy the `sdk-profile` config file to the locally cheked out openwrt-sdk-wrapper repo, rename it to `profile`
1. Follow the instructions in the [OnionIoT/openwrt-sdk-wrapper repo readme](https://github.com/OnionIoT/openwrt-sdk-wrapper/tree/main?tab=readme-ov-file#how-to-use-this-repo) to compile the packages

### Compiling the Packages from a local clone of this repo

> This is useful if you're working on changes to the packages in this repo
Use the OnionIoT/openwrt-sdk-wrapper:

1. Clone the OnionIoT/openwrt-sdk-wrapper repo: https://github.com/OnionIoT/openwrt-sdk-wrapper and check out the `main` branch
1. Copy the `sdk-profile` config file to the locally cheked out openwrt-sdk-wrapper repo, rename it to `profile`
1. Follow the instructions in the [OnionIoT/openwrt-sdk-wrapper repo readme on **using this repo for development**](https://github.com/OnionIoT/openwrt-sdk-wrapper/tree/main?tab=readme-ov-file#how-to-use-this-repo)

## How Can I Build Firmware that includes the packages from this repo?

### Building Firmware with Published Packages

> This is useful if you need firmware with the packages from this repo
Use the OnionIoT/openwrt-imagebuilder-wrapper to build firmware that includes the compiled, published packages from this repo:

1. Clone the OnionIoT/openwrt-imagebuilder-wrapper repo: https://github.com/OnionIoT/openwrt-imagebuilder-wrapper and check out the `main` branch
1. Copy the `imagebuilder-profile` config file to the locally cheked out openwrt-imagebuilder-wrapper repo, rename it to `profile`
1. Follow the instructions in the [OnionIoT/openwrt-imagebuilder-wrapper repo readme](https://github.com/OnionIoT/openwrt-sdk-wrapper/tree/main?tab=readme-ov-file#how-to-use-this-repo) to build firmware

### Building Firmware with the Packages from a local clone of this repo

> This is useful if you're working on changes to the packages in this repo and need to test building firmware that includes the packages
Use the OnionIoT/openwrt-imagebuilder-wrapper to build firmware that includes packages that have been locally compiled

1. Clone the OnionIoT/openwrt-imagebuilder-wrapper repo: https://github.com/OnionIoT/openwrt-imagebuilder-wrapper and check out the `main` branch
1. Copy the `imagebuilder-profile` config file to the locally cheked out openwrt-imagebuilder-wrapper repo, rename it to `profile`
1. Follow the instructions in the [OnionIoT/openwrt-imagebuilder-wrapper repo readme on **using this repo for development**](https://github.com/OnionIoT/openwrt-imagebuilder-wrapper/tree/main?tab=readme-ov-file#using-this-repo-for-development)



---

# Continuous Deployment Details

Summary:

| | Development Builds | Release Builds |
|:---------------------------------------:|------------------------------------------------------------------|--------------------------------------------------------------|
| Purpose | Internal use, may not be 100% stable but useful for testing | Meant for use by general users |
| Trigger | Commit to branch | Github Release created from branch |
| Environment variables used during build | `DEV_BUILD` | none |
| Package File Output Location | `http://repo.onioniot.com/omega2-dev/packages/openwrt-$VERSION/` | `http://repo.onioniot.com/omega2/packages/openwrt-$VERSION/` |
| Image File Output Location | `http://repo.onioniot.com/omega2-dev/images/openwrt-$RELEASE/` | `http://repo.onioniot.com/omega2/images/openwrt-$RELEASE/` |

Where:
* `$VERSION` is the `OPENWRT_VERSION` from the `sdk-profile` config file (for example: `23.05.3`)
* `$RELEASE` is the `OPENWRT_RELEASE` from the `imagebuilder-profile` config file (for example: `23.05`)

Image files will be named with the following syntax: `<device-name>-<openwrt-version>-<build-date>.bin`
For example: `onion_omega2-23.05.3-20240516.bin`

## Development Builds in Branches

When a new branch is created from the `openwrt-23.05` branch in the `OnionIoT/OpenWRT-Packages` repository and follows the regular expression pattern `openwrt-2\d.\d\d`, an action is automatically triggered in GitHub Actions. This action then creates a new instance in AWS CodePipeline using Terraform.

This pipeline additionally makes use of two repositories, `OnionIoT/openwrt-imagebuilder-wrapper` and `OnionIoT/openwrt-sdk-wrapper`, using their respective `main` branches. The production and development buildspecs are stored in their respective main branches.

The newly created pipeline, following the pattern corresponding to the regex `openwrt-2\d.\d\d`, utilizes the development buildspec present in the main branch of each of the auxiliary repositories, `OnionIoT/openwrt-imagebuilder-wrapper` and `OnionIoT/openwrt-sdk-wrapper`, and will only be triggered when a new commit is made to the `OnionIoT/OpenWRT-Packages` repository.

During the build process, the `sdk-profile` is copied to the profile of the `openwrt-sdk-wrapper` repository, and, the `imagebuilder-profile` file is copied to the `profile` of the openwrt-imagebuilder-wrapper repository.

The output files are then stored in the following locations in S3:
- Location of the development package output file: `s3://$OUTPUT_BUCKET/omega2-dev/packages/openwrt-$VERSION`
- Location of the development image output file: `s3://$OUTPUT_BUCKET/omega2-dev/images/openwrt-$RELEASE`

When the created branch following the regex pattern `openwrt-2\d.\d\d` is deleted, the pipeline in AWS CodePipeline will not be automatically deleted because currently, the branch defined as the default branch is `openwrt-18.06` and has not been modified during our work, and automation of the branch deletion event in GitHub Actions can only be done using the default branch.

## Newly Created Releases

When a new release is created on GitHub from the development branches, it is automatically merged into the release branch, triggering the AWS CodePipeline for production.

The resulting files are stored in the following locations in S3:
- Package output file: `s3://$OUTPUT_BUCKET/omega2/packages/openwrt-$VERSION`
- ImageBuild output file: `s3://$OUTPUT_BUCKET/omega2/images/openwrt-$RELEASE`

## Process: Creating a Release

* Commit update to `omega2-base/Makefile` that changes `PKG_RELEASE` to the current date, in the format `%Y%m%d-%H%M%S`
* Create a new release:
* Name the release `<OPENWRT_RELEASE>_<DATE>_<NUMBER>` where `<NUMBER>` is `00` and increments by 1 if there are multiple releases needed in a single day
* Create a tag that's named same as the release, based on the branch in question
* Populate the Release description with bullet points outlining what's been Added, Changed, Removed, and/or Fixed
* Also use generate release notes feature
* Publish the release
5 changes: 1 addition & 4 deletions imagebuilder-profile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

# Stable OpenWrt Release version (Needs change whenever new openwrt release is available)
OPENWRT_RELEASE="23.05"
OPENWRT_VERSION="${OPENWRT_RELEASE}.2"
# temporarily override the openwrt version (compile old 22.03.5 in the new 23.05 branch)
OPENWRT_RELEASE_CD_TESTING="22.03"
OPENWRT_VERSION_CD_TESTING="${OPENWRT_RELEASE_CD_TESTING}.5"
OPENWRT_VERSION="${OPENWRT_RELEASE}.3"
ARCH="mipsel_24kc"
TARGET="ramips"
SUBTARGET="mt76x8"
Expand Down
4 changes: 2 additions & 2 deletions omega2-base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

include $(TOPDIR)/rules.mk
PKG_NAME:=omega2-base
PKG_VERSION:=22.03.5
PKG_RELEASE:=20240122
PKG_VERSION:=23.05.3
PKG_RELEASE:=20240516


PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
Expand Down
2 changes: 1 addition & 1 deletion onion-repo-keys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

include $(TOPDIR)/rules.mk
PKG_NAME:=onion-repo-keys
PKG_VERSION:=22.03.2
PKG_VERSION:=23.05.3
PKG_RELEASE:=1

#PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
Expand Down
4 changes: 4 additions & 0 deletions python3-spidev/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ define Package/python3-spidev/install
$(CP) $(PKG_BUILD_DIR)/lib/python$(PYTHON3_VERSION)/spidev.so $(1)$(PYTHON3_PKG_DIR)
endef

define Build/Install
true
endef

$(eval $(call BuildPackage,python3-spidev))
7 changes: 2 additions & 5 deletions sdk-profile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

# Stable OpenWrt Release version (Needs change whenever new openwrt release is available)
OPENWRT_RELEASE="23.05"
OPENWRT_VERSION="${OPENWRT_RELEASE}.2"
# temporarily override the openwrt version (compile old 22.03.5 in the new 23.05 branch)
OPENWRT_RELEASE_CD_TESTING="22.03"
OPENWRT_VERSION_CD_TESTING="${OPENWRT_RELEASE_CD_TESTING}.5"
OPENWRT_VERSION="${OPENWRT_RELEASE}.3"
TARGET="ramips"
SUBTARGET="mt76x8"

# Default base URL from where openwrt SDKs are available for the respective openwrt version and targets
BASE_URL="http://downloads.onioniot.com.s3.amazonaws.com/releases/$OPENWRT_VERSION_CD_TESTING/targets/$TARGET/$SUBTARGET"

# SDK file name available and downloaded from BASE_URL ((Needs change whenever new openwrt release is available with different gcc version))
SDK_FILE="openwrt-sdk-$OPENWRT_VERSION_CD_TESTING-$TARGET-${SUBTARGET}_gcc-11.2.0_musl.Linux-$(uname -p).tar.xz"
SDK_FILE="openwrt-sdk-$OPENWRT_VERSION_CD_TESTING-$TARGET-${SUBTARGET}_gcc-12.3.0_musl.Linux-$(uname -p).tar.xz"
SDK_URL="$BASE_URL/$SDK_FILE"

# Keys directory to sign compiled packages, Ensure you have key-build files in specificed directory
Expand Down
22 changes: 11 additions & 11 deletions technical-doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Usage Instructions for New OpenWRT-22.03-based Omega2 Firmware
# Usage Instructions for New OpenWRT-23.05-based Omega2 Firmware

A new firmware is available for the Omega2 and Omega2+ that's based on the recent OpenWRT 22.03 release.
A new firmware is available for the Omega2 and Omega2+ that's based on the recent OpenWRT 23.05 release.

This page has instructions on using this new firmware:

Expand Down Expand Up @@ -42,10 +42,10 @@ This page has instructions on using this new firmware:

> This firmware doesn't include the `oupgrade` utility, so we'll need to manually install the firmware. The procedure is very similar to the [Manual Firmware Installation instructions in the Onion Documentation](http://docs.onion.io/omega2-docs/manual-firmware-installation.html).
The new firmware can be found online at http://repo.onioniot.com/omega2/images/openwrt-22.03/
The new firmware can be found online at http://repo.onioniot.com/omega2/images/openwrt-23.05/

The firmware images are named according to this syntax: `<DEVICE-NAME>-<OPENWRT-VERSION>-<BUILD-DATE>.bin`
So `onion_omega2p-22.03.2-20230221.bin` is firmware made for the Omega2+/Omega2S+, based on OpenWRT release 22.03.2, and was built on Feb 21, 2023.
So `onion_omega2p-23.05.3-20240516.bin` is firmware made for the Omega2+/Omega2S+, based on OpenWRT release 23.05.3, and was built on May 16, 2024.


## Selecting Firmware
Expand All @@ -70,13 +70,13 @@ Once you know which firmware image you want to install on your device:

1. Connect to the command line of your device
1. Go to the `/tmp` directory: `cd /tmp`
1. Download the firmware image: `wget http://repo.onioniot.com.s3.amazonaws.com/omega2/images/openwrt-22.03/<SELECTED-FIRMWARE-IMAGE>.bin`
1. Download the firmware image: `wget http://repo.onioniot.com.s3.amazonaws.com/omega2/images/openwrt-23.05/<SELECTED-FIRMWARE-IMAGE>.bin`
1. Install the firwmare: `sysupgrade -F -n -v <SELECTED-FIRMWARE-IMAGE>.bin`

Say you selected firmware `onion_omega2p-22.03.3-20230526.bin`:
Say you selected firmware `onion_omega2p-23.05.3-20240516.bin`:

* Your download command would be `wget http://repo.onioniot.com.s3.amazonaws.com/omega2/images/openwrt-22.03/onion_omega2p-22.03.3-20230526.bin`
* Your installation command would be `sysupgrade -F -n -v onion_omega2p-22.03.3-20230526.bin`
* Your download command would be `wget http://repo.onioniot.com.s3.amazonaws.com/omega2/images/openwrt-23.05/onion_omega2p-23.05.3-20240516.bin`
* Your installation command would be `sysupgrade -F -n -v onion_omega2p-23.05.3-20240516.bin`


## Updating
Expand Down Expand Up @@ -290,14 +290,14 @@ For valid GPIO numbers, `gpio-lookup` would display the corresponding kernel GPI

## Pin Multiplexing

Changing the functionality of the Omega's pins is supported as of firmware `22.03.3-20230526`.
Changing the functionality of the Omega's pins is supported as of firmware `23.05.3-20240516`.

See the [Pin Multiplexing](http://docs.onion.io/omega2-docs/pin-multiplexing.html) article in the Onion Documentation for details.


## Hardware PWM

Using the Omega's hardware PWM channels is supported as for firmware `22.03.3-20230626`.
Using the Omega's hardware PWM channels is supported as for firmware `23.05.3-20230626`.

The Omega’s SoC has a number of PWM modules. The Omega2 exposes two (2) PWM hardware modules on its pin headers while the Omega2S exposes all four (4).

Expand Down Expand Up @@ -434,7 +434,7 @@ Anything software-related for the new firmware.

## NodeJS v16.19

The Omega2 supports NodeJS v16.19 starting in firmware `22.03.3-20230526`!
The Omega2 supports NodeJS v16.19 starting in firmware `23.05.3-20240516`!

To install Node, first make sure your Omega2 is connected to the internet, then run:

Expand Down

0 comments on commit d700197

Please sign in to comment.