Configuring own ASU on custom hardware

Hello, I am first time at this forum, so maybe some things are obvious from my question, but...

I have my custom build on rockchip RK3588 SoM (built by myself on top of v24.10.02 (stable) with my own patches and scripts customized).
As You can see I have also customized some metadata. Shown output is only for info, i`m playing it by my own.
root@OpenWrt:/# cat /etc/os-release

NAME="FASTOpenWrt"
VERSION="dev"
ID="fastopenwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="FASTOpenWrt dev"
VERSION_ID="dev"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r28739-d9340319c6"
OPENWRT_BOARD="rockchip/armv8"
OPENWRT_ARCH="aarch64_generic"
OPENWRT_TAINTS="no-all"
OPENWRT_DEVICE_MANUFACTURER="FAST"
OPENWRT_DEVICE_MANUFACTURER_URL="https://blabla.com"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="FAST dev 1.0.3"
OPENWRT_BUILD_DATE="1750711236"

I have pulled ASU server from here https://github.com/openwrt/asu, but, as I understand podman-containers are using official https://sysupgrade.openwrt.org mirror.
My questions here:

  1. How can I use this local server with my own build (from README I guess that is the main purpose) ?
  2. Which types of build do I need? (I already have imagebuilder and squashfs-sysupgrade generated archives).
  3. What I need to do with that files?
  4. What I need to customise, for ex. in podman-compose to use that?

In the end I want my own self-hosted upgrade server, which will provide builds according to chosen packages, as sysupgrade mechanism cannot provide saving packages after update.
Thanks for support!

1 Like

If you have your own ASU server and your device has the attendedsysupgrade-common package installed (a dependency of LuCI Attended Sysupgrade and owut), you can point the device to your ASU server with (use the server's IP address if you like):

uci set attendedsysupgrade.server.url="https://my-asu-server.lan"
uci commit

To point the ASU server to your local downloads server, modify the ASU server's .env file to contain UPSTREAM_URL=https://my.downloads.server.

For an example of how to configure your server for external package feeds, take a look at the server.repository_allow_list used on the LibreMesh ASU server at https://sysupgrade.antennine.org/json/v1/overview.json You need to put the extra feeds in the .env file as REPOSITORY_ALLOW_LIST="repo1", "repo2",... (or something like that; might need brackets? see https://fastapi.tiangolo.com/advanced/settings/#reading-a-env-file).

Your external package feeds need to have the same structure as the official OpenWrt ones, with an ASU index (preferably the index.json format, like https://downloads.openwrt.org/releases/24.10-SNAPSHOT/packages/x86_64/packages/index.json or https://downloads.openwrt.org/snapshots/packages/x86_64/packages/index.json) and the usual package manager files (depends on opkg or apk, but usually Packages.gz/packages.adb and their corresponding .sigs).

2 Likes

Thank You for answering about external package feeds, but please review my questions below.
Questions:
1. Which types of build do I need? (I already have imagebuilder and squashfs-sysupgrade generated archives).
2. What I need to do with that build files?
3. What I need to customize, for ex. in podman-compose to use procedure? I clearly see that server from the box gives full "official" list of versions from openwrt in overview.json. I don`t see any info on how to setup your own list of files and what files do I need for successful build for worker.

You only need imagebuilders.

You use the imagebuilders to create docker containers, for example if you have an x86/64 snapshot build on your downloads server with would create a container equivalent to ghcr.io/openwrt/imagebuilder:x86-64-24.10.2, except on your own docker image server instead of on the official OpenWrt one at ghcr.io/openwrt/.

When the ASU server receives a build request, it uses podman to pull and use that image for the builds. If it's a snapshot container it will then use wget to pull the imagebuilder into the running container and use that for the actual builds. The ASU side of things can be seen here: https://github.com/openwrt/asu/blob/9e423489f209eedc75338fa7f77a3470a4aebfa8/asu/build.py#L71
The docker container build code is at https://github.com/openwrt/docker

For snapshots, the docker container has a setup.sh that configures the image; for release builds, the imagebuilder is already built into the docker container. To see what's going on there, you can run these two commands and compare what's inside them to see what the ASU server expects.

podman run -it ghcr.io/openwrt/imagebuilder:x86-64-24.10.2
podman run -it ghcr.io/openwrt/imagebuilder:x86-64-main

When you add that UPSTREAM_URL entry to .env, that does all the needed changes. Your download site needs to provide the equivalent of https://downloads.openwrt.org/.versions.json at its root (in addition to all the version/target and package directories mentioned previously; basically you need to create a local, partially-populated "mirror" of downloads).

As to changes in podman-compose.yml specifically, you probably don't need any at all.

I use my local ASU server as a web server directly, without a proxy server, so I change the services: ports: assignment to 0.0.0.0:8000:8000, allowing any machine on my LAN can access the server. (Normally, you'd have a proxy like nginx or caddy running on your server machine, which would provide https access on 443 redirected to http on localhost:8000, so you wouldn't change this.)

If you are going to modify the ASU code itself, say to do development work on it, then you need to modify both services: image: and worker: image: to point to locally-built containers (they normally point up to docker.io/openwrt/asu:latest, so you get the latest upstream ASU release and not your local changes).

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.