Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SuzukiHonoka committed Jun 18, 2024
1 parent b0154c6 commit b43bfba
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 74 deletions.
156 changes: 82 additions & 74 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,87 +6,95 @@ on:
branches:
- master
paths:
- '.config'
- '.github/workflows/main.yml'
- 'patch/**'
- ".config"
- ".github/workflows/main.yml"
- "patch/**"
watch:
types: [started]
env:
BUILD_DIR: /tmp/ramfs
KURL: https://github.com/SuzukiHonoka/PHICOMM_N1_SHELL_API/raw/master/setup_new_kernel.sh
INSTALL_TOOLCHAIN: https://github.com/SuzukiHonoka/PHICOMM_N1_SHELL_API/raw/master/setup_aarch64_toolchain.sh
BUILD_DIR: /tmp/ramfs
KVER: 5.15.104
ARCH: arm64
CROSS_COMPILE: /opt/toolchain/aarch64/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
CROSS_COMPILE: /opt/toolchain/aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
LOCALVERSION: -aml-s905d-starx-action
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Checkout
uses: actions/[email protected]
- name: Host info
run: |
pwd
lscpu
free -h
df -h
- name: Installing requirements
run: |
sudo apt-get update
sudo apt-get install -y git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison libncurses-dev autoconf dkms libudev-dev libpci-dev libiberty-dev u-boot-tools lzop
- name: Download scripts
run: |
wget $INSTALL_TOOLCHAIN
wget $KURL
- name: Clone Repos
run: bash setup_new_kernel.sh $KVER
- name: Installing cross compile toolchain
run: bash setup_aarch64_toolchain.sh
- name: Apply patchs and Build Kernel
run: |
cd /tmp/ramfs/build/linux-$KVER
for p in `ls $GITHUB_WORKSPACE/patch`; do patch --ignore-whitespace -t -p1 -N < $GITHUB_WORKSPACE/patch/$p; done
cp $GITHUB_WORKSPACE/.config .config
make -j$(nproc) oldconfig
make -j$(nproc) bindeb-pkg
- name: Extract Binaries
run: |
cd /tmp/ramfs/build/linux-$KVER
cp arch/arm64/boot/Image $GITHUB_WORKSPACE
cp arch/arm64/boot/dts/amlogic/*.dtb $GITHUB_WORKSPACE
rsync -a ../*$KVER* --exclude=linux-$KVER $GITHUB_WORKSPACE
- uses: actions/upload-artifact@v2
with:
name: Kernel ${{ env.KVER }}
path: |
install_kernel.sh
Image
*${{ env.KVER }}*
.config
*.dtb
- name: ZIP FILES
run: |
cd $GITHUB_WORKSPACE
zip data.zip install_kernel.sh Image *${{ env.KVER }}* .config *.dtb
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.KVER }}
release_name: Linux Kernel ${{ env.KVER }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./data.zip
asset_name: Kernel ${{ env.KVER }}.zip
asset_content_type: application/zip
- name: Checkout
uses: actions/[email protected]

- name: Host info
run: |
pwd
lscpu
free -h
df -h
- name: Install requirements
run: |
sudo apt-get update
sudo apt-get install -y git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison libncurses-dev autoconf dkms libudev-dev libpci-dev libiberty-dev u-boot-tools lzop
- name: Clone Repos
run: bash setup_new_kernel.sh $KVER

- name: Install cross compile toolchain
run: bash setup_aarch64_toolchain.sh

- name: Apply patchs
run: |
cd /tmp/ramfs/build/linux-$KVER
for p in `ls patch`; do patch --ignore-whitespace -t -p1 -N < patch/$p; done
- name: Build Kernel
run: |
cd /tmp/ramfs/build/linux-$KVER
cp $GITHUB_WORKSPACE/.config .config
make -j$(nproc) oldconfig
make -j$(nproc) bindeb-pkg
- name: Extract Binaries
run: |
cd /tmp/ramfs/build/linux-$KVER
cp arch/arm64/boot/Image $GITHUB_WORKSPACE
cp arch/arm64/boot/dts/amlogic/*.dtb $GITHUB_WORKSPACE
rsync -a ../*$KVER* --exclude=linux-$KVER $GITHUB_WORKSPACE
- uses: actions/[email protected]
with:
name: Kernel ${{ env.KVER }}
path: |
install_kernel.sh
Image
*${{ env.KVER }}*
.config
*.dtb
- name: ZIP FILES
run: |
cd $GITHUB_WORKSPACE
zip data.zip install_kernel.sh Image *${{ env.KVER }}* .config *.dtb
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.KVER }}
release_name: Linux Kernel ${{ env.KVER }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./data.zip
asset_name: Kernel ${{ env.KVER }}.zip
asset_content_type: application/zip
13 changes: 13 additions & 0 deletions setup_aarch64_toolchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
echo "Starting aarch64 toolchain setup"
stage_dir="/opt/toolchain"
tool_verision="arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu"
tool_file="$tool_verision.tar.xz"
tool_url="https://github.com/SuzukiHonoka/s905d-kernel-precompiled/releases/download/toolchain/$tool_file"
echo "toolchain ${tool_verision} will be installed to ${stage_dir}"
mkdir -p $stage_dir && cd $stage_dir
wget $tool_url
echo "Decompressing"
tar -xf $tool_file -C $stage_dir "$tool_verision/aarch64-none-linux-gnu" && rm *xz
export PATH=$PATH:"$stage_dir/aarch64-none-linux-gnu/bin"
echo "Done"
23 changes: 23 additions & 0 deletions setup_new_kernel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
ROOT_DIR="/tmp/ramfs"
BUILD_DIR="$ROOT_DIR/build"
KVERV="5.9.1"

if [ ! -z "$1" ]; then
KVERV=$1
fi

KVER="linux-$KVERV"
KURL="https://cdn.kernel.org/pub/linux/kernel/v${KVERV:0:1}.x"
KDURL="$KURL/$KVER.tar.xz"

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

sudo mount -t tmpfs -o size=6G tmpfs $ROOT_DIR
mkdir $BUILD_DIR && cd $BUILD_DIR

wget $KDURL
tar -xf "$KVER.tar.xz" && rm *xz
cd "$BUILD_DIR/$KVER"

0 comments on commit b43bfba

Please sign in to comment.