浏览代码

docs: split installation into kernelflasher and magiskboot guides

- Create docs/kernelflasher.md: Install with Kernel Flasher steps,
  prerequisites, KMI/SPL guidance, supported apps
- Create docs/magiskboot.md: Patch boot.img manually via magiskboot
  (Pixel lz4_legacy, prepare, Android vs PC magiskboot steps)
- Rewrite docs/installation.md as overview hub linking to both
  methods with KMI/SPL summary
- Update docs/index.md and README Installation to link to both guides
TheWildJames 1 周之前
父节点
当前提交
7cbfbc0ca0
共有 5 个文件被更改,包括 160 次插入43 次删除
  1. 1 1
      README.md
  2. 1 1
      docs/index.md
  3. 15 41
      docs/installation.md
  4. 54 0
      docs/kernelflasher.md
  5. 89 0
      docs/magiskboot.md

+ 1 - 1
README.md

@@ -53,7 +53,7 @@ Full documentation: [docs/index.md](docs/index.md)
 
 ## Installation
 
-See **[Installation Guide](docs/installation.md)**.
+See **[Installation Guide](docs/installation.md)** — [Kernel Flasher](docs/kernelflasher.md) · [Patch boot.img with magiskboot](docs/magiskboot.md).
 
 ---
 

+ 1 - 1
docs/index.md

@@ -64,6 +64,6 @@ Per-feature documentation for the GKI2 kernels built from this repository.
 
 ---
 
-**Installation** — see [Installation Guide](installation.md) for flashing instructions (Kernel Flasher, KMI/SPL selection).
+**Installation** — see [Installation Guide](installation.md) ([Kernel Flasher](kernelflasher.md) · [Patch boot.img with magiskboot](magiskboot.md)).
 
 **Release Notes** — for build-specific version/commit info, see the [release workflow](https://github.com/WildKernels/GKI_KernelSU_SUSFS/actions/workflows/main.yml) or the releases page.

+ 15 - 41
docs/installation.md

@@ -1,56 +1,30 @@
 # Installation
 
 > [!CAUTION]
-> Flashing a kernel can brick your device and will void your warranty. Make a full backup (boot partition at minimum) before proceeding. You are responsible for your device.
+> Flashing a kernel can brick your device and will void your warranty. Make a full backup before proceeding.
 
-> [!NOTE]
-> This method is more convenient when upgrading KernelSU and can be done without a computer.
+Choose the method that fits your situation:
 
-## Prerequisites
-
-- Device with unlocked bootloader running a supported GKI kernel (see KMI below)
-- Root access already granted to the flashing app (for upgrades) or a working method to flash initially (fastboot / custom recovery)
-- Battery >50%
+| Method | When to use | Guide |
+|--------|-------------|-------|
+| **Kernel Flasher** | Upgrading with root already available, no PC needed | [kernelflasher.md](kernelflasher.md) |
+| **Patch boot.img manually** | Pixel / `lz4_legacy` or non-standard `boot.img` that won't boot directly | [magiskboot.md](magiskboot.md) |
 
 ## Choosing the correct AnyKernel3 ZIP
 
-Each release artifact is named by **KMI (Kernel Module Interface)** and **Security Patch Level (SPL)**.
-
-- **KMI** — e.g. `android12-5.10`, `android13-5.10`, `android13-5.15`, `android14-5.15`, `android14-6.1`, `android15-6.6`, `android16-6.12`. Must match your device's current kernel version. Check with `uname -r` or in Settings → About phone → Kernel version.
-- **SPL** — monthly security patch string in the filename. Pick the build closest to your current SPL; newer SPL is generally backwards compatible but read the release notes for breaking changes.
-
-If you don't know which file to download, carefully read the description of KMI and Security patch level in the release notes before downloading.
-
-## Install with Kernel Flasher (recommended)
-
-This requires the flashing app to have root permissions. On first install from stock (no root yet), flash via recovery or fastboot instead, then use this method for subsequent upgrades.
-
-### Steps
-
-1. **Download the AnyKernel3 ZIP** for your KMI/SPL from the latest [Releases](https://github.com/WildKernels/GKI_KernelSU_SUSFS/releases) page.
-2. **Open the Kernel Flasher app**, grant necessary root permissions when prompted.
-3. **Select the AnyKernel3 ZIP** you downloaded and flash. Do not interrupt the process.
-4. **Reboot** when prompted and verify KernelSU manager shows the expected version.
-
-### Supported flashing apps
-
-- [Kernel Flasher](https://github.com/fatalcoder524/KernelFlasher) — recommended, actively maintained
-- [PixelFlasher](https://github.com/badabing2005/PixelFlasher) — alternative with advanced options
-
-Both require root to flash a kernel from within Android. For initial installation without root, use fastboot (`fastboot flash boot`) or a custom recovery that can flash AnyKernel3 ZIPs.
+Each release artifact is named by **KMI** and **SPL**:
 
-## After flashing
+- **KMI** — `android12-5.10`, `android13-5.10`, `android13-5.15`, `android14-5.15`, `android14-6.1`, `android15-6.6`, `android16-6.12`. Must match `uname -r`.
+- **SPL** — monthly security patch level. Pick the build closest to your current SPL.
 
-- Install / update the matching KernelSU manager APK (see release assets `manager-apk-*`).
-- If using SUSFS, install the SUSFS module via the manager.
-- Verify with `su` or manager app that root is working.
+If you don't know which file to download, read the KMI/SPL description in the release notes.
 
-## Troubleshooting
+## After flashing (both methods)
 
-- **Bootloop** — restore your boot backup via fastboot/recovery.
-- **Wrong KMI** — re-flash with the correct KMI variant; KMI mismatch is the most common failure.
-- **Manager shows old version** — ensure you flashed the intended variant and rebooted fully.
+- Install / update the matching KernelSU manager APK (`manager-apk-*`).
+- If using SUSFS, install the SUSFS module.
+- Verify root with `su` or manager app.
 
 ---
 
-Related: [Kernel Features Documentation](index.md) · [Releases](https://github.com/WildKernels/GKI_KernelSU_SUSFS/releases) · [Kernel Flasher](https://github.com/fatalcoder524/KernelFlasher)
+See also: [Kernel Features Documentation](index.md) · [Releases](https://github.com/WildKernels/GKI_KernelSU_SUSFS/releases)

+ 54 - 0
docs/kernelflasher.md

@@ -0,0 +1,54 @@
+# Install with Kernel Flasher
+
+> [!NOTE]
+> This method is more convenient when upgrading KernelSU and can be done without a computer. Make a backup first.
+
+> [!CAUTION]
+> Flashing a kernel can brick your device and will void your warranty. Make a full backup (boot partition at minimum) before proceeding.
+
+## Prerequisites
+
+- Device with unlocked bootloader running a supported GKI kernel (see KMI below)
+- Root access already granted to the flashing app (for upgrades) or a working method to flash initially (fastboot / custom recovery)
+- Battery >50%
+
+## Choosing the correct AnyKernel3 ZIP
+
+Each release artifact is named by **KMI (Kernel Module Interface)** and **Security Patch Level (SPL)**.
+
+- **KMI** — e.g. `android12-5.10`, `android13-5.10`, `android13-5.15`, `android14-5.15`, `android14-6.1`, `android15-6.6`, `android16-6.12`. Must match your device's current kernel version. Check with `uname -r` or in Settings → About phone → Kernel version.
+- **SPL** — monthly security patch string in the filename. Pick the build closest to your current SPL; newer SPL is generally backwards compatible but read the release notes for breaking changes.
+
+If you don't know which file to download, carefully read the description of KMI and Security patch level in the release notes before downloading.
+
+## Steps
+
+1. **Download the AnyKernel3 ZIP** for your KMI/SPL from the latest [Releases](https://github.com/WildKernels/GKI_KernelSU_SUSFS/releases) page.
+2. **Open the Kernel Flasher app**, grant necessary root permissions when prompted.
+3. **Select the AnyKernel3 ZIP** you downloaded and flash. Do not interrupt the process.
+4. **Reboot** when prompted and verify KernelSU manager shows the expected version.
+
+This requires the flashing app to have root permissions. On first install from stock (no root yet), flash via recovery or fastboot instead, then use this method for subsequent upgrades.
+
+## Supported flashing apps
+
+- [Kernel Flasher](https://github.com/fatalcoder524/KernelFlasher) — recommended, actively maintained
+- [PixelFlasher](https://github.com/badabing2005/PixelFlasher) — alternative with advanced options
+
+Both require root to flash a kernel from within Android.
+
+## After flashing
+
+- Install / update the matching KernelSU manager APK (see release assets `manager-apk-*`).
+- If using SUSFS, install the SUSFS module via the manager.
+- Verify with `su` or manager app that root is working.
+
+## Troubleshooting
+
+- **Bootloop** — restore your boot backup via fastboot/recovery.
+- **Wrong KMI** — re-flash with the correct KMI variant; KMI mismatch is the most common failure.
+- **Manager shows old version** — ensure you flashed the intended variant and rebooted fully.
+
+---
+
+Related: [Installation Overview](installation.md) · [Patch boot.img Manually](magiskboot.md) · [Releases](https://github.com/WildKernels/GKI_KernelSU_SUSFS/releases)

+ 89 - 0
docs/magiskboot.md

@@ -0,0 +1,89 @@
+# Patch boot.img Manually (magiskboot)
+
+For some devices, the `boot.img` format isn't as common as `lz4`, `gz`, and uncompressed. A typical example is the Pixel, where the `boot.img` is compressed in the `lz4_legacy` format, while the ramdisk may be in `gz` or also compressed in `lz4_legacy`. Currently, if you directly flash the `boot.img` provided by KernelSU, the device may not be able to boot. In this case, you can manually patch the `boot.img`.
+
+> [!TIP]
+> It's always recommended to use `magiskboot` to patch images. There are two ways:
+> - [magiskboot (official)](https://github.com/topjohnwu/Magisk/releases) — runs on Android devices (and Linux)
+> - [magiskboot_build](https://github.com/capntrips/magiskboot_build) — cross-built binaries for Windows/macOS/Linux PCs
+>
+> The official build of `magiskboot` can only run on Android devices. If you want to run it on a PC, use the second option.
+
+> [!WARNING]
+> `Android-Image-Kitchen` isn't recommended for now because it doesn't handle the boot metadata (such as security patch level) correctly. Therefore, it may not work on some devices.
+
+## Preparation
+
+1. Get your device's stock `boot.img`. You can get it from your device manufacturer. You may need [payload-dumper-go](https://github.com/ssut/payload-dumper-go).
+2. Download the AnyKernel3 ZIP file provided by KernelSU that matches the KMI version of your device.
+3. Unpack the AnyKernel3 package and get the `Image` file, which is the kernel file of KernelSU.
+
+## Using magiskboot on Android devices
+
+1. Download latest Magisk from [GitHub Releases](https://github.com/topjohnwu/Magisk/releases).
+2. Rename `Magisk-*(version).apk` to `Magisk-*.zip` and unzip it.
+3. Push `libmagiskboot.so` to your device by ADB:
+   ```sh
+   adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot
+   ```
+4. Push stock `boot.img` and `Image` from AnyKernel3 to your device:
+   ```sh
+   adb push boot.img /data/local/tmp/
+   adb push Image /data/local/tmp/
+   ```
+5. Enter ADB shell and make it executable:
+   ```sh
+   adb shell
+   cd /data/local/tmp/
+   chmod +x magiskboot
+   ```
+6. Unpack `boot.img`:
+   ```sh
+   ./magiskboot unpack boot.img
+   ```
+   You will get a `kernel` file — this is your stock kernel.
+7. Replace kernel with the KernelSU Image:
+   ```sh
+   mv -f Image kernel
+   ```
+8. Repack the boot image:
+   ```sh
+   ./magiskboot repack boot.img
+   ```
+   You will get a `new-boot.img` file. Flash this file to your device by fastboot:
+   ```sh
+   fastboot flash boot new-boot.img
+   ```
+
+## Using magiskboot on Windows / macOS / Linux PC
+
+1. Download the corresponding `magiskboot` binary for your OS from [magiskboot_build](https://github.com/capntrips/magiskboot_build).
+2. Prepare stock `boot.img` and `Image` in your PC.
+3. Make it executable:
+   ```sh
+   chmod +x magiskboot
+   ```
+4. Unpack `boot.img`:
+   ```sh
+   ./magiskboot unpack boot.img
+   ```
+   You will get a `kernel` file — this is your stock kernel.
+5. Replace kernel:
+   ```sh
+   mv -f Image kernel
+   ```
+6. Repack:
+   ```sh
+   ./magiskboot repack boot.img
+   ```
+   You will get a `new-boot.img` file. Flash it by fastboot:
+   ```sh
+   fastboot flash boot new-boot.img
+   ```
+
+> [!INFO]
+> Official `magiskboot` can run in Linux environments normally. If you're a Linux user, you can use the official build.
+
+---
+
+Related: [Installation Overview](installation.md) · [Install with Kernel Flasher](kernelflasher.md) · [Releases](https://github.com/WildKernels/GKI_KernelSU_SUSFS/releases)