Skip to content

Commit

Permalink
build_kernel: Alignment with previous commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaz15k committed Jul 11, 2024
1 parent 4ff2bdc commit 544382d
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 130 deletions.
108 changes: 0 additions & 108 deletions .github/workflows/build_kernel.yml

This file was deleted.

117 changes: 117 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Build release

on:
workflow_dispatch:

jobs:
build_squeak:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
target: [A546E, A546B]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: rokibhasansagar/slimhub_actions@main

- name: Set up build environment
run: |
sudo apt update && sudo apt upgrade
sudo apt autoremove -y
sudo apt install -yq tar \
attr libelf-dev dwarves rsync libbrotli-dev \
libgtest-dev libprotobuf-dev libunwind-dev libusb-1.0-0-dev libzstd-dev libc6-dev \
linux-modules-extra-$(uname -r) build-essential p7zip-full libarchive-tools
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Fetch ToolChain
run: |
mkdir -p ~/Prebuilts
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 ~/Prebuilts/gl-clang
rm -rf ~/Prebuilts/gl-clang/clang-3* ~/Prebuilts/gl-clang/clang-r4* ~/Prebuilts/gl-clang/clang-r51* ~/Prebuilts/gl-clang/.git
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gas/linux-x86 ~/Prebuilts/gas/linux-x86
rm -rf ~/Prebuilts/gas/linux-x86/.git
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/build-tools ~/Prebuilts/build-tools
rm -rf ~/Prebuilts/build-tools/.git
- name: Fetch AnyKernel3
run: |
git clone --branch a54x https://github.com/Vaz15k/AnyKernel3.git ~/AnyKernel3
mkdir -p ~/files
- name: Set date variable
id: date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Fetch Magiskboot and KSUD tools
run: |
mkdir -p ~/bin
curl -o ~/bin/magiskboot https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Tools/magiskboot
chmod a+x ~/bin/magiskboot
sudo ln -sf ~/bin/magiskboot /usr/bin/magiskboot
curl -o ~/bin/ksud https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Tools/ksud
chmod a+x ~/bin/ksud
sudo ln -sf ~/bin/ksud /usr/bin/ksud
- name: Download Images
run: |
mkdir -p ~/mkboot
if [[ "${{ matrix.target }}" == "A546B" ]]; then
wget -t 3 --timeout=30 https://vaz15k.github.io/literate-potato/Imagens/A546B/boot.img -O ~/mkboot/boot_A546B.img || curl -o ~/mkboot/boot_A546B.img https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Imagens/A546B/boot.img
wget -t 3 --timeout=30 https://vaz15k.github.io/literate-potato/Imagens/A546B/init_boot.img -O ~/mkboot/init_boot_A546B.img || curl -o ~/mkboot/init_boot_A546B.img https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Imagens/A546B/init_boot.img
elif [[ "${{ matrix.target }}" == "A546E" ]]; then
wget -t 3 --timeout=30 https://vaz15k.github.io/literate-potato/Imagens/A546E/boot.img -O ~/mkboot/boot_A546E.img || curl -o ~/mkboot/boot_A546E.img https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Imagens/A546E/boot.img
wget -t 3 --timeout=30 https://vaz15k.github.io/literate-potato/Imagens/A546E/init_boot.img -O ~/mkboot/init_boot_A546E.img || curl -o ~/mkboot/init_boot_A546E.img https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Imagens/A546E/init_boot.img
fi
- name: Build Kernel Clean
run: |
./build_kernel.sh ${{ matrix.target }}
cp ~/AnyKernel3/Squeak* ~/files
- name: Create LKM Kernel
run: |
cp ~/AnyKernel3/Image ~/mkboot/kernel
cd ~/mkboot
echo "Repacking boot image..."
magiskboot repack boot_${{ matrix.target }}.img boot.img
ksud boot-patch -b init_boot_${{ matrix.target }}.img --kmi android13-5.15 --magiskboot ~/bin/magiskboot
mv kernelsu* init_boot.img
echo "Checking existence of images..."
if [[ -f "boot.img" && -f "init_boot.img" ]]; then
echo "Creating tar archive..."
tar -cvf Squeak_KSU-LKM_${{ matrix.target }}_${{ env.DATE }}.tar boot.img init_boot.img
else
echo "Error: One or both images not found!"
exit 1
fi
mv Squeak* ~/files
echo "Completed successfully."
- name: Build Kernel With KSU
run: |
rm -rf ~/mkboot
./build_kernel.sh ${{ matrix.target }} --ksu
cp ~/AnyKernel3/Squeak* ~/files
- name: Publish to GitHub
id: release
uses: softprops/action-gh-release@v2
with:
files: /home/runner/files/Squeak*
name: Squeak Kernel - ${{ env.DATE }}
tag_name: "${{ env.DATE }}"
body: |
- **Kernel Version:** 5.15.123
- **Clang Version:** Clang-r522817
:rocket: *Built with love by GitHub Actions.*
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
25 changes: 14 additions & 11 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,34 @@ jobs:

- name: Set up build environment
run: |
sudo apt update
DEBIAN_FRONTEND=noninteractive sudo apt install -yq \
attr golang libelf-dev dwarves rsync libbrotli-dev \
sudo apt update && sudo apt upgrade
sudo apt autoremove -y
sudo apt install -yq tar \
attr libelf-dev dwarves rsync libbrotli-dev \
libgtest-dev libprotobuf-dev libunwind-dev libusb-1.0-0-dev libzstd-dev libc6-dev \
linux-modules-extra-$(uname -r) build-essential p7zip-full libarchive-tools
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Fetch ToolChain
run: |
mkdir ~/Prebuilts
mkdir -p ~/Prebuilts
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 ~/Prebuilts/gl-clang
rm -fr ~/Prebuilts/gl-clang/clang-3* ~/Prebuilts/gl-clang/clang-r4* ~/Prebuilts/gl-clang/clang-r51* ~/Prebuilts/gl-clang/.git*
git clone https://android.googlesource.com/platform/prebuilts/gas/linux-x86 ~/Prebuilts/gas/linux-x86
rm -rf ~/Prebuilts/gl-clang/clang-3* ~/Prebuilts/gl-clang/clang-r4* ~/Prebuilts/gl-clang/clang-r51* ~/Prebuilts/gl-clang/.git
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gas/linux-x86 ~/Prebuilts/gas/linux-x86
rm -rf ~/Prebuilts/gas/linux-x86/.git
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/build-tools ~/Prebuilts/build-tools
rm -rf ~/Prebuilts/build-tools/.git
- name: Fetch AnyKernel3
run: |
git clone --branch a54x https://github.com/Vaz15k/AnyKernel3.git ~/AnyKernel3
mkdir ~/files
mkdir -p ~/files
- name: Build Kernel Clean
run: |
source ./build_kernel.sh ${{ matrix.target }}
./build_kernel.sh ${{ matrix.target }}
cp ~/AnyKernel3/Squeak* ~/files
- name: Upload Test Build ${{ matrix.target }}
Expand Down
15 changes: 4 additions & 11 deletions build_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ PARENT_DIR=`readlink -f ${DIR}/..`

AK3_DIR="$HOME/AnyKernel3"
TC_DIR="$HOME/Prebuilts"
OUT_DIR="$DIR/out"

ARGS="$*"
DEVICE_MODEL="$1"

JOBS=$(nproc --all)
MAKE_PARAMS="-j$JOBS -C $DIR ARCH=arm64 CC=clang LLVM=1 LLVM_IAS=1 CLANG_TRIPLE=llvm- CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi-"
MAKE_PARAMS="-j$JOBS -C $DIR CC=clang LLVM=1 LLVM_IAS=1 CLANG_TRIPLE=llvm- CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi-"

devicecheck() {
if [ "$DEVICE_MODEL" == "A546E" ]; then
Expand Down Expand Up @@ -46,6 +47,7 @@ ksu() {
# Check the value of KSU
if [ "$KSU" == "true" ]; then
ZIP_NAME="Squeak_KSU_"$DEVICE_NAME"_"$(date +'%Y-%m-%d')""
rm -fr $OUT_DIR
if [ -d "KernelSU" ]; then
echo "KernelSU exists"
else
Expand Down Expand Up @@ -77,23 +79,14 @@ anykernel3() {
}

makezipfile() {
cp arch/arm64/boot/Image $AK3_DIR
cp $OUT_DIR/arch/arm64/boot/Image $AK3_DIR
cd $AK3_DIR
zip -r9 $ZIP_NAME . -x '*.git*' '*patch*' '*ramdisk*' 'README.md' '*modules*'
cd $DIR
}

if [ -d include/config ]; then
echo "Find config,will remove it"
rm -rf include/config
else
echo "No Config,good."
fi

export PLATFORM_VERSION=14
export ANDROID_MAJOR_VERSION=u
export DEPMOD=depmod
export TARGET_SOC=s5e8835

echo "Starting Building ..."
devicecheck
Expand Down

0 comments on commit 544382d

Please sign in to comment.