Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
c7e89b3
change 6.7 to 6.13
lacraig2 Mar 10, 2025
62cb11d
add build options
lacraig2 Mar 10, 2025
779efca
add kernel configs
lacraig2 Mar 10, 2025
aa741b9
update dockerfile
lacraig2 Mar 10, 2025
c2a7626
add diffdefconfig
lacraig2 Apr 2, 2025
5a28b50
add new targets to build
lacraig2 Apr 2, 2025
2ee0b88
add new targets
lacraig2 Apr 2, 2025
6dfe6a2
update dockerfile
lacraig2 Apr 2, 2025
b8ba5bf
add working (for all except ppc)
lacraig2 Apr 2, 2025
418d695
drop riscv32
lacraig2 Apr 2, 2025
dfd99ac
bump 6.13
lacraig2 Apr 4, 2025
3895fb3
adjust build
lacraig2 Apr 4, 2025
3ee2bce
some config cleanup
lacraig2 Apr 14, 2025
62f5307
update kernel versions
lacraig2 Apr 14, 2025
a4be35e
more targets
lacraig2 Apr 14, 2025
47c066a
bypass config linting
lacraig2 Apr 14, 2025
da6bfb4
change kernelinfo-gdb
lacraig2 Apr 14, 2025
065c76e
temporarily revert kernel combination logic
lacraig2 Apr 14, 2025
60cf57b
update
lacraig2 Apr 18, 2025
3ebef27
update
lacraig2 Apr 18, 2025
f1a83c2
bump linux
lacraig2 Apr 22, 2025
dd8060a
bump linux
lacraig2 Apr 22, 2025
2ec586b
update 6.13
lacraig2 Apr 23, 2025
49e35f2
add ext4 and other common options
lacraig2 Apr 24, 2025
70ebd37
build: save and restore cache
lacraig2 Apr 24, 2025
77c52c5
build: use subprocess
lacraig2 Apr 24, 2025
412ae43
combine versions
lacraig2 Apr 29, 2025
bab73f8
add possibly irrelevant options
lacraig2 Apr 29, 2025
c3beee3
update 6.13
lacraig2 Apr 29, 2025
560265d
6.13: fixup configs
lacraig2 Apr 30, 2025
3d28436
update 6.13
lacraig2 Apr 30, 2025
b28b2ce
bump version
lacraig2 Apr 30, 2025
52b564b
make cache/restore cleaner
lacraig2 Apr 30, 2025
d0de428
update config option
lacraig2 Apr 30, 2025
843112c
bump 6.13
lacraig2 Apr 30, 2025
9d2a859
fixup cache
lacraig2 Apr 30, 2025
e5401bf
smaller build artifacts
lacraig2 Apr 30, 2025
d6fad8d
bump 6.13
lacraig2 May 1, 2025
de88cc6
update configs
lacraig2 May 1, 2025
87f47f0
bump linux
lacraig2 May 1, 2025
3a28360
bump
lacraig2 May 1, 2025
c5ae1fb
bump
lacraig2 May 1, 2025
f72077e
bump
lacraig2 May 1, 2025
0202524
bump linux
lacraig2 May 2, 2025
e492f5e
bump linux
lacraig2 May 3, 2025
1eb5747
bump linux
lacraig2 May 6, 2025
9ec862a
drop failing cache
lacraig2 May 6, 2025
40fa065
all-common: drop unused functionality
lacraig2 May 6, 2025
cd80bbf
config: drop powerpc ibm_cell_powerbutton
lacraig2 May 6, 2025
ed5e98a
bump linux
lacraig2 May 6, 2025
68350c4
_in_container_build.sh: add includes
lacraig2 May 11, 2025
4bce950
bump 6.13
lacraig2 May 12, 2025
d994bfe
bump linux
lacraig2 May 12, 2025
b74ff6e
bump linux
lacraig2 May 13, 2025
28a799d
bump linux
lacraig2 May 14, 2025
e233752
bump
lacraig2 May 14, 2025
88af1fa
add uprobes to config
lacraig2 May 16, 2025
c1422ab
bump
lacraig2 May 16, 2025
cd15bb8
bump linux
lacraig2 May 16, 2025
9297f7e
no need for virtualization
lacraig2 May 18, 2025
09a719a
drop kuap on powerpc and arm_pan on arm
lacraig2 May 18, 2025
622833e
bump linux
lacraig2 May 19, 2025
c66bb00
bump linux
lacraig2 May 19, 2025
b6b62a2
more config options needed by some rehostings (#42)
zestrada May 19, 2025
23f1003
attempt at generating a docker image
zestrada May 16, 2025
15255b1
cache pandare/kernel_builder to avoid hitting rate limits
zestrada May 16, 2025
7b80c5e
fixup ref
zestrada May 16, 2025
d33e6da
try to build a linux_builder container first, extract artifacts to /l…
zestrada May 16, 2025
62d4aef
try to leverage container we just built
zestrada May 16, 2025
1ae4f74
set up /app so absolute paths work
zestrada May 16, 2025
2ea0788
used wrong name for artifact container base
zestrada May 17, 2025
838ce00
no longer unpack kernel build artifacts
zestrada May 17, 2025
412e777
trying xz to see if that buys enough headroom
zestrada May 17, 2025
1646da8
last try for artifacts: "xz -9"
zestrada May 17, 2025
167748d
giving up on artifacts for container
zestrada May 18, 2025
98db034
actually copy out build
zestrada May 18, 2025
64d2806
also build on dev_6.13
lacraig2 May 19, 2025
34382dd
always push latest tag
lacraig2 May 21, 2025
7558a17
bump linux
lacraig2 May 21, 2025
f1e3d87
bump linux
lacraig2 May 21, 2025
c93392c
bump linux
lacraig2 May 21, 2025
a8b48ce
bump linux
lacraig2 May 21, 2025
b24bf88
bump linux
lacraig2 May 21, 2025
67c6946
bump linux for deadlock fix
zestrada May 23, 2025
2bbd032
serialized portal requests
zestrada May 23, 2025
9c607ae
bump linux
lacraig2 Jun 4, 2025
1819678
bump version
lacraig2 Jun 16, 2025
640a0f1
bump linux
lacraig2 Jun 18, 2025
25bcedd
bump linux
lacraig2 Jun 18, 2025
900ee9a
bump linux
lacraig2 Jun 20, 2025
a506c66
bump
lacraig2 Jun 21, 2025
249416b
_in_container_build: create minimal kernel-devel archive
lacraig2 Jul 2, 2025
f53d6e7
add kernel-devel artifacts
lacraig2 Jul 2, 2025
b8dc4a8
optimize dockerfile
lacraig2 Jul 3, 2025
1aaa95f
update build.sh
lacraig2 Jul 3, 2025
68262ff
config_module_test=y
lacraig2 Jul 3, 2025
0390dae
bump linux
lacraig2 Jul 3, 2025
faa9050
bump workflow
lacraig2 Jul 3, 2025
64bc6f9
add logging
lacraig2 Jul 3, 2025
07e9dd0
build: get the right ref
lacraig2 Jul 3, 2025
3429b26
bump linux
lacraig2 Jul 3, 2025
413e863
builder: drop broken logging
lacraig2 Jul 3, 2025
8ad4120
bump linux version
lacraig2 Jul 24, 2025
bea6708
bump linux
lacraig2 Jul 24, 2025
3153c9a
builder: use local registry
lacraig2 Jul 24, 2025
866af50
simplify
lacraig2 Jul 24, 2025
94974e5
bump
lacraig2 Jul 24, 2025
395c9d0
use buildx for kernel_builder
lacraig2 Jul 24, 2025
a988673
drop file build
lacraig2 Jul 24, 2025
2706ef1
fixup
lacraig2 Jul 24, 2025
edb3e27
dockerfile: use registry
lacraig2 Jul 24, 2025
9ba97c2
build from registry in second stage
lacraig2 Jul 24, 2025
177f1e6
modify
lacraig2 Jul 24, 2025
2221d5b
build: log in
lacraig2 Jul 24, 2025
0a9abbe
bump linuix
lacraig2 Jul 28, 2025
dc58df0
use oras
lacraig2 Jul 28, 2025
e696aeb
update reference format
lacraig2 Jul 29, 2025
a8de34c
fetch certs before pulling
lacraig2 Jul 29, 2025
fafa032
cache has to be per arch/version
lacraig2 Jul 29, 2025
c063f4e
build.yml: adjust oras
lacraig2 Jul 29, 2025
f2d3c0b
aggregate: log into rehosting arc
lacraig2 Jul 29, 2025
bc48fb2
drop upload build-revisions (unused)
lacraig2 Jul 29, 2025
1625e70
build: use pigz
lacraig2 Jul 29, 2025
3b44cc5
add clear cache job
lacraig2 Jul 29, 2025
9300e7e
fixing and debugging cache
lacraig2 Jul 29, 2025
14690b3
debug logging
lacraig2 Jul 29, 2025
b88892f
missing quote
lacraig2 Jul 29, 2025
40b3f31
overwriting values
lacraig2 Jul 29, 2025
798d72b
exclude devel in kernels-latest.tar.gz
lacraig2 Jul 29, 2025
93b1b12
fix renaming
lacraig2 Jul 29, 2025
049211e
drop caching
lacraig2 Jul 31, 2025
0af5e90
bump linux
lacraig2 Jul 31, 2025
df23976
bump linux
lacraig2 Jul 31, 2025
5b777b3
fixup
lacraig2 Jul 31, 2025
8d6deb7
bump linux
lacraig2 Aug 1, 2025
5b450d4
simplify
lacraig2 Aug 1, 2025
5e29a54
clean up build process
lacraig2 Aug 4, 2025
c1b62ac
add missing options
lacraig2 Aug 11, 2025
b2f4d1d
bump build:
lacraig2 Aug 11, 2025
5ec0f7b
_in_container_build: copy per-architecture kernels
lacraig2 Sep 19, 2025
7f2befb
all-config: add hvc_console and related options
lacraig2 Sep 19, 2025
4e336f2
build.yml: add back powerpc targets
lacraig2 Sep 22, 2025
00b2974
4.10 config options add
lacraig2 Sep 22, 2025
46150a1
build.yml: add 4.10
lacraig2 Sep 22, 2025
5de83a7
4.10: add powerpc
lacraig2 Sep 22, 2025
5d602f4
bump kernels
lacraig2 Sep 22, 2025
48cab80
_in_container_build: allow skipping non-existent targets
lacraig2 Sep 22, 2025
cdfaa57
_in_container_build: optimization don't pass boot (might break things)
lacraig2 Sep 22, 2025
8ba8005
build.yml: rewrite to make it determine things by itself
lacraig2 Sep 22, 2025
2ecbabe
build.yml: cleaner separator
lacraig2 Sep 22, 2025
912ae97
build.yml: experiment fast ci
lacraig2 Sep 22, 2025
462f099
build.yml: syntax
lacraig2 Sep 22, 2025
ebd0ccc
build.yml: cleaner logic
lacraig2 Sep 22, 2025
f253520
build.yml: set max-parallel to 8
lacraig2 Sep 22, 2025
a56bc7b
Fix build.yml tag inconsistency
lacraig2 Sep 22, 2025
81e5a89
Update build.yml
lacraig2 Sep 22, 2025
0bc159e
Update build.yml
lacraig2 Sep 22, 2025
c7cd12b
Update build.yml
lacraig2 Sep 22, 2025
8a143fb
Update build.yml
lacraig2 Sep 22, 2025
765f65a
Update build.yml
lacraig2 Sep 22, 2025
1b7cb98
build.yml: chagne working dir
lacraig2 Sep 22, 2025
e42d85d
use rehosting/linux_builder
lacraig2 Sep 22, 2025
df7169b
build.yml: use build.sh
lacraig2 Sep 22, 2025
0788327
build.sh: upate options
lacraig2 Sep 22, 2025
e55a821
Dockerfile: make targetable
lacraig2 Sep 22, 2025
a7aa984
build.yml: build on each
lacraig2 Sep 22, 2025
01e2a9d
buildx: setup buildx
lacraig2 Sep 22, 2025
cbdc80e
armeb make unused
lacraig2 Sep 22, 2025
99b2cb1
buil.yml: no .unused
lacraig2 Sep 22, 2025
5dc1825
stop pulling prebuilt
lacraig2 Sep 22, 2025
14a83bc
switch gitmodules to use local
lacraig2 Sep 22, 2025
90b74fa
build.yml: no newline
lacraig2 Sep 22, 2025
598d3b2
asdf
lacraig2 Sep 22, 2025
1bf8506
asdf
lacraig2 Sep 22, 2025
ffb7504
asdf
lacraig2 Sep 22, 2025
9472c49
fixup
lacraig2 Sep 22, 2025
80ecd59
cleanup
lacraig2 Sep 22, 2025
100e73d
build: fixup
lacraig2 Sep 22, 2025
15e6bae
typo
lacraig2 Sep 22, 2025
868fcee
build.yml: fixup
lacraig2 Sep 22, 2025
ecedf81
sort and unique
lacraig2 Sep 22, 2025
4252848
build: drop parallel restriction
lacraig2 Sep 22, 2025
fda458c
allow file
lacraig2 Sep 22, 2025
9561420
add versions
lacraig2 Sep 22, 2025
6230459
allow git protocol and extract versions
lacraig2 Sep 23, 2025
918137d
fixup build versions
lacraig2 Sep 23, 2025
a1353af
build.yml: fix target
lacraig2 Sep 23, 2025
c8594ab
use matrix.version
lacraig2 Sep 23, 2025
94291e3
Dockerfile: remove installation requirements already added to embedde…
lacraig2 Sep 23, 2025
04b6944
allow linux caching
lacraig2 Sep 23, 2025
eb660ca
build.sh: make cache dir logic cleaner
lacraig2 Sep 23, 2025
4c18f7f
build.sh: enable debug and simplify cache
lacraig2 Sep 23, 2025
453a8e9
bump linux
lacraig2 Sep 23, 2025
1753165
build.yml: use shared linux resource
lacraig2 Sep 23, 2025
918f890
fixup missing references
lacraig2 Sep 23, 2025
23b1fef
mirror unsupported in git. adding equivalent.
lacraig2 Sep 23, 2025
f3cecf4
fix up run command
lacraig2 Sep 23, 2025
333a238
cleanup and version agnostic; plus local
lacraig2 Sep 23, 2025
0b7ae8d
build.sh: auto-detect versions
lacraig2 Sep 23, 2025
5823bd6
concat versions
lacraig2 Sep 23, 2025
1e39690
simplify Dockerfile
lacraig2 Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
281 changes: 227 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,96 +12,269 @@ on:
workflow_dispatch:

jobs:
prebuild:
runs-on: rehosting-arc
outputs:
targets: ${{ steps.find_targets.outputs.targets }}
versions: ${{ steps.find_targets.outputs.versions }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}

- name: Log git revisions of all linux projects
run: |
echo "Main repo revision:" && git rev-parse HEAD
echo
echo "Submodule revisions:" && git submodule status
echo
echo "Full submodule SHAs:" && git submodule foreach 'echo $name: $(git rev-parse HEAD)'

- name: Ensure local bare clone of base Linux repo
run: |
set -eux
BASE_REPO_DIR="/home/runner/_shared/linux"
BASE_REPO_URL="https://github.com/rehosting/linux"


# Clone bare base repo if missing
if [ ! -d "$BASE_REPO_DIR" ]; then
echo "Cloning bare base repo to $BASE_REPO_DIR"
git clone --bare "$BASE_REPO_URL" "$BASE_REPO_DIR"
cd $BASE_REPO_DIR && git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
fi
# Always fetch latest from upstream
git fetch origin --prune --tags --force

- name: Ensure linux cache exists
run: |
BASE_CACHE_DIR="/home/runner/_shared/linux_builder/cache"

if [ ! -d "$BASE_CACHE_DIR" ]; then
mkdir -p "$BASE_CACHE_DIR"
fi

- name: Setup shared Linux kernel sources
run: |
RUNS_PARENT="/home/runner/_shared/runs"
RUNS_DIR="$RUNS_PARENT/$GITHUB_RUN_ID"

mkdir -p "$RUNS_DIR"
mkdir -p "$RUNS_DIR/linux"

BASE_REPO_DIR="/home/runner/_shared/linux"
BASE_REPO_URL="https://github.com/rehosting/linux"

# Update .gitmodules to use local bare repo
sed -i "s|url = https://github.com/rehosting/linux.git|url = file://$BASE_REPO_DIR|g" .gitmodules

# Initialize and update submodules for all versions
GIT_ALLOW_PROTOCOL=file:https git submodule update --init --depth 1 --jobs 2

# move into the shared run directory
mv linux/* "$RUNS_DIR/linux/"

- name: Find valid targets and versions sets
id: find_targets
run: |
TARGETS_SET=()
VERSIONS_SET=()
for version_dir in configs/*/; do
version=$(basename "$version_dir")
VERSIONS_SET+=("$version")
for config_file in "$version_dir"*; do
if [[ -f "$config_file" && ! "$config_file" =~ \.inc$ && ! "$config_file" =~ \.unused$ ]]; then
target=$(basename "$config_file")
TARGETS_SET+=("$target")
fi
done
done
UNIQUE_TARGETS=$(printf "%s\n" "${TARGETS_SET[@]}" | sort -u | awk '{printf "\"%s\",",$0}' | sed 's/,$//')
UNIQUE_VERSIONS=$(printf "%s\n" "${VERSIONS_SET[@]}" | sort -u | awk '{printf "\"%s\",",$0}' | sed 's/,$//')
TARGETS_OUTPUT="[${UNIQUE_TARGETS}]"
VERSIONS_OUTPUT="[${UNIQUE_VERSIONS}]"
echo "targets=$TARGETS_OUTPUT" >> $GITHUB_OUTPUT
echo "versions=$VERSIONS_OUTPUT" >> $GITHUB_OUTPUT
echo "Found valid targets: $TARGETS_OUTPUT"
echo "Found valid versions: $VERSIONS_OUTPUT"

build:
# Only publish on tags. run git tag vX and git push origin vX
# runs-on: self-hosted
runs-on: ubuntu-latest
needs: prebuild
runs-on: rehosting-arc
if: github.event.pull_request.draft == false


strategy:
matrix:
target: [armel, arm64, mipsel, mipseb, mips64el, mips64eb, x86_64]
version: ["4.10"] # XXX: quotes are necessary, otherwise 4.10 -> 4.1
target_version: ${{ fromJSON(needs.prebuild.outputs.targets) }}

steps:
- uses: actions/checkout@v4 # Clones to $GITHUB_WORKSPACE
- uses: actions/checkout@v4
with:
fetch-depth: 0
#submodules: 'true'
ref: ${{ github.ref }}

# Instead of getting submodules with checkout, we can do it manually to control depth.
# We don't want a full Linux history
- name: Pull kernel source
run: git submodule update --init --depth 1
- name: Extract target and version
id: extract
run: |
TARGET="${{ matrix.target_version }}"
echo "target=$TARGET" >> $GITHUB_OUTPUT
echo "Building target: $TARGET"

- name: Trust Harbor's self-signed certificate
run: |
echo "Fetching certificate from ${{ secrets.REHOSTING_ARC_REGISTRY }}"
openssl s_client -showcerts -connect ${{ secrets.REHOSTING_ARC_REGISTRY }}:443 < /dev/null 2>/dev/null | openssl x509 -outform PEM | sudo tee /usr/local/share/ca-certificates/harbor.crt > /dev/null
sudo update-ca-certificates

- name: Cache kernel build objects
uses: actions/cache@v4
- name: Log in to Rehosting Arc Registry
uses: docker/login-action@v3
with:
path: |
cache
key: ${{ runner.os }}-kernel-build-${{ matrix.kernel_version }}-${{ matrix.target }}-${{ hashFiles('**/Dockerfile', '**/*.sh') }}
restore-keys: |
${{ runner.os }}-kernel-build-${{ matrix.kernel_version }}-${{ matrix.target }}-
${{ runner.os }}-kernel-build-${{ matrix.kernel_version }}-
${{ runner.os }}-kernel-build-

- name: Lint configs
run: ./build.sh --targets ${{ matrix.target }} --versions ${{ matrix.version }} --config-only

- name: Build Kernel for ${{ matrix.target }}
run: ./build.sh --targets ${{ matrix.target }} --versions ${{ matrix.version }}

# Temporarily store each target's build output
- name: Save ${{ matrix.target }} ${{ matrix.version }} build output
uses: actions/upload-artifact@v4
registry: ${{secrets.REHOSTING_ARC_REGISTRY}}
username: ${{ secrets.REHOSTING_ARC_REGISTRY_USER }}
password: ${{ secrets.REHOSTING_ARC_REGISTRY_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
name: build-output-${{ matrix.target }}.${{ matrix.version }}
path: kernels-latest.tar.gz
driver-opts: |
image=moby/buildkit:master
network=host
buildkitd-config-inline: |
[registry."${{ secrets.REHOSTING_ARC_REGISTRY }}"]
insecure = true
http = true

- name: Build kernel_builder docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: |
rehosting/linux_builder:latest
build-args: |
REGISTRY=${{ secrets.REHOSTING_ARC_REGISTRY }}/proxy
TARGET=${{ matrix.target_version }}
cache-from: |
type=registry,ref=${{secrets.REHOSTING_ARC_REGISTRY}}/rehosting/linux_builder:${{ matrix.target_version }}_cache,mode=max
cache-to: |
type=registry,ref=${{secrets.REHOSTING_ARC_REGISTRY}}/rehosting/linux_builder:${{ matrix.target_version }}_cache,mode=max
outputs: type=docker

- name: Build Kernel for ${{ matrix.target_version }}
run: |
set -eux
TARGET="${{ matrix.target_version }}"
VERSIONS_JSON='${{ needs.prebuild.outputs.versions }}'
BASE_REPO_DIR="/home/runner/_shared/linux"
BASE_CACHE_DIR="/home/runner/_shared/linux_builder/cache"
BASE_REPO_URL="https://github.com/rehosting/linux"
RUNS_PARENT="/home/runner/_shared/runs"
RUNS_DIR="$RUNS_PARENT/$GITHUB_RUN_ID"
RUNS_DIR_LINUX="$RUNS_DIR/linux"

# Convert JSON array to space-separated string
if [ -z "$VERSIONS_JSON" ] || [ "$VERSIONS_JSON" = "[]" ]; then
VERSIONS=""
else
VERSIONS=$(echo "$VERSIONS_JSON" | jq -r '.[]' | xargs)
fi

./build.sh --targets "$TARGET" ${VERSIONS:+--versions "$VERSIONS"} --cache-dir "$BASE_CACHE_DIR" --extra-docker-opts "-v $RUNS_DIR_LINUX:/app/linux"

BUILD_OUTPUT="$RUNS_DIR/build-output"
mkdir -p $BUILD_OUTPUT
mv kernels-latest.tar.gz $BUILD_OUTPUT/kernels-latest-${TARGET}.tar.gz
mv kernel-devel-all.tar.gz $BUILD_OUTPUT/kernel-devel-all-${TARGET}.tar.gz

aggregate:
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
runs-on: rehosting-arc
env:
MATRIX_VERSIONS: ${{ toJSON(needs.build.strategy.matrix.version) }}
permissions:
actions: write
contents: write
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
- name: Trust Harbor's self-signed certificate
run: |
echo "Fetching certificate from ${{ secrets.REHOSTING_ARC_REGISTRY }}"
openssl s_client -showcerts -connect ${{ secrets.REHOSTING_ARC_REGISTRY }}:443 < /dev/null 2>/dev/null | openssl x509 -outform PEM | sudo tee /usr/local/share/ca-certificates/harbor.crt > /dev/null
sudo update-ca-certificates
- name: Log in to Rehosting Arc Registry
uses: docker/login-action@v3
with:
path: downloaded-kernels
registry: ${{secrets.REHOSTING_ARC_REGISTRY}}
username: ${{ secrets.REHOSTING_ARC_REGISTRY_USER }}
password: ${{ secrets.REHOSTING_ARC_REGISTRY_PASSWORD }}

- name: Combine all kernels into a single archive
run: |
set -eux
RUNS_PARENT="/home/runner/_shared/runs"
RUNS_DIR="$RUNS_PARENT/$GITHUB_RUN_ID"
BUILD_OUTPUT="$RUNS_DIR/build-output"

echo "[DEBUG] Listing available per-target kernel archives:"
find "$BUILD_OUTPUT" -maxdepth 1 -name "kernels-latest-*.tar.gz" -print || true

rm -rf combined-kernels && mkdir combined-kernels
# Extract each kernels-latest.tar.gz archive
for archive in $(find downloaded-kernels -name "*.tar.gz"); do

for archive in "$BUILD_OUTPUT"/kernels-latest-*.tar.gz; do
[ -e "$archive" ] || continue
echo "[DEBUG] Extracting $archive into combined-kernels"
tar -xzf "$archive" -C combined-kernels
done

# Combine OSI profiles for each kernel version
# otherwise the extracted kernel configs willc lobber each other
if [ -d combined-kernels/kernels/4.10 ] ; then
for archive in $(find downloaded-kernels -name "*.tar.gz"); do
tar -O -xf "$archive" "kernels/4.10/osi.config";
done > combined-kernels/kernels/4.10/osi.config
fi
echo "[DEBUG] Contents of combined-kernels after extraction:"
find combined-kernels || true

if [ -d combined-kernels/kernels/6.7 ] ; then
for archive in $(find downloaded-kernels -name "*.tar.gz"); do
tar -O -xf "$archive" "kernels/6.7/osi.config";
done > combined-kernels/kernels/6.7/osi.config
# Merge osi.config for every detected version directory
if [ -d combined-kernels/kernels ]; then
for vdir in combined-kernels/kernels/*; do
[ -d "$vdir" ] || continue
version=$(basename "$vdir")
echo "[DEBUG] Merging osi.config for version $version"
{
for archive in "$BUILD_OUTPUT"/kernels-latest-*.tar.gz; do
[ -e "$archive" ] || continue
tar -O -xf "$archive" "kernels/$version/osi.config" 2>/dev/null || true
done
} > "combined-kernels/kernels/$version/osi.config"
done
fi

tar -czvf kernels-latest.tar.gz -C combined-kernels .

- name: Aggregate all kernel-devel artifacts
run: |
set -eux
RUNS_PARENT="/home/runner/_shared/runs"
RUNS_DIR="$RUNS_PARENT/$GITHUB_RUN_ID"
BUILD_OUTPUT="$RUNS_DIR/build-output"

# Create a new single archive from the combined content
tar -czvf kernels-latest.tar.gz -C combined-kernels .
mkdir -p kernel-devel-all
for archive in "$BUILD_OUTPUT"/kernel-devel-all-*.tar.gz; do
[ -e "$archive" ] || continue
echo "[DEBUG] Extracting $archive into kernel-devel-all/"
tar -xzf "$archive" -C kernel-devel-all
done
tar -czvf kernel-devel-all.tar.gz -C kernel-devel-all .

- name: Create and publish release
uses: softprops/action-gh-release@v1
with:
files: kernels-latest.tar.gz
files: |
kernels-latest.tar.gz
kernel-devel-all.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref }}
tag_name: ${{ github.ref_name }}

- name: Cleanup per-run kernel clones
if: always()
run: |
RUNS_PARENT="/home/runner/_shared/runs"
RUNS_DIR="$RUNS_PARENT/$GITHUB_RUN_ID"
echo "Cleaning up kernel clones in $RUNS_DIR"
rm -rf "$RUNS_DIR"
30 changes: 30 additions & 0 deletions .github/workflows/clear_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Clear kernel cache

on:
workflow_dispatch:

jobs:
clear-cache:
runs-on: rehosting-arc
steps:
- name: Trust Harbor's self-signed certificate
run: |
echo "Fetching certificate from ${{ secrets.REHOSTING_ARC_REGISTRY }}"
openssl s_client -showcerts -connect ${{ secrets.REHOSTING_ARC_REGISTRY }}:443 < /dev/null 2>/dev/null | openssl x509 -outform PEM | sudo tee /usr/local/share/ca-certificates/harbor.crt > /dev/null
sudo update-ca-certificates
- uses: oras-project/setup-oras@v1.2.3
- name: Log in to Rehosting Arc Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REHOSTING_ARC_REGISTRY }}
username: ${{ secrets.REHOSTING_ARC_REGISTRY_USER }}
password: ${{ secrets.REHOSTING_ARC_REGISTRY_PASSWORD }}
- name: Delete all kernel cache images
run: |
set -e
repo="${{ secrets.REHOSTING_ARC_REGISTRY }}/rehosting/linux_builder_cache"
tags=$(oras repo tags $repo)
for tag in $tags; do
echo "Deleting $repo:$tag"
oras repo rm $repo:$tag || echo "Failed to delete $repo:$tag"
done
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
url = https://github.com/rehosting/linux.git
branch = main_4.10
[submodule "linux_6.7"]
path = linux/6.7
path = linux/6.13
url = https://github.com/rehosting/linux.git
branch = main_6.7
19 changes: 10 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM golang:latest as go
RUN git clone --depth 1 https://github.com/volatilityfoundation/dwarf2json.git \
&& cd dwarf2json \
&& go build

FROM ghcr.io/panda-re/embedded-toolchains:latest
COPY --from=go /go/dwarf2json/dwarf2json /bin/dwarf2json
RUN apt-get update && apt-get -y install gdb xonsh flex bison libssl-dev
ARG REGISTRY="docker.io"
ARG TARGET="latest"
FROM ${REGISTRY}/rehosting/embedded-toolchains:${TARGET}

# Get panda for kernelinfo_gdb. Definitely a bit overkill to pull the whole repo
RUN git clone --depth 1 https://github.com/panda-re/panda.git
RUN mkdir /extract_kernelinfo && \
wget https://raw.githubusercontent.com/panda-re/panda-ng/refs/heads/main/plugins/osi_linux/utils/kernelinfo_gdb/extract_kernelinfo.py -O /extract_kernelinfo/extract_kernelinfo.py && \
wget https://raw.githubusercontent.com/panda-re/panda-ng/refs/heads/main/plugins/osi_linux/utils/kernelinfo_gdb/run.sh -O /extract_kernelinfo/run.sh && \
chmod +x /extract_kernelinfo/run.sh

RUN wget https://github.com/volatilityfoundation/dwarf2json/releases/download/v0.9.0/dwarf2json-linux-amd64 -O /bin/dwarf2json && \
chmod +x /bin/dwarf2json
Loading
Loading