[Samsung Galaxy A20 Guides, News, & Discussion] physwizz:
Building a First Kernel for the Galaxy A20

by physwizz

At last, I've been able to build a very basic kernel.

This is a first attempt.

It's not overclocked so don't expect anything miraculous.

Thanks to @Chatur27for building help and @Topser99 for the flashable zip

THIS IS WHAT I DID

Requirements

Use Linux 64bit ( I used Linux Mint Mate in a Virtual Box)

Linux setup

$ sudo apt update

$ sudo apt upgrade

$ sudo apt-get install git-all

$ git config --global user.name "physwizz"

$ git config --global user.email "myemail@gmail.com"

Kernel setup

1. Download the compiler

GitHub - physwizz/compiler

Contribute to physwizz/compiler development by creating an account on GitHub.

github.com

Unzip into "Compiler" folder

2. Download the Source Code (https://opensource.samsung.com/main)

Search for A205 and select QQ version (Latin)

Extract the kernel.tar.7z

extract into "Kernel" folder

Beginners guide to github

I have always had a lot of difficulty with github.

I have jotted down a few things which might help some new kernel builders.

A. Github Setup

1. Go to github and Open a new Repo

I called mine "physwizz_kernel"

2. To set up SSH key

$ git config --global user.email "you@example.com"

$ git config --global user.name "Your Github Name"

$ ssh-keygen -t rsa -b 4096 -C "you@example.com"

Press enter 3 times

$ eval "$(ssh-agent -s)"

$ ssh-add ~/.ssh/id_rsa

$ sudo apt-get install xclip

$ xclip -sel clip < ~/.ssh/id_rsa.pub

3. The SSH key will be in clipboard

Go to github settings => SSH and GPG keys

Paste key here

B. Using github

1. Open Terminal In The Kernel Folder

$ git init

$ git remote add origin (github id) mine is git@github.com: physwizz/physwizz_kernel.git

$ touch README

$ git add README

$ git add --all

$ git commit -m "Initial commit"

$ git push -u origin main

2. To cherry pick a commit from another github repository

firstly add the other repository to your kernel

$ git remote add other https:<other address>

$ git fetch --all

$ git cherry-pick [hash_id]

3. to push changes to github

$ make clean && make mrproper

$ git add --all

if the change is your own

$ sudo git commit -a

write comment

ctrl o (to output)

enter

ctrl x (to exit)

then

$ git push origin main

if the change is a cherry pick

$ git commit "change made" --author="Author's name<author's email>"

then

$ git push origin main

4. If it doesn't work or if you want to try something else

$ git revert <commit hash code>

$ git push origin main

Or

$ git reset --hard < last clean commit hash >

$ git push origin main -f

$ git cherry pick <clean commits >

$ git push origin main

5. to edit last commit

$ git commit --amend -e

$ git push origin main

Please give any feedback.

@physwizz

Kernel Building

1. open the defconfig file with text editor

Mine was located at

/home/physwizz/Kernel/arch/arm64/configs/exynos7885-a20_defconfig

You can make a copy of this file and call it original_defconfig

CHANGES I MADE

physwizz_kernel_V1

CONFIG_LOCALVERSION="physwizz"

# CONFIG_CC_STACKPROTECTOR_STRONG is not set

Later versions in post #2

2. open terminal

cd Kernel

make clean && make mrproper

export CROSS_COMPILE=/home/physwizz/compiler/bin/aarch64-linux-android-

export ARCH=arm64

export ANDROID_MAJOR_VERSION=q

make exynos7885-a20_defconfig

make

3. Output is found in /home/physwizz/Kernel/arch/arm64/boot

4. Copy Image from boot folder and Insert it into the MyKernel.zip

5. Extract Version and edit it then reinsert

To use Anykernel to make your own zip

Extract MyKernel.7z to a folder, copy kernel image there, open terminal in that folder and type:

zip -r9 UPDATE-AnyKernel3.zip * -x .git README.md *placeholder

TheUPDATE-AnyKernel3.zip will be in the folder.

Cut and paste it outside the folder then flash it from TWRP.

Make sure you don't leave the UPDATE-AnyKernel3.zip in the MyKernel folder because it will interfere with the next zip you make.

Need to flash Magisk 20.4 or Magisk 21

Works with stock dtbo or Eureka dbto

If you flash Eureka dbto you will get overclocking of the GPU.

Overclocking

Version 1.4 is when I started overclocking

See post 2

Compiler (you can clone this)

https://github.com/physwizz/compiler

Source

https://github.com/physwizz/physwizz_kernel

NEWER VERSIONS IN POST#2

https://xdaforums.com/t/physwizz-collection.4253081/