Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
natsumerinchan committed Apr 24, 2024
0 parents commit 7029dbd
Show file tree
Hide file tree
Showing 8 changed files with 756 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
154 changes: 154 additions & 0 deletions .github/workflows/PixelExperience.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Pixel Experience


on:

workflow_dispatch:
inputs:
RELEASE_CONFIG:
description: 'Upload to Releases'
required: true
default: true
type: boolean
KERNEL_SOURCE:
description: 'Kernel Source'
required: true
default: "https://github.com/PixelExperience-Devices/kernel_oneplus_martini.git"
type: string
KERNEL_SOURCE_BRANCH:
description: 'kernel Branch'
required: true
default: "thirteen"
type: string
KERNEL_DEFCONFIG:
description: 'Kernel Config'
required: true
default: "vendor/lahaina-qgki_defconfig"
type: string
KERNELSU_CONFIG:
description: 'Compile KernelSU'
required: true
default: true
type: boolean
CCACHE_CONFIG:
description: 'Use Ccache'
required: true
default: true
type: boolean
KERNELSU_TAG:
description: 'Choose KernelSU branch or tag'
required: false
default: "main"
type: string

jobs:

build:

runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"


steps:

- uses: actions/checkout@v3

- name: Ccache
if: github.event.inputs.CCACHE_CONFIG == 'true'
uses: hendrikmuhs/[email protected]
with:
key: Pixel-Experience

- name: Setup Environment
run: |
export CLANG_PATH=~/proton-clang
git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH
sh -c "$(curl -sSL https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh)"
sudo apt install --fix-missing
export LLVM_VERSION=13
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $LLVM_VERSION
rm ./llvm.sh
sudo apt install --fix-missing
sudo ln -s --force /usr/bin/clang-$LLVM_VERSION /usr/bin/clang
sudo ln -s --force /usr/bin/ld.lld-$LLVM_VERSION /usr/bin/ld.lld
sudo ln -s --force /usr/bin/llvm-objdump-$LLVM_VERSION /usr/bin/llvm-objdump
sudo ln -s --force /usr/bin/llvm-ar-$LLVM_VERSION /usr/bin/llvm-ar
sudo ln -s --force /usr/bin/llvm-nm-$LLVM_VERSION /usr/bin/llvm-nm
sudo ln -s --force /usr/bin/llvm-strip-$LLVM_VERSION /usr/bin/llvm-strip
sudo ln -s --force /usr/bin/llvm-objcopy-$LLVM_VERSION /usr/bin/llvm-objcopy
sudo ln -s --force /usr/bin/llvm-readelf-$LLVM_VERSION /usr/bin/llvm-readelf
sudo ln -s --force /usr/bin/clang++-$LLVM_VERSION /usr/bin/clang++
- name: Git kernel
run: |
git clone "${{ github.event.inputs.KERNEL_SOURCE }}" -b "${{ github.event.inputs.KERNEL_SOURCE_BRANCH }}" kernel
echo "TAG_NAME=$(date -u +%d%m%Y%I%M)" >> $GITHUB_ENV
- name: Setup KernelSU
if: github.event.inputs.KERNELSU_CONFIG == 'true'
run: |
cd $GITHUB_WORKSPACE/kernel
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s "${{ github.event.inputs.KERNELSU_TAG }}"
scripts/config --file "arch/$ARCH/configs/$KERNEL_DEFCONFIG" -e MODULES -e KPROBES -e HAVE_KPROBES -e KPROBE_EVENTS
- name: Make kernel
run: |
cd $GITHUB_WORKSPACE/kernel
export KERNEL_DEFCONFIG=${{ github.event.inputs.KERNEL_DEFCONFIG }}
echo "===================Setup Export========================="
export KERNEL_PATH=$PWD
export CLANG_PATH=~/proton-clang
export PATH=${CLANG_PATH}/bin:${PATH}
export CLANG_TRIPLE=aarch64-linux-gnu-
export ARCH=arm64
export SUBARCH=arm64
echo "===================Setup Environment Again==================="
test -e "$CLANG_PATH/README.md" || git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH
sudo apt install --fix-missing
echo "=========================Make=========================="
make O=out CC="ccache clang" CXX="ccache clang++" ARCH=arm64 CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld $KERNEL_DEFCONFIG
sed -i 's/CONFIG_LTO=y/CONFIG_LTO=n/' out/.config
sed -i 's/CONFIG_LTO_CLANG=y/CONFIG_LTO_CLANG=n/' out/.config
sed -i 's/CONFIG_THINLTO=y/CONFIG_THINLTO=n/' out/.config
echo "CONFIG_LTO_NONE=y" >> out/.config
make O=out CC="ccache clang" CXX="ccache clang++" ARCH=arm64 -j`nproc` CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld 2>&1 | tee kernel.log
- name: Create Anykernel3 file
run: |
cd $GITHUB_WORKSPACE/kernel
export KERNEL_PATH=$PWD
git clone https://gitlab.com/inferno0230/AnyKernel3 --depth=1 $KERNEL_PATH/AnyKernel3
if test -e $KERNEL_PATH/out/arch/arm64/boot/Image && test -d $KERNEL_PATH/AnyKernel3; then
zip_name="ONEPLUS9RT-v5.4.$(grep "^SUBLEVEL =" Makefile | awk '{print $3}')-$(date +"%Y%m%d").zip"
cd $KERNEL_PATH/AnyKernel3
cp $KERNEL_PATH/out/arch/arm64/boot/Image $KERNEL_PATH/AnyKernel3
zip -r ${zip_name} *
mv ${zip_name} $KERNEL_PATH/out/arch/arm64/boot
cd $KERNEL_PATH
fi
- name: Upload Artifact
if: github.event.inputs.RELEASE_CONFIG == 'false'
uses: actions/upload-artifact@v3
with:
name: PE-Inline-martini-${{ env.TAG_NAME }}
path: |
kernel/AnyKernel3/PE-Inline-martini-${{ env.TAG_NAME }}.zip
- name: Upload to Release
if: github.event.inputs.RELEASE_CONFIG == 'true'
uses: ncipollo/release-action@v1
with:
artifacts: "kernel/AnyKernel3/PE-Inline-martini-${{ env.TAG_NAME }}.zip"
tag: "PE-Inline-martini-${{ env.TAG_NAME }}"
name: "PE-Inline-martini-${{ env.TAG_NAME }}"
allowUpdates: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
154 changes: 154 additions & 0 deletions .github/workflows/PixelOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Pixel OS


on:

workflow_dispatch:
inputs:
RELEASE_CONFIG:
description: 'Upload to Releases'
required: true
default: true
type: boolean
KERNEL_SOURCE:
description: 'Kernel Source'
required: true
default: "https://github.com/PixelOS-Devices/kernel_oneplus_sm8350.git"
type: string
KERNEL_SOURCE_BRANCH:
description: 'kernel Branch'
required: true
default: "fourteen"
type: string
KERNEL_DEFCONFIG:
description: 'Kernel Config'
required: true
default: "vendor/lahaina-qgki_defconfig"
type: string
KERNELSU_CONFIG:
description: 'Compile KernelSU'
required: true
default: true
type: boolean
CCACHE_CONFIG:
description: 'Use Ccache'
required: true
default: true
type: boolean
KERNELSU_TAG:
description: 'Choose KernelSU branch or tag'
required: false
default: main
type: string

jobs:

build:

runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"

steps:

- uses: actions/checkout@v3

- name: Ccache
if: github.event.inputs.CCACHE_CONFIG == 'true'
uses: hendrikmuhs/[email protected]
with:
key: PixelOS-inline

- name: Setup Environment
run: |
export CLANG_PATH=~/proton-clang
git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH
sh -c "$(curl -sSL https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh)"
sudo apt install --fix-missing
export LLVM_VERSION=13
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $LLVM_VERSION
rm ./llvm.sh
sudo apt install --fix-missing
sudo ln -s --force /usr/bin/clang-$LLVM_VERSION /usr/bin/clang
sudo ln -s --force /usr/bin/ld.lld-$LLVM_VERSION /usr/bin/ld.lld
sudo ln -s --force /usr/bin/llvm-objdump-$LLVM_VERSION /usr/bin/llvm-objdump
sudo ln -s --force /usr/bin/llvm-ar-$LLVM_VERSION /usr/bin/llvm-ar
sudo ln -s --force /usr/bin/llvm-nm-$LLVM_VERSION /usr/bin/llvm-nm
sudo ln -s --force /usr/bin/llvm-strip-$LLVM_VERSION /usr/bin/llvm-strip
sudo ln -s --force /usr/bin/llvm-objcopy-$LLVM_VERSION /usr/bin/llvm-objcopy
sudo ln -s --force /usr/bin/llvm-readelf-$LLVM_VERSION /usr/bin/llvm-readelf
sudo ln -s --force /usr/bin/clang++-$LLVM_VERSION /usr/bin/clang++
- name: Git kernel
run: |
git clone "${{ github.event.inputs.KERNEL_SOURCE }}" -b "${{ github.event.inputs.KERNEL_SOURCE_BRANCH }}" kernel
echo "TAG_NAME=$(date -u +%d%m%Y%I%M)" >> $GITHUB_ENV
- name: Setup KernelSU
if: github.event.inputs.KERNELSU_CONFIG == 'true'
run: |
cd $GITHUB_WORKSPACE/kernel
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s "${{ github.event.inputs.KERNELSU_TAG }}"
scripts/config --file "arch/$ARCH/configs/$KERNEL_DEFCONFIG" -e MODULES -e KPROBES -e HAVE_KPROBES -e KPROBE_EVENTS
- name: Make kernel
run: |
cd $GITHUB_WORKSPACE/kernel
export KERNEL_DEFCONFIG=${{ github.event.inputs.KERNEL_DEFCONFIG }}
echo "===================Setup Export========================="
export KERNEL_PATH=$PWD
export CLANG_PATH=~/proton-clang
export PATH=${CLANG_PATH}/bin:${PATH}
export CLANG_TRIPLE=aarch64-linux-gnu-
export ARCH=arm64
export SUBARCH=arm64
echo "===================Setup Environment Again==================="
test -e "$CLANG_PATH/README.md" || git clone --depth=1 https://github.com/kdrag0n/proton-clang $CLANG_PATH
sudo apt install --fix-missing
echo "=========================Make=========================="
make O=out CC="ccache clang" CXX="ccache clang++" ARCH=arm64 CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld $KERNEL_DEFCONFIG
sed -i 's/CONFIG_LTO=y/CONFIG_LTO=n/' out/.config
sed -i 's/CONFIG_LTO_CLANG=y/CONFIG_LTO_CLANG=n/' out/.config
sed -i 's/CONFIG_THINLTO=y/CONFIG_THINLTO=n/' out/.config
echo "CONFIG_LTO_NONE=y" >> out/.config
make O=out CC="ccache clang" CXX="ccache clang++" ARCH=arm64 -j`nproc` CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld 2>&1 | tee kernel.log
- name: Create Anykernel3 file
run: |
cd $GITHUB_WORKSPACE/kernel
export KERNEL_PATH=$PWD
git clone https://gitlab.com/inferno0230/AnyKernel3 --depth=1 $KERNEL_PATH/AnyKernel3
if test -e $KERNEL_PATH/out/arch/arm64/boot/Image && test -d $KERNEL_PATH/AnyKernel3; then
zip_name="ONEPLUS9RT-v5.4.$(grep "^SUBLEVEL =" Makefile | awk '{print $3}')-$(date +"%Y%m%d").zip"
cd $KERNEL_PATH/AnyKernel3
cp $KERNEL_PATH/out/arch/arm64/boot/Image $KERNEL_PATH/AnyKernel3
zip -r ${zip_name} *
mv ${zip_name} $KERNEL_PATH/out/arch/arm64/boot
cd $KERNEL_PATH
fi
- name: Upload Artifact
if: github.event.inputs.RELEASE_CONFIG == 'false'
uses: actions/upload-artifact@v3
with:
name: PixelOS-Inline-martini-${{ env.TAG_NAME }}
path: |
kernel/AnyKernel3/PixelOS-Inline-martini-${{ env.TAG_NAME }}.zip
kernel/repacker/vendor_dlkm.img
- name: Upload to Release
if: github.event.inputs.RELEASE_CONFIG == 'true'
uses: ncipollo/release-action@v1
with:
artifacts: "kernel/AnyKernel3/PixelOS-Inline-martini-${{ env.TAG_NAME }}.zip,kernel/repacker/vendor_dlkm.img"
tag: "PixelOS-Inline-martini-${{ env.TAG_NAME }}"
name: "PixelOS-Inline-martini-${{ env.TAG_NAME }}"
allowUpdates: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>
Loading

0 comments on commit 7029dbd

Please sign in to comment.