Skip to content

Commit 94865a7

Browse files
committed
Add the base for creating a vendor example using infix
0 parents  commit 94865a7

File tree

16 files changed

+986
-0
lines changed

16 files changed

+986
-0
lines changed

.github/workflows/build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Bob the Builder
2+
3+
on:
4+
#pull_request:
5+
#push:
6+
# branches:
7+
# - main
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
if: ${{github.ref_name == 'main' && github.event_name == 'push'}} || github.event_name == 'workflow_dispatch'
13+
name: Vendor example build [${{ matrix.platform }}]
14+
runs-on: [self-hosted, latest]
15+
strategy:
16+
matrix:
17+
platform: [aarch64, x86_64]
18+
fail-fast: false
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
clean: true
23+
submodules: recursive
24+
25+
- name: Set Build Variables
26+
id: vars
27+
run: |
28+
target=${{ matrix.platform }}
29+
echo "dir=vendor-example-$target" >> $GITHUB_OUTPUT
30+
echo "tgz=vendor-example-$target.tar.gz" >> $GITHUB_OUTPUT
31+
32+
- name: Restore Cache of dl/
33+
uses: actions/cache@v4
34+
with:
35+
path: dl/
36+
key: dl-${{ matrix.platform }}-${{ hashFiles('.git/modules/infix/refs/heads/main', 'configs/*') }}
37+
restore-keys: |
38+
dl-${{ matrix.platform }}-
39+
dl-
40+
41+
- name: Restore Cache of .ccache/
42+
uses: actions/cache@v4
43+
with:
44+
path: .ccache/
45+
key: ccache-${{ matrix.platform }}-${{ hashFiles('.git/modules/infix/refs/heads/main', 'configs/*') }}
46+
restore-keys: |
47+
ccache-${{ matrix.platform }}-
48+
ccache-
49+
50+
- name: Configure & Build
51+
run: |
52+
target=${{ matrix.platform }}_vendor_example_defconfig
53+
echo "Buildring $target ..."
54+
make $target
55+
make
56+
57+
- name: Prepare Artifact
58+
run: |
59+
cd output
60+
mv images ${{ steps.vars.outputs.dir }}
61+
ln -s ${{ steps.vars.outputs.dir }} images
62+
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
63+
64+
- uses: actions/upload-artifact@v4
65+
with:
66+
path: output/${{ steps.vars.outputs.tgz }}
67+
name: artifact-${{ matrix.platform }}
68+
69+
release:
70+
if: github.repository == 'kernelkit/vendor-example' && github.ref == 'refs/heads/main'
71+
permissions: write-all
72+
name: Upload Latest Build
73+
needs: build
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/download-artifact@v4
77+
with:
78+
pattern: "artifact-*"
79+
merge-multiple: true
80+
- uses: ncipollo/release-action@v1
81+
with:
82+
allowUpdates: true
83+
omitName: true
84+
omitBody: true
85+
omitBodyDuringUpdate: true
86+
prerelease: true
87+
tag: "latest"
88+
token: ${{ secrets.GITHUB_TOKEN }}
89+
artifacts: "*.tar.gz"
90+
- name: Summary
91+
run: |
92+
cat <<EOF >> $GITHUB_STEP_SUMMARY
93+
# Latest Build Complete! :rocket:
94+
95+
For the public download links of these build artifacts, please see:
96+
<https://github.com/kernelkit/vendor-example/releases/tag/latest>
97+
EOF

.github/workflows/release.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Release General
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]*.*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
required: false
11+
type: string
12+
13+
jobs:
14+
build:
15+
name: Building Vendor Example Reference Release ${{ github.ref_name }} [${{ matrix.platform }}]
16+
runs-on: [self-hosted, release]
17+
strategy:
18+
matrix:
19+
platform: [aarch64, x86_64]
20+
fail-fast: false
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
clean: true
25+
submodules: recursive
26+
27+
- name: Set Release Variables
28+
id: vars
29+
run: |
30+
if [ -n "${{ inputs.version }}" ]; then
31+
ver=${{ inputs.version }}
32+
else
33+
ver=${GITHUB_REF#refs/tags/v}
34+
fi
35+
echo "ver=${ver}" >> $GITHUB_OUTPUT
36+
if echo $ver | grep -qE '[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then
37+
echo "pre=true" >> $GITHUB_OUTPUT
38+
else
39+
echo "pre=false" >> $GITHUB_OUTPUT
40+
fi
41+
target=${{ matrix.target }}-${ver}
42+
echo "dir=dcp-sc-28p-$target" >> $GITHUB_OUTPUT
43+
echo "tgz=dcp-sc-28p-$target.tar.gz" >> $GITHUB_OUTPUT
44+
45+
- name: Restore Cache of dl/
46+
uses: actions/cache@v4
47+
with:
48+
path: dl/
49+
key: dl-${{ matrix.platform }}-${{ hashFiles('.git/modules/infix/refs/heads/main', 'configs/*') }}
50+
restore-keys: |
51+
dl-${{ matrix.platform }}-
52+
dl-
53+
54+
- name: Restore Cache of .ccache/
55+
uses: actions/cache@v4
56+
with:
57+
path: .ccache/
58+
key: ccache-${{ matrix.platform }}-${{ hashFiles('.git/modules/infix/refs/heads/main', 'configs/*') }}
59+
restore-keys: |
60+
ccache-${{ matrix.platform }}-
61+
ccache-
62+
63+
- name: Configure & Build
64+
env:
65+
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
66+
run: |
67+
target=${{ matrix.platform }}_minimal_defconfig
68+
echo "Buildring $target ..."
69+
make $target
70+
make
71+
72+
- name: Prepare Artifact
73+
run: |
74+
cd output
75+
mv images ${{ steps.vars.outputs.dir }}
76+
ln -s ${{ steps.vars.outputs.dir }} images
77+
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
78+
79+
- uses: actions/upload-artifact@v4
80+
with:
81+
path: output/${{ steps.vars.outputs.tgz }}
82+
name: artifact-${{ matrix.platform }}
83+
84+
release:
85+
name: Release Infix / Vendor Example ${{ github.ref_name }}
86+
needs: build
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: actions/download-artifact@v4
91+
with:
92+
pattern: "artifact-*"
93+
merge-multiple: true
94+
- name: Extract ChangeLog entry ...
95+
run: |
96+
awk '/-----*/{if (x == 1) exit; x=1;next}x' doc/ChangeLog.md \
97+
|head -n -1 > release.md
98+
cat release.md
99+
- uses: ncipollo/release-action@v1
100+
with:
101+
name: Vendor example Reference Release ${{ github.ref_name }}
102+
prerelease: ${{ needs.vars.outputs.pre }}
103+
bodyFile: release.md
104+
artifacts: "*.tar.gz*"
105+
- name: Summary
106+
run: |
107+
cat <<EOF >> $GITHUB_STEP_SUMMARY
108+
For the public download links of this release, please see:
109+
<https://github.com/kernelkit/vendor-example/releases/tag/${{ github.ref_name }}>
110+
EOF

.github/workflows/sync-infix.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Automatically sync Infix
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 2 * * *'
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
commit:
12+
runs-on: [ self-hosted, latest ]
13+
if: ${{ env.SYNC_INFIX }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
token: ${{ secrets.COMMIT_TOKEN }}
18+
fetch-depth: 0
19+
submodules: true
20+
21+
- name: Check for updates on infix and commit them
22+
run: |
23+
git config --global user.name 'Wires bot'
24+
git config --global user.email '[email protected]'
25+
26+
CHANGES=0
27+
28+
if git ls-remote --heads origin latest | grep -q latest; then
29+
echo "Latest exists, checking out"
30+
git checkout latest
31+
git submodule update --init --recursive
32+
else
33+
echo "Latest does not exist, create it"
34+
git checkout -b latest
35+
fi
36+
37+
cd infix
38+
git checkout main
39+
git pull origin main
40+
cd ..
41+
42+
if [[ -n "$(git diff --exit-code infix)" ]]; then
43+
git add infix
44+
git commit infix -m "Step up infix"
45+
CHANGES=1
46+
fi
47+
48+
make defconfigs-generate
49+
if [[ -n "$(git diff --exit-code configs)" ]]; then
50+
git add configs
51+
git commit configs/ -m "Update defconfigs"
52+
CHANGES=1
53+
fi
54+
55+
if [ $CHANGES -eq 1 ]; then
56+
git push origin latest
57+
fi

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*~
2+
/.ccache
3+
/dl
4+
/output*
5+
/local.mk

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "infix"]
2+
path = infix
3+
url = [email protected]:kernelkit/infix.git

Config.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#source "$BR2_EXTERNAL_VENDOR_EXAMPLE_PATH/package/Config.in"

Makefile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
export BR2_EXTERNAL := $(CURDIR)/infix:$(CURDIR)
2+
3+
ARCH ?= $(shell uname -m)
4+
O ?= $(CURDIR)/output
5+
6+
config := $(O)/.config
7+
bmake = $(MAKE) -C infix/buildroot O=$(O) $1
8+
imake = $(MAKE) -C infix O=$(O) $1
9+
10+
11+
all: $(config) infix/buildroot/Makefile
12+
@+$(call bmake,$@)
13+
14+
$(config):
15+
@+$(call bmake,list-defconfigs)
16+
@echo "ERROR: No configuration selected."
17+
@echo "Please choose a configuration from the list above by running"
18+
@echo "'make <board>_defconfig' before building an image."
19+
@exit 1
20+
21+
%_defconfig: configs/%_defconfig
22+
@+$(call bmake,$@)
23+
24+
%: | infix/buildroot/Makefile
25+
@+$(call bmake,$@)
26+
27+
infix/buildroot/Makefile:
28+
@git submodule update --init --recursive
29+
30+
.PHONY: all
31+
32+
.PHONY: test
33+
34+
test:
35+
$(call imake,test)
36+
37+
test-spec:
38+
$(call imake,test-spec)
39+
40+
defconfigs-generate:
41+
./infix/utils/generate-defconfig.sh -b infix/configs/aarch64_defconfig -c config-snippets/vendor.conf -o configs/aarch64_defconfig
42+
./infix/utils/generate-defconfig.sh -b infix/configs/x86_64_defconfig -c config-snippets/vendor.conf -o configs/x86_64_defconfig
43+
./infix/utils/generate-defconfig.sh -b infix/configs/aarch64_minimal_defconfig -c config-snippets/vendor.conf -o configs/aarch64_minimal_defconfig
44+
./infix/utils/generate-defconfig.sh -b infix/configs/x86_64_minimal_defconfig -c config-snippets/vendor.conf -o configs/x86_64_minimal_defconfig

Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Vendor example for infix
2+
3+
This repo is an example of how to extend standard Infix

config-snippets/vendor.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
INFIX_VENDOR="Example"
2+
INFIX_VENDOR_HOME="http://www.company.com"
3+
INFIX_NAME="Example"
4+
INFIX_ID="Example"
5+
BR2_TARGET_GENERIC_HOSTNAME="example"
6+
BR2_TARGET_GENERIC_ISSUE=""
7+
INFIX_COMPATIBLE="infix-${BR2_ARCH}"
8+
INFIX_HOME="https://www.company.com"
9+
INFIX_DOC="https://www.company.com"
10+
INFIX_SUPPORT="mailto:support@vendor"
11+
INFIX_OEM_PATH="${BR2_EXTERNAL_VENDOR_EXAMPLE_PATH}"
12+
BR2_CCACHE_DIR="${BR2_EXTERNAL_VENDOR_EXAMPLE_PATH}/.ccache"
13+
BR2_DL_DIR="${BR2_EXTERNAL_VENDOR_EXAMPLE_PATH}/dl"

0 commit comments

Comments
 (0)