Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
103 changes: 4 additions & 99 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
workflow_dispatch:

env:
KERNEL_FAMILY: 6.x
KERNEL_VERSION: 6.12.25
PICORE_VERSION_MAJOR: 16
PICORE_VERSION_MINOR: 0
Expand Down Expand Up @@ -202,104 +201,13 @@ jobs:
name: rootfs-${{matrix.package}}
path: "${{github.workspace}}/artifacts/rootfs-${{matrix.package}}-${{env.PICORE_VERSION_MAJOR}}.${{env.PICORE_VERSION_MINOR}}.gz"

build-kernel-qemu:
runs-on: ubuntu-24.04-arm
steps:
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/asssaf/picore-kernel-qemu
tags: "type=raw,value=${{ env.TAG }},priority=2000"

- name: build deps
if: false
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile.kernel-qemu
platforms: linux/arm64/v8
target: deps
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: build kernel
if: false
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile.kernel-qemu
platforms: linux/arm64/v8
target: build
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: output kernel
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile.kernel-qemu
platforms: linux/arm64/v8
target: kernel
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: "type=local,dest=${{github.workspace}}/artifacts"

- name: upload kernel for qemu
uses: actions/upload-artifact@v4
with:
name: kernel8-qemu-${{ env.KERNEL_VERSION }}
path: "${{github.workspace}}/artifacts/Image-${{ env.KERNEL_VERSION }}"

- name: upload config for qemu
uses: actions/upload-artifact@v4
with:
name: config-kernel8-qemu-${{ env.KERNEL_VERSION }}
path: "${{github.workspace}}/artifacts/config-${{ env.KERNEL_VERSION }}"

- name: output modules
if: false
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile.kernel-qemu
platforms: linux/arm64/v8
target: modules
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: "type=tar,dest=${{github.workspace}}/artifacts/modules-${{ env.KERNEL_VERSION }}.tar"

- name: upload modules for qemu
if: false
uses: actions/upload-artifact@v4
with:
name: modules-qemu-${{ env.KERNEL_VERSION }}
path: "${{github.workspace}}/artifacts/modules-${{ env.KERNEL_VERSION }}.tar"

test:
strategy:
matrix:
package: [piCore, piCore64]
runs-on: ubuntu-24.04
needs: [build, build-kernel-qemu]
needs: [build]
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -309,12 +217,6 @@ jobs:
sudo apt update
sudo apt install -y qemu-system-arm

- name: download-kernel
uses: actions/download-artifact@v4
with:
name: kernel8-qemu-${{ env.KERNEL_VERSION }}
path: "${{github.workspace}}"

- name: download-tce-disk
uses: actions/download-artifact@v4
with:
Expand All @@ -334,6 +236,9 @@ jobs:
run: |
set -euxo pipefail

docker create --name rpi-kernel --platform linux/arm64/v8 ghcr.io/asssaf/rpi-kernel:${{ env.KERNEL_VERSION }}-default true
docker cp rpi-kernel:/Image-${{ env.KERNEL_VERSION }} .

scripts/run-tc.sh |& tee qemu.out &

until sshpass -p piCore ssh -o StrictHostKeychecking=no -p 2223 tc@127.0.0.1 echo hi
Expand Down
66 changes: 0 additions & 66 deletions docker/Dockerfile.kernel-qemu

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,50 @@ exec 2>&1

BOOT="/etc/sysconfig/tcedir/../bootattempt"
DELAY=30
MAX_ATTEMPTS=2

while [ -e "$BOOT" ]
cmdline="$(cat /proc/cmdline)"

for i in $cmdline
do
echo "Previous boot failed - remove $BOOT to continue"
sleep 5
case $i in
recovery=*)
MAX_ATTEMPTS=${i#*=}
;;
esac
done

echo "Booting second partition in $DELAY seconds ..."
sleep $DELAY
touch "$BOOT"
sync
tryboot "2"
sleep $DELAY

loop() {
if [ ! -e "${BOOT}" ]
then
echo "${BOOT} doesn't exist - create it to start recovery auto boot"
return 0
fi

ATTEMPT="$(cat "$BOOT")"
case "$ATTEMPT" in
''|*[!0-9]*) ATTEMPT=0 ;;
esac

if [ "$ATTEMPT" -ge "$MAX_ATTEMPTS" ]
then
echo "${ATTEMPT} boot attempt(s) failed, ${MAX_ATTEMPTS} allowed - write 0 to ${BOOT} to restart"
return 0
fi

ACTUAL_DELAY="$(($DELAY*2**${ATTEMPT}))"
echo "Booting second partition in $ACTUAL_DELAY seconds ..."
sleep $ACTUAL_DELAY
echo "$((ATTEMPT+1))" > "$BOOT"
sync
echo "Booting now..."
tryboot "2"
sleep $DELAY
}

while true
do
loop
sleep 5
done