Files
linux-t2-patches/.github/workflows/bce.yml
T
2026-04-14 00:26:00 +05:30

180 lines
7.6 KiB
YAML

---
name: apple-bce update
on:
workflow_dispatch:
inputs:
commit_message:
description: 'Commit message'
required: false
fork:
description: 'Link to any fork if needed'
required: false
jobs:
Publish-Mainline:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repo'
uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Get the latest driver
id: publish
run: |
source ${{ github.workspace }}/version
echo "kver=${KVER}" >> $GITHUB_ENV
FORK="${{ github.event.inputs.fork }}"
if [ -z "$FORK" ]; then
FORK='https://github.com/t2linux/apple-bce-drv.git'
fi
git clone --depth 1 --single-branch --branch "v${KVER}" https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
git clone --depth 1 $FORK ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce
rm -rf ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce/.git
rm ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce/.gitignore
rm ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce/README.md
cd ${{ github.workspace }}/linux-stable/
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Add apple-bce driver"
git format-patch -1 HEAD
mv ./0001-Add-apple-bce-driver.patch ../1001-Add-apple-bce-driver.patch
cd ${{ github.workspace }}/linux-stable/drivers/staging
sed -i '$i source "drivers/staging/apple-bce/Kconfig"' Kconfig
sed -i '$i\\' Kconfig
echo 'obj-$(CONFIG_APPLE_BCE) += apple-bce/' >> Makefile
cd apple-bce
cat <<EOF >Kconfig
config APPLE_BCE
tristate "Apple BCE driver (VHCI and Audio support)"
default m
depends on X86
select SOUND
select SND
select SND_PCM
select SND_JACK
help
VHCI and audio support on Apple MacBooks with the T2 Chip.
This driver is divided in three components:
- BCE (Buffer Copy Engine): which establishes a basic communication
channel with the T2 chip. This component is required by the other two:
- VHCI (Virtual Host Controller Interface): Access to keyboard, mouse
and other system devices depend on this virtual USB host controller
- Audio: a driver for the T2 audio interface.
If "M" is selected, the module will be called apple-bce.
EOF
sed -i 's/obj-m += $(modname).o/obj-$(CONFIG_APPLE_BCE) += $(modname).o/g' Makefile
cd ${{ github.workspace }}/linux-stable/
git add .
git commit -m "Put apple-bce in drivers/staging"
git format-patch -1 HEAD
mv ./0001-Put-apple-bce-in-drivers-staging.patch ../1002-Put-apple-bce-in-drivers-staging.patch
- name: Cleanup and update the repo
run: |
cd ${{ github.workspace }}
rm -r linux-stable
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
MSG="${{ github.event.inputs.commit_message }}"
if [ -z "$MSG" ]; then
MSG="Update apple-bce for kernel v${{ env.kver }}"
fi
git commit -m "${MSG}"
- name: Push changes to the repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
Publish-LTS:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repo'
uses: actions/checkout@v6
with:
ref: 6.12
persist-credentials: false
fetch-depth: 0
- name: Get the latest driver
id: publish
run: |
source ${{ github.workspace }}/version
echo "kver=${KVER}" >> $GITHUB_ENV
FORK="${{ github.event.inputs.fork }}"
if [ -z "$FORK" ]; then
FORK='https://github.com/t2linux/apple-bce-drv.git'
fi
git clone --depth 1 --single-branch --branch "v${KVER}" https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
git clone --depth 1 $FORK ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce
rm -rf ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce/.git
rm ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce/.gitignore
rm ${{ github.workspace }}/linux-stable/drivers/staging/apple-bce/README.md
cd ${{ github.workspace }}/linux-stable/
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Add apple-bce driver"
git format-patch -1 HEAD
mv ./0001-Add-apple-bce-driver.patch ../1001-Add-apple-bce-driver.patch
cd ${{ github.workspace }}/linux-stable/drivers/staging
sed -i '$i source "drivers/staging/apple-bce/Kconfig"' Kconfig
sed -i '$i\\' Kconfig
echo 'obj-$(CONFIG_APPLE_BCE) += apple-bce/' >> Makefile
cd apple-bce
cat <<EOF >Kconfig
config APPLE_BCE
tristate "Apple BCE driver (VHCI and Audio support)"
default m
depends on X86
select SOUND
select SND
select SND_PCM
select SND_JACK
help
VHCI and audio support on Apple MacBooks with the T2 Chip.
This driver is divided in three components:
- BCE (Buffer Copy Engine): which establishes a basic communication
channel with the T2 chip. This component is required by the other two:
- VHCI (Virtual Host Controller Interface): Access to keyboard, mouse
and other system devices depend on this virtual USB host controller
- Audio: a driver for the T2 audio interface.
If "M" is selected, the module will be called apple-bce.
EOF
sed -i 's/obj-m += $(modname).o/obj-$(CONFIG_APPLE_BCE) += $(modname).o/g' Makefile
cd ${{ github.workspace }}/linux-stable/
git add .
git commit -m "Put apple-bce in drivers/staging"
git format-patch -1 HEAD
mv ./0001-Put-apple-bce-in-drivers-staging.patch ../1002-Put-apple-bce-in-drivers-staging.patch
- name: Cleanup and update the repo
run: |
cd ${{ github.workspace }}
rm -r linux-stable
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
MSG="${{ github.event.inputs.commit_message }}"
if [ -z "$MSG" ]; then
MSG="Update apple-bce for kernel v${{ env.kver }}"
fi
git commit -m "${MSG}"
- name: Push changes to the repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 6.12