Skip to content

Commit

Permalink
release: new x_kernel base, rebranding, preps for 4.14
Browse files Browse the repository at this point in the history
  • Loading branch information
seppzer0 committed Nov 1, 2023
1 parent d0058a9 commit af5d331
Show file tree
Hide file tree
Showing 30 changed files with 855 additions and 213 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/slim.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
default: "false"
type: choice
options:
- true
- false
- "true"
- "false"

permissions:
contents: write
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/rtl8812au
/AnyKernel3
/KernelSU
/*_kernel_*

# misc local artifacts
/*.log
Expand All @@ -17,3 +18,4 @@
/source
/bundle
/localversion
/multi-slim
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.11-slim-bookworm as base
FROM python:3.12-slim-bookworm as base

# variable store
ARG WDIR="/s0nh_build"
ARG WDIR="/zero_build"
ENV CONAN_UPLOAD_CUSTOM 0

# install basic packages
Expand All @@ -19,7 +19,9 @@ RUN \
make \
zip \
bc \
libgpgme-dev
libgpgme-dev \
bison \
flex

# place sources from host to container
COPY . $WDIR
Expand Down
99 changes: 58 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# s0nh_kernel — an Android kernel w/ Kali NetHunter support
# zero_kernel — an Android kernel w/ Kali NetHunter support

## **Disclaimer**

Expand All @@ -8,24 +8,26 @@

**Anything you do with this kernel you do at your own risk. By using it, you take the responsibility upon yourself and in case of any issue you are not to blame me or other related contributors.**

## **Contents**
## Contents

- [s0nh\_kernel — an Android kernel w/ Kali NetHunter support](#s0nh_kernel--an-android-kernel-w-kali-nethunter-support)
- [zero\_kernel — an Android kernel w/ Kali NetHunter support](#zero_kernel--an-android-kernel-w-kali-nethunter-support)
- [**Disclaimer**](#disclaimer)
- [**Contents**](#contents)
- [**Kernel Features**](#kernel-features)
- [**Supported ROMs and devices**](#supported-roms-and-devices)
- [**ROMs**](#roms)
- [**Devices**](#devices)
- [**Usage**](#usage)
- [**Prerequisites**](#prerequisites)
- [**Kernel**](#kernel)
- [**Assets**](#assets)
- [**Bundle**](#bundle)
- [**Examples**](#examples)
- [**See also**](#see-also)

## **Kernel Features**
- [Contents](#contents)
- [Kernel Features](#kernel-features)
- [Supported ROMs and devices](#supported-roms-and-devices)
- [ROMs](#roms)
- [Devices](#devices)
- [Important Note](#important-note)
- [Usage](#usage)
- [Prerequisites](#prerequisites)
- [Kernel](#kernel)
- [Assets](#assets)
- [Bundle](#bundle)
- [Examples](#examples)
- [Credits](#credits)
- [See also](#see-also)

## Kernel Features

The kernel has the following features:

Expand All @@ -34,21 +36,32 @@ The kernel has the following features:
- packet injection support for internal Wi-Fi chipset;
- KernelSU support.

## **Supported ROMs and devices**
## Supported ROMs and devices

#### **ROMs**
#### ROMs

- LineageOS;
- ParanoidAndroid.
- ParanoidAndroid;
- x_kernel supported (universal)*.

#### **Devices**
\* -- this is mostly relevant to ROMs based on LineageOS; however, technically speaking, this includes ParanoidAndroid as well, which makes x_kernel-based builds universal.

#### Devices

- OnePlus 5;
- OnePlus 5T.

## **Usage**
## Important Note

The contents of each release include ROM builds compatible with corresponding kernel builds. These ROM files are **unmodified and mirrored from official sources**.

This can be verified with the checksums, which should be identical to the ones presented on the ROM project's official web page.

You can always download the same ROM file from official sources if you'd like. The mirroring in this repository is done due to the fact that some ROM projects remove their older builds once they become too outdated.

## Usage

The custom build wrapper consists of 3 main parts:
The custom build wrapper consists of 3 main components:

- kernel builder;
- assets collector;
Expand All @@ -58,7 +71,7 @@ The custom build wrapper consists of 3 main parts:
$ python3 wrapper --help
usage: wrapper [-h] [--clean] {kernel,assets,bundle} ...
A custom wrapper for the s0nh_kernel.
A custom wrapper for the zero_kernel.
positional arguments:
{kernel,assets,bundle}
Expand All @@ -71,7 +84,7 @@ optional arguments:
--clean clean the root directory
```

### **Prerequisites**
### Prerequisites

**It is highly recommended to use `docker` option to run this tool.** For that you need Docker Engine or Docker Desktop, depending on your OS.

Expand All @@ -83,12 +96,12 @@ To run this tool in a `local` environment, you will need:
You will also need a few Python packages. To install them, use:

```sh
python3 -m poetry install
python3 -m poetry install --no-root
```

To install `poetry`, use `python3 -m pip install poetry`.

### **Kernel**
### Kernel

Kernel build process can be launched by using the `python3 wrapper kernel <arguments>` command.

Expand All @@ -98,15 +111,15 @@ For more options you can refer to the help message below.
$ python3 wrapper kernel --help
usage: wrapper kernel [-h] [-c] [--clean-image]
[--log-level {normal,verbose,quiet}] [-o OUTLOG] [--ksu]
{local,docker,podman} {los,pa} codename
{local,docker,podman} {los,pa,x} codename
positional arguments:
{local,docker,podman}
select build environment
{los,pa} select a ROM for the build
{los,pa,x} select a ROM for the build
codename select device codename
optional arguments:
options:
-h, --help show this help message and exit
-c, --clean don't build anything, just clean the environment
--clean-image remove Docker/Podman image from the host machine after
Expand All @@ -118,7 +131,7 @@ optional arguments:
--ksu add KernelSU support
```

### **Assets**
### Assets

As mentioned, there is also an asset downloader, which can collect latest versions of ROM, TWRP, Magisk and it's modules, Kali Chroot etc.

Expand All @@ -127,17 +140,16 @@ $ python3 wrapper assets --help
usage: wrapper assets [-h] [--extra-assets EXTRA_ASSETS] [--rom-only]
[--clean-image] [--clean]
[--log-level {normal,verbose,quiet}] [-o OUTLOG] [--ksu]
{local,docker,podman} {los,pa} codename
{full,minimal}
{local,docker,podman} {los,pa,x} codename {full,minimal}
positional arguments:
{local,docker,podman}
select build environment
{los,pa} select a ROM for the build
{los,pa,x} select a ROM for the build
codename select device codename
{full,minimal} select Kali chroot type
optional arguments:
options:
-h, --help show this help message and exit
--extra-assets EXTRA_ASSETS
select a JSON file with extra assets
Expand All @@ -152,7 +164,7 @@ optional arguments:
--ksu add KernelSU support
```

### **Bundle**
### Bundle

There is an option named `bundle` which combines build artifacts of both `kernel` and `assets` modules into a single package.

Expand All @@ -174,17 +186,17 @@ An option named `slim` is a much lighter version of `full` packaging, as only th
$ python3 wrapper bundle --help
usage: wrapper bundle [-h] [--conan-upload] [--clean-image]
[--log-level {normal,verbose,quiet}] [-o OUTLOG] [--ksu]
{local,docker,podman} {los,pa} codename
{local,docker,podman} {los,pa,x} codename
{conan,slim,full}
positional arguments:
{local,docker,podman}
select build environment
{los,pa} select a ROM for the build
{los,pa,x} select a ROM for the build
codename select device codename
{conan,slim,full} select package type of the bundle
optional arguments:
options:
-h, --help show this help message and exit
--conan-upload upload Conan packages to remote
--clean-image remove Docker/Podman image from the host machine after
Expand All @@ -196,7 +208,7 @@ optional arguments:
--ksu add KernelSU support
```

## **Examples**
## Examples

Here are some examples of commands:

Expand All @@ -207,7 +219,12 @@ Here are some examples of commands:
- Collect all the assets locally:
- `python3 wrapper assets local los dumpling full`.

## **See also**
## Credits

- [x_kernel_oneplus_msm8998](https://github.com/ederekun/x_kernel_oneplus_msm8998): OnePlus 5/T kernel with many optimizations and improvements;
- [kali-nethunter-kernel](https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernel): official kernel patches from Kali NetHunter project.

## See also

- [FAQ](docs/FAQ.md);
- [TODO List](docs/TODO.md);
Expand Down
8 changes: 4 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@


class S0nhConan(ConanFile):
name = "s0nh"
version = "0.3.2"
name = "zero"
version = "0.3.3"
author = "seppzer0"
url = "https://gitlab.com/api/v4/projects/40803264/packages/conan"
description = "An Android kernel w/ Kali NetHunter support."
topics = ("s0nh_kernel", "kali-nethunter")
topics = ("zero_kernel", "kali-nethunter")
settings = None
options = {
"rom": ("los, pa"),
"rom": ("los", "pa", "x"),
"chroot": ("minimal", "full"),
"codename": ("dumpling", "cheeseburger")
}
Expand Down
14 changes: 7 additions & 7 deletions docs/FLASHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Listed below files are required:
- DM-Verity and Force Encrypt disabler;
- Kali NetHunter + Kali NetHunter Terminal apps;
- Kali NetHunter Chroot (you can do this later, but it would be easier to download this beforehand);
- `nhpatch.sh` script from this repo (fixes NetHunter permissions for Android 12+).
- ~~`nhpatch.sh` script from this repo (fixes NetHunter permissions for Android 12+)~~ with recent NetHunter app versions, `nhpatch.sh` usage is no longer required.

Currently, all of the mentioned assets can be collected via the `assets` subcommand in the wrapper (use `full` option).

Expand Down Expand Up @@ -63,9 +63,7 @@ Before doing anything, please ensure that you have:
- install Magisk apk, open it and do what the pop-up says (finish root installation, which will automatically reboot your device; if you don't see the pop-up, close the Magisk app and open it again);
- once booted back into OS, open Magisk app again and proceed with finishing the installation (when prompted with "Additional Setup", select the default `Patch vbmeta in boot image` in `Options` and `Direct install` in `Method` submenus);
- install NetHunter + NetHunter Terminal apps;
- open NetHunter app and grant all the permissions (at some point you will see an error indicating that some permissions are not granted; that's normal, the next step will fix that);
- in NetHunter Terminal app open `AndroidSu` shell, navigate through your storage and launch the `nhpatch.sh`;
- open NetHunter app (permissions should be fixed now);
- open NetHunter app (if seeing a Busybox-related error, press "OK" and re-open the app);
- navigate to the `Kali Chroot Manager` submenu and install the chroot (if you downloaded it beforehand, use the "restore" option);
- in NetHunter Terminal app open `Kali` shell (if it opens properly, then congratulations, you have a working Kali NetHunter on your device).

Expand All @@ -74,8 +72,10 @@ Before doing anything, please ensure that you have:
- install KernelSU Manager app, open it and verify that the `Superuser` tab works properly (should show the `Shell` item);
- install NetHunter and NetHunter Terminal apps, but do not open them yet;
- open KernelSU Manager app, grant SU permissions to both NetHunter and NetHunter Terminal apps via `Superuser` tab;
- in NetHunter Terminal app open `AndroidSu` shell, navigate through your storage and launch the `nhpatch.sh`;
- open the NetHunter app;
- when seeing the Busybox-related error, ignore it and re-open the app;
- open the NetHunter app (if seeing a Busybox-related error, press "OK" and re-open the app);
- navigate to the `Kali Chroot Manager` submenu and install the chroot (if you downloaded it beforehand, use the "restore" option);
- in NetHunter Terminal app open `Kali` shell (if it opens properly, then congratulations, you have a working Kali NetHunter on your device).

#### For x_kernel-based kernel + ParanoidAndroid users

This is a small side-note for using x_kernel-based build with ParanoidAndroid ROM. When booting into OS, you will see a message that `There is an internal problem with this device. Please call manufacturer.`. This warning is essentially similar to the unlocked bootloader message and is completely harmless. Press "OK" and proceed.
4 changes: 3 additions & 1 deletion docs/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@
- [x] decompose `run()` method in `ContainerEngine`;
- [x] skip building Docker/Podman image if it's already present in local cache;
- [x] for containerized build, download the contents of manifests during image build;
- [ ] add system app debloater.
- [ ] add system app debloater;
- [ ] add a new argument respobsible for Linux kernel version selection;
- [ ] add 4.14 Linux kernel version builds.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "s0nh-kernel-builder"
version = "0.3.2"
name = "zero-kernel-builder"
version = "0.3.3"
description = ""
authors = ["seppzer0"]
packages = [{include = "wrapper"}]
Expand Down
46 changes: 29 additions & 17 deletions scripts/multi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,41 @@ def ucopy(src: Path, dst: Path, exceptions: list[str] = []) -> None:
apath = Path(Path(__file__).absolute().parents[1])
# those with "bundle" module usage are primarily tested builds
argsets = (
{
"module": "bundle",
"rom": "los",
"codename": "dumpling",
"ksu": "false",
"size": "slim"
},
{
"module": "bundle",
"rom": "pa",
"codename": "dumpling",
"ksu": "false",
"size": "slim"
},
#{
# "module": "bundle",
# "rom": "los",
# "codename": "dumpling",
# "ksu": "false",
# "size": "slim"
#},
#{
# "module": "bundle",
# "rom": "pa",
# "codename": "dumpling",
# "ksu": "false",
# "size": "slim"
#},
#{
# "module": "kernel",
# "rom": "los",
# "codename": "dumpling",
# "ksu": "true"
#},
#{
# "module": "kernel",
# "rom": "pa",
# "codename": "dumpling",
# "ksu": "true"
#},
{
"module": "kernel",
"rom": "los",
"rom": "x",
"codename": "dumpling",
"ksu": "true"
"ksu": "false"
},
{
"module": "kernel",
"rom": "pa",
"rom": "x",
"codename": "dumpling",
"ksu": "true"
},
Expand Down
Loading

0 comments on commit af5d331

Please sign in to comment.