Skip to content

Commit 60785e0

Browse files
committed
fix: restore custom features
1 parent 7182123 commit 60785e0

8 files changed

Lines changed: 431 additions & 753 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/local/Makefile.local

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
KERNELRELEASE ?= $(shell uname -r)
2+
KSRC ?= /lib/modules/$(KERNELRELEASE)/build
3+
4+
CONFIG_CLK_RK3308 ?= rockchip
5+
CONFIG_CLK_RK3328 ?= rockchip
6+
CONFIG_CLK_RK3399 ?= rockchip
7+
CONFIG_CLK_RK3528 ?= rockchip
8+
CONFIG_CLK_RK3568 ?= rockchip
9+
CONFIG_CLK_RK3576 ?= rockchip
10+
CONFIG_CLK_RK3588 ?= rockchip
11+
CONFIG_ARCH_MESON ?= amlogic
12+
CONFIG_ARCH_SUNXI ?= allwinner
13+
include $(wildcard arch/arm64/boot/dts/*/overlays/Makefile)
14+
15+
DTBO-ALLWINNER := $(addprefix arch/arm64/boot/dts/allwinner/overlays/,$(dtb-allwinner))
16+
DTBO-AMLOGIC := $(addprefix arch/arm64/boot/dts/amlogic/overlays/,$(dtb-amlogic))
17+
DTBO-ROCKCHIP := $(addprefix arch/arm64/boot/dts/rockchip/overlays/,$(dtb-rockchip))
18+
DTBO := $(DTBO-AMLOGIC) $(DTBO-ROCKCHIP) $(DTBO-ALLWINNER)
19+
TMP := $(addsuffix .tmp,$(DTBO))
20+
21+
.PHONY: build-dtbo
22+
build-dtbo: $(DTBO)
23+
24+
%.dtbo: %.dts
25+
cpp -nostdinc -undef -x assembler-with-cpp -E -I "$(KSRC)/include" "$<" "$@.tmp"
26+
dtc -@ -I dts -O dtb -o "$@" "$@.tmp"
27+
28+
.PHONY: clean-dtbo
29+
clean-dtbo:
30+
rm -rf $(DTBO) $(TMP)
31+
32+
clean: clean-dtbo

.github/local/rules.local

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
override_dh_dkms:
2+
dh_dkms -V $(DEB_VERSION)
3+
4+
override_dh_install:
5+
DEB_VERSION=$(DEB_VERSION) dh_install -X arch/arm64/boot/dts/rockchip/overlays/Makefile.rk3588-can

.github/workflows/new_version.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & Release
1+
name: Test overlays
22
on:
33
workflow_dispatch:
44
merge_group:
@@ -106,96 +106,3 @@ jobs:
106106
name: ${{ matrix.version }}
107107
path: |
108108
arch/**/*.dtbo
109-
build:
110-
runs-on: ubuntu-latest
111-
outputs:
112-
distro: ${{ steps.distro_check.outputs.distro }}
113-
steps:
114-
- name: Checkout
115-
uses: actions/checkout@v5
116-
with:
117-
submodules: recursive
118-
fetch-depth: 0
119-
- name: Test
120-
run: |
121-
make test
122-
- name: Build
123-
run: |
124-
sudo apt-get update
125-
sudo apt-get build-dep --no-install-recommends -y .
126-
make all deb
127-
- name: Workaround actions/upload-artifact#176
128-
run: |
129-
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
130-
- name: Upload artifacts
131-
uses: actions/upload-artifact@v4
132-
with:
133-
name: ${{ github.event.repository.name }}
134-
path: |
135-
${{ env.artifacts_path }}/*.deb
136-
- name: Check if the latest version is releasable
137-
id: distro_check
138-
run: |
139-
version="$(dpkg-parsechangelog -S Version)"
140-
if [[ -n "$(git tag -l "$version")" ]]
141-
then
142-
echo "distro=UNRELEASED" >> "$GITHUB_OUTPUT"
143-
else
144-
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> "$GITHUB_OUTPUT"
145-
fi
146-
release:
147-
runs-on: ubuntu-latest
148-
needs: [build-dtbo, build]
149-
if: github.event_name != 'pull_request' && github.event_name != 'merge_group' && github.ref_name == 'main' && needs.build.outputs.distro != 'UNRELEASED'
150-
permissions:
151-
contents: write
152-
steps:
153-
- name: Checkout
154-
uses: actions/checkout@v5
155-
with:
156-
submodules: recursive
157-
fetch-depth: 0
158-
- uses: actions/download-artifact@v5
159-
with:
160-
name: ${{ github.event.repository.name }}
161-
path: .artifacts
162-
- name: Prepare for release
163-
run: |
164-
version="$(dpkg-parsechangelog -S Version)"
165-
echo "version=$version" >> $GITHUB_ENV
166-
echo "changes<<EOF" >> $GITHUB_ENV
167-
echo '```' >> $GITHUB_ENV
168-
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
169-
echo '```' >> $GITHUB_ENV
170-
echo "EOF" >> $GITHUB_ENV
171-
echo "$version" > VERSION
172-
if [[ -f pkg.conf.template ]]
173-
then
174-
sed "s/VERSION/$(dpkg-parsechangelog -S Version)/g" pkg.conf.template > pkg.conf
175-
fi
176-
- name: Release
177-
uses: softprops/action-gh-release@v2
178-
with:
179-
tag_name: ${{ env.version }}
180-
body_path: README.md
181-
token: ${{ secrets.GITHUB_TOKEN }}
182-
target_commitish: ${{ github.ref_name }}
183-
draft: false
184-
fail_on_unmatched_files: false
185-
files: |
186-
.artifacts/**/*.deb
187-
pkg.conf
188-
VERSION
189-
- name: Append changelog
190-
uses: softprops/action-gh-release@v2
191-
with:
192-
tag_name: ${{ env.version }}
193-
body: |
194-
## Changelog for ${{ env.version }}
195-
${{ env.changes }}
196-
append_body: true
197-
- name: Update Test repos
198-
uses: radxa-repo/update-repo-action@main
199-
with:
200-
test-repo: true
201-
token: ${{ secrets.RADXA_APT_TEST_REPO_TOKEN }}

DEVELOPMENT.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Development
2+
3+
## Build overlays locally
4+
5+
First, make sure you have the running kernel header, `gcc`, and `device-tree-compiler` installed.
6+
7+
You can then run the following command to build overlays:
8+
9+
```bash
10+
make build-dtbo -j$(nproc)
11+
```
12+
13+
Please be aware this only builds a subset of overlays, and any overlays that depend on vendor headers will fail,
14+
as this command will use the current system's kernel header.
15+
16+
Please take a look at the [CI workflow](.github/workflows/test.yaml) to see how to select installed vendor kernel header.
17+
18+
To delete built overlays, run the following command:
19+
20+
```bash
21+
make clean
22+
```
23+
24+
## Download prebuilt artifacts
25+
26+
As part of our CI pipeline, the built overlays are uploaded at the end. You can find all CI runs [here](https://github.com/radxa/overlays/actions), and the artifact is located inside each run.
27+
28+
Please be aware that artifacts expire over time, and they are not officially tested versions.
29+
30+
## Code style
31+
32+
We mandate reference style for our overlays. Please visit the [DTO Syntax](https://source.android.com/docs/core/architecture/dto/syntax#reference) page to learn more.
33+
34+
If your existing overlay uses `target-path`, then the Android documentation does not show a clear migration path. Below is an example of how to convert them:
35+
36+
```dtos
37+
/{
38+
fragment@0 {
39+
target-path = "/";
40+
__overlay__ {
41+
some_node: some-node {
42+
some_prop = "okay";
43+
...
44+
};
45+
};
46+
};
47+
}
48+
```
49+
50+
```dtos
51+
&{/} {
52+
some_node: some-node {
53+
some_prop = "okay";
54+
...
55+
};
56+
}
57+
```
58+
59+
## Metadata specs
60+
61+
Currently, we mandate a custom `metadata` node in overlays. This data is parsed by [`rsetup`](https://github.com/radxa-pkg/rsetup) to provide a human-readable description and conflict detection. Below is a sample `metadata` node with detailed guidelines:
62+
63+
```
64+
/ {
65+
metadata {
66+
title = "Enable ENC28J60 on SPI2";
67+
category = "misc";
68+
compatible = "unknown";
69+
description = "Enable Microchip ENC28J60 SPI Ethernet controller on SPI2.\nINT=40";
70+
exclusive = "GPIO2_B3", "GPIO2_B2", "GPIO2_B1", "GPIO2_B4", "GPIO4_A7";
71+
package = "dkms-enc28j60";
72+
};
73+
};
74+
```
75+
76+
### A. Title (string)
77+
78+
1. `title` should not contain the product name.
79+
`rsetup` will only show compatible overlays with `compatible` field defined. As such, do not confuse users to second guess if an overlay is truly compatible when the product name is not explicitly mentioned.
80+
2. `title` should not end with a period.
81+
82+
### B. Category (string)
83+
84+
1. `category` currently can be one of the following:
85+
camera, display, misc
86+
87+
### C. Compatible (array)
88+
89+
1. `compatible` should not be an SoC unless it is truly compatible with every product using that SoC.
90+
`rsetup` will match the base device tree's `compatible` with the overlay's `compatible`. As long as one value from each match, the overlay is considered compatible. Since most products' device tree contains their SoC in `compatible`, setting SoC in overlay's `compatible` will make it compatible with every such product.
91+
Explicit products list should be preferred to generic SoC matching.
92+
2. If an overlay is broken, `compatible` should be `unknown`.
93+
94+
### D. Description (string)
95+
96+
1. `description` is a multi-line text to describe the function of the overlay. It can be the same as `title` with an ending period.
97+
2. Newline in `description` should use `\n`.
98+
3. Hardware parameters should be listed at the end to help the user connecting their devices.
99+
100+
### E. Exclusive (array)
101+
102+
1. `exclusive` should refer to the device tree node and property.
103+
2. For features that are muxed to a GPIO line, `exclusive` should be the GPIO ID.
104+
3. For features that use multiple GPIO lines, they should all be listed under `exclusive`.
105+
4. For complex overlay, list all GPIO lines used.
106+
For exaple, some devices may use GPIO for interrupt, which is also used by another overlay.
107+
108+
### F. Package (array)
109+
110+
1. `package` specify the additional packages to be used with this overlay.
111+
2. When the overlay is disabled, the specified package will NOT be removed.

0 commit comments

Comments
 (0)