From 3fd3433e078d4042d92cf08cb6d816e4a3ac54bf Mon Sep 17 00:00:00 2001 From: tmaior Date: Thu, 14 Mar 2024 16:03:02 -0300 Subject: [PATCH 1/8] create release automation --- .github/workflows/release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7ba5824 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,13 @@ +name: Release to production +on: + release: + types: [published] +permissions: write-all +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: push to release branch + run: git push -f origin "HEAD:refs/heads/release" \ No newline at end of file From 7f5f09d210c08abc9a64cb8e9f7582f11bb39314 Mon Sep 17 00:00:00 2001 From: Lazar Date: Fri, 15 Mar 2024 12:11:56 -0400 Subject: [PATCH 2/8] dummy commit to trigger CD system --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0bca0a..5a1a7e3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenWRT-Packages -Onion Packages for OpenWRT firmware. Intended for the Onion Omega2 & Omega2+ devices +Onion Packages for OpenWRT firmware. Intended for the Onion Omega2 & Omega2+ devices ![Omega2+ and Omega2S+](https://github.com/OnionIoT/source/raw/openwrt-18.06/omega2-family.png) From f762197f0bcd8c167955a533da64a224288dbe1f Mon Sep 17 00:00:00 2001 From: Lazar Date: Wed, 20 Mar 2024 18:00:33 -0400 Subject: [PATCH 3/8] Update README.md to include details on completed CD system updates --- README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a1a7e3..714ff84 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,59 @@ Onion Packages for OpenWRT firmware. Intended for the Onion Omega2 & Omega2+ dev The latest compiled packages can be found at: http://repo.onioniot.com/omega2/packages/openwrt-22.03.5/ -And firmware with these packages can be found at: http://repo.onioniot.com/omega2/images/openwrt-22.03/ \ No newline at end of file +And firmware with these packages can be found at: http://repo.onioniot.com/omega2/images/openwrt-22.03/ + +--- + +# 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: `22.03.5`) +* `$RELEASE` is the `OPENWRT_RELEASE` from the `imagebuilder-profile` config file (for example: `22.03`) + +Image files will be named with the following syntax: `--.bin` +For example: `onion_omega2-22.03.5-20240318.bin` + +## Development Builds in Branches + +When a new branch is created from the `openwrt-22.03` 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 `__` where `` 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 From bd60a9a681683bf50c01af7ccfb6a37d76cada06 Mon Sep 17 00:00:00 2001 From: Lazar Date: Thu, 2 May 2024 15:47:56 -0400 Subject: [PATCH 4/8] Update README.md to include development instructions --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/README.md b/README.md index 714ff84..ad9dbf9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,20 @@ Onion Packages for OpenWRT firmware. Intended for the Onion Omega2 & Omega2+ devices +- [OpenWRT-Packages](#openwrt-packages) + * [Where can I find the compiled output of this repo?](#where-can-i-find-the-compiled-output-of-this-repo) +- [Developing with this Repo](#developing-with-this-repo) + * [How Can I Compile the Packages in this Repo for the Omega2 Device?](#how-can-i-compile-the-packages-in-this-repo-for-the-omega2-device) + + [Compiling the Packages as they are in this repo](#compiling-the-packages-as-they-are-in-this-repo) + + [Compiling the Packages from a local clone of this repo](#compiling-the-packages-from-a-local-clone-of-this-repo) + * [How Can I Build Firmware that includes the packages from this repo?](#how-can-i-build-firmware-that-includes-the-packages-from-this-repo) + + [Building Firmware with Published Packages](#building-firmware-with-published-packages) + + [Building Firmware with the Packages from a local clone of this repo](#building-firmware-with-the-packages-from-a-local-clone-of-this-repo) +- [Continuous Deployment Details](#continuous-deployment-details) + * [Development Builds in Branches](#development-builds-in-branches) + * [Newly Created Releases](#newly-created-releases) + * [Process: Creating a Release](#process-creating-a-release) + ![Omega2+ and Omega2S+](https://github.com/OnionIoT/source/raw/openwrt-18.06/omega2-family.png) ## Where can I find the compiled output of this repo? @@ -10,6 +24,59 @@ The latest compiled packages can be found at: http://repo.onioniot.com/omega2/pa And firmware with these packages can be found at: http://repo.onioniot.com/omega2/images/openwrt-22.03/ +> 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 From 04933fc019b9ba0ad36dbfc43779b9bf8d38cec1 Mon Sep 17 00:00:00 2001 From: Yevhenii Onishchenko Date: Wed, 15 May 2024 11:53:56 +0300 Subject: [PATCH 5/8] Fix onion-dt-overlay postinst script to have error-free build Build fails if onion-dt-overlay-sw-spi package is included (*) in build and works fine if only package building is (M) enabled. Onion-dt-overlay package postinst script tries to create /sys/kernel/config/ directory which is not allowed during image building process. The fix introduces correct usage of IPKG_INSTROOT variable in bash, so the postinst script should be executed only on a target hardware. Resolves: #91 --- onion-dt-overlay/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/onion-dt-overlay/Makefile b/onion-dt-overlay/Makefile index cc5eebb..b7e75a5 100644 --- a/onion-dt-overlay/Makefile +++ b/onion-dt-overlay/Makefile @@ -68,7 +68,12 @@ define BuildDtbo define Package/onion-dt-overlay-$(1)/postinst #!/bin/sh - if [ -z "$${IPKG_INSTROOT}" ]; then + if [ -z "$$$${IPKG_INSTROOT}" ]; then + if ! cat /proc/mounts | grep -q config; then + echo "Mounting configfs..." + mount -t configfs none /sys/kernel/config + fi + mkdir -p /sys/kernel/config/device-tree/overlays/$(1) cat /lib/firmware/device-tree/overlays/$(1).dtbo > /sys/kernel/config/device-tree/overlays/$(1)/dtbo fi From 49f9d6f14be7db11ff474c707a690aa9e2d3e0a1 Mon Sep 17 00:00:00 2001 From: Lazar Date: Thu, 16 May 2024 10:28:21 -0400 Subject: [PATCH 6/8] Upped package release number --- onion-dt-overlay/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onion-dt-overlay/Makefile b/onion-dt-overlay/Makefile index b7e75a5..44ce0e5 100644 --- a/onion-dt-overlay/Makefile +++ b/onion-dt-overlay/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=onion-dt-overlay PKG_VERSION:=1.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)) LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) DTC=$(LINUX_DIR)/scripts/dtc/dtc From 695732aaf46114a00e5c5c314b2465fad5fa8a93 Mon Sep 17 00:00:00 2001 From: Yevhenii Onishchenko Date: Fri, 17 May 2024 11:19:45 +0300 Subject: [PATCH 7/8] Add kernel dependencies for onion-dt-overlay-sw-spi package Resolves: #92 --- onion-dt-overlay/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onion-dt-overlay/Makefile b/onion-dt-overlay/Makefile index 44ce0e5..6107c43 100644 --- a/onion-dt-overlay/Makefile +++ b/onion-dt-overlay/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=onion-dt-overlay PKG_VERSION:=1.0 -PKG_RELEASE:=4 +PKG_RELEASE:=5 KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)) LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) DTC=$(LINUX_DIR)/scripts/dtc/dtc @@ -84,5 +84,5 @@ define BuildDtbo endef $(eval $(call BuildPackage,onion-dt-overlay)) -$(eval $(call BuildDtbo,sw-spi,,Provides SW SPI)) +$(eval $(call BuildDtbo,sw-spi,+kmod-mmc-spi +kmod-spi-bitbang +kmod-spi-dev +kmod-spi-gpio,Provides SW SPI)) $(eval $(call BuildDtbo,w1-gpio,+kmod-w1 +kmod-w1-master-gpio +kmod-w1-slave-therm,Provides One Wire GPIO)) From 1038d97d6a2362e2e95078e3d2a62bd118038aef Mon Sep 17 00:00:00 2001 From: Lazar Date: Fri, 17 May 2024 18:23:22 -0400 Subject: [PATCH 8/8] Upped release number - fixes for dt overlay sw spi --- omega2-base/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omega2-base/Makefile b/omega2-base/Makefile index 1918f5b..99e481b 100644 --- a/omega2-base/Makefile +++ b/omega2-base/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omega2-base PKG_VERSION:=22.03.5 -PKG_RELEASE:=20240122 +PKG_RELEASE:=20240517 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)